Announcement

Collapse
No announcement yet.

Another Pivot Formula Request

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

  • Another Pivot Formula Request

    Here's another formula reqest for pivots.

    A variable pivot range based on the last 3 days (or any #) where
    the formula would be the

    PivotA= 2*((HH3 + LL3 + Previous Day Close)/3)-((HH3+LL3)/2)

    PivotB=(HH3+LL3)/2

    Reference: Mark Fisher's book "Logical Trader"

  • #2
    danlwhite
    Some time ago Garth Doverspike posted an efs to be used with multiple time frames and designed to be easily adapted to requests such as yours (see this thread for more information). I believe he is currently refining it so you may want to wait for the improved version.
    In the mean time here is another solution. The attached efs was originally programmed by JasonK and has been modified by me for this purpose.
    The script will look back an x number of days (3 as a default) and plot the Highest High, Lowest Low and the two Pivots you requested. Results are shown in the image below.
    You can change the lookback period through Edit Studies.
    For this formula to work you must have getPrevDaysOHLC.efs in the OHLC subfolder of the Formulas folder.
    Alex

    Attached Files
    Last edited by ACM; 05-22-2003, 06:00 AM.

    Comment


    • #3
      I have tried it out but it does not follow the Fisher rules. For some reason it does not take the 3 days preceding high and low for the current day. There is a gap before it uses the data.

      I have tried all the files on eSignal and as yet no one has managed to achieve a 3 day rolling pivot as described by Fisher.

      Comment


      • #4
        matthewholmes

        For some reason it does not take the 3 days preceding high and low for the current day. There is a gap before it uses the data.
        In reviewing the formula I can see the error you are referring to. It is in fact calculating the 3 day High and Low starting from two days back instead of one day back and also retrieving the Close of two days ago instead of the prior day's Close.
        I have corrected the formula and replaced the original.
        Alex

        Comment


        • #5
          I can't seem to find the "getPrevDaysOHLC.efs" required in my ES formulas directory anywhere. Is there a link to get it from the forum?

          Thanks...Dennis

          Comment


          • #6
            Thats certainly done the trick. Is there anyway I can modify this to remove the high and low lines and for it only to show the pivot and midpoint (pivot range) with the midpoint a black line also?

            Many thanks

            Comment


            • #7
              Sorry guys and girls I have just noticed that although the midpoint is being calculated right the pivot point is not. I have formula Highest high + lowest low + last close divided by 3. For some reason the pivot formula for pivot a is different. (I have changed the colours of the lines in the formula successfully and used white to hide highs and lows).

              Can someone see if I am missing something here...?

              Comment


              • #8
                Dennis
                See this thread for a link to the file. FYI I found the thread by running a Search for the keyword getPrevDaysOHLC*
                Alex

                Comment


                • #9
                  matthewholmes
                  As far as I can tell the values returned for PivotA appear to be correct based on the equation specified by danlwhite who started this thread (see the first post) ie
                  PivotA= 2*(HH3 + LL3 + Previous Day Close)/3)-((HH3+LL3)/2)
                  Using $INDU as an example here is the equation with the values filled in (for Friday April 20th)
                  PivotA = 2*((12838.46 + 12707.45 + 12808.63)/3)-((12838.46 + 12707.45)/2) = 12796.74
                  which is what is returned by the study (see enclosed image)
                  Alex

                  Comment


                  • #10
                    Any chance you could have a look at why the pivot a /close value is not correct? Please - I have tried to amend the formula but i don't know what I am doing

                    Comment


                    • #11
                      Sorry did not see your last post.

                      The equation is not correct for Fisher 3 day rolling pivot.

                      Pivot point pivot A should be =

                      (HH + LL + last days close)/3

                      I tried to change the formula to this but it says syntax error on that line

                      The correct value for the close is the one in prev close.efs is this the same as CC in your formula?

                      Comment


                      • #12
                        matthewholmes

                        The equation is not correct for Fisher 3 day rolling pivot.
                        As I indicated in my previous reply the equation used in the script for PivotA is based on the specifications provided by the starter of the thread [who may not have necessarily intended to calculate Fisher's 3 day rolling pivot]

                        The correct value for the close is the one in prev close.efs is this the same as CC in your formula?
                        CC returns the value of the prior day's Close.
                        Alex

                        Comment


                        • #13
                          Thanks Alex, for some reason i have been amending the formula wrong. this time it allowed me to change it.

                          For those of you who interested to use the formula now I have changed it will find a 3 day rolling pivot range as Fisher uses with his ACD method. remember you also need the file getPrevDaysOHLC.efs in your OHLC folder. Available below.

                          This formula can be altered to do 4 day 5 day rolling average etc.
                          Attached Files

                          Comment


                          • #14
                            Damn! I have a glitch with this formula. First time you apply the formual to a chart it calculates it fine. Then when you reopen a saved chart it says Error High in the mini data box and refers to a syntax error on line 77. I have no idea why this is happening. Does anyone with some formula writing experience have any clues why?

                            Comment


                            • #15
                              matthewholmes
                              To prevent that error from occurring declare CC as a global variable (ie outside of the preMain or main functions) and set it initially to null
                              Alex

                              PHP Code:
                              var CC null;

                              function 
                              main(){ 

                              Comment

                              Working...
                              X