Announcement

Collapse
No announcement yet.

Divergence Confusion

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Divergence Confusion

    Hello,

    Can someone please take a quick look at the attached efs and just explain what its attempting to achieve on line 198, where it begins with //was it a high pivot we found and line 223 where it begins //or a low pivot?

    For you efs experts this won't take up too much of your time.

    Cheers

    Carlton
    Attached Files

  • #2
    Carlton,

    Go to steps 206 and 207

    nSVal1 = study1.getValue(sStudyString, -nPiv1);
    nSVal2 = study1.getValue(sStudyString, -nPiv2);


    When I am faced with a study that I am not sure why things are being done, I select one of the variables, and I search the efs for all uses of the variables. Usually, you will see elsewhere in the code where they have been assigned.

    In this case, sStudyString

    52 var sStudyString = null;

    128 sStudyString = CCIStudy.CCI;

    136 sStudyString = RSIStudy.RSI;

    145 sStudyString = StochStudy.SLOW;



    then take a look at nPIV1 next and do the same thing, you will soon find out that all these steps are doing is getting the values of the studies that have been selected using

    93 aFPArray[x] = new FunctionParameter( "frStudy", FunctionParameter.STRING);

    at their pivot points.

    Comment


    • #3
      Steve,

      Thats great. But how is the efs affected if the pivot point is low or high?

      Please, I'm on a steep learning curve

      Cheers

      Carlton

      Comment


      • #4
        I guess the question should be 'how should I interpret the chart if the pivot point is low or high'? They both give the same signal on the chart

        Thanks

        Carlton

        Comment


        • #5
          Oh, I think I get it.

          The pivot points are the tops and bottoms of prices, correct. If so, which one in your opinion is the stronger signal?

          Cheers

          Carlton

          Comment


          • #6
            I had not played around this efs before, but now I notice it is Chris D. Kryza's. He is an efs Wizard, it usually takes me days to figure out exactly what he is doing on his stuff...

            In this case however, it is very well commented (not to say his other stuff is not, he is just a very, very, advanced programmer). Having said that please take a look at

            lines 176 through 178
            //first, see if we have a potential high or low pivot forming based on
            //the most recent 2 or 3 bars. If so, then we will use this point as our
            //first pivot and we will work back from there.

            this explains what he is doing in lines 180 through 197

            steps 198 through 207 are annotated


            //was it a high pivot we found

            In these steps, it gets the prices at these pivot points, then obtains the chosen technical indicator values at those points.

            steps 209 and 210 look to see if price and indicators diverge, in this case a bearish divergence
            //if a divergence, draw it
            if ((nVal1 >= nVal2) && (nSVal1 < nSVal2)) {


            Then, this is very important,
            if (nSVal1<150) //--remove this line if not using CCI
            if not using CCI, comment this line out, otherwise, this if statement, if not true, will skip the next line where the line is actually drawn.

            I hope this helps

            Comment


            • #7
              Steve,

              That is great mate.

              One more thing. Can you please define what Chris is referring by the Pivot Points?

              Cheers

              Carlton

              Comment


              • #8
                Carlton,

                Think of a teeter-tauter which pivots in the middle. A more appropriate discussion can be found here

                BTW - this is a very good link to save as a reference, it has very concise descriptions of a number of the trading concepts and terms used on this BB.

                Regards

                Comment


                • #9
                  Steve,

                  Thanks

                  Carlton

                  Comment

                  Working...
                  X