Announcement

Collapse
No announcement yet.

S3 R3 PivotPoint Equation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • S3 R3 PivotPoint Equation

    Does anyone know for sure the equation used to calculate pivot points S3 and R3? I've found several variations, and I'm not sure which is correct.

    For R3, I found:
    vLastPPR3 = vLastPPR2 + (vH-vL);
    also;
    vLastPPR3 = (vLastPP - vLastPPS1) + vLastPPR2;

    For S3, I found:
    vLastPPS3 = vLastPPS2 - (vH-vL);
    also;
    vLastPPS3 = vLastPP - (vLastPPR2 - vLastPPS1);

    and there might be others if I looked further. What is the correct equation?

  • #2
    Here are the correct pivot formulas:

    P = (H + L + C) / 3;
    R1 = 2 * P - L;
    S1 = 2 * P - H;
    R2 = (P - S1) + R1; //Also same result: P + (H - L)
    S2 = P - (R1 - S1); //Also same result: P - (H - L)

    R3 = (P - S1) + R2; //Also same result: (P + R2) - S1
    S3 = P - (R2 - S1); //Also same result: (P - R2) + S1

    Some references re. S3/R3:



    - Tradesphere Pivot Buddy calculates pivots to R5/S5
    - Formulas to R3/S3: Click on Training Center > Pivot Points

    Comment


    • #3
      To link this to another thread I just posted on, These are the same that Ral Lockhart teaches (I just found the calculator on his web site). I assume someone has already coded these (can you tell I don't use them?), but if not I can take a swag at it.

      Garth
      Garth

      Comment


      • #4
        Garth, here is one I found at TradeSphere.com that displays pivots to R5/S5, including 50% points between pivot values.
        Attached Files
        Last edited by Lancer; 05-18-2003, 02:48 PM.

        Comment


        • #5
          I added High (vH), Low (vL), and Close (vC) lines to the return array in this formula, but the H/L/C line style and colors are not per the specs in premain (although the spec numbers in premain match up with the variable name positions in the array). All three H/L/C lines are appearing in the same color, and are not dashed. Can anyone see what the problem is?
          Attached Files

          Comment


          • #6
            Lancer
            Changing the color for S5 (Line 149) from Color.RGB(0,255,255) to either Color.cyan or Color.RGB(0x00, 0xFF, 0xFF) seems to unlock the colors for vH, vL and vC.
            Also, changing the Pen Style for vH, vL and vC from PS_DASH to PS_DASHDOT plots the corresponding lines as dashes.
            I have no idea as to the reasons for either of the above.
            Alex

            Comment


            • #7
              Alexis, I found the problem on line 149. typo. "RBG" vs. "RGB" No syntax error reported for it. The formula apparently stopped formatting the array at that point, so subsequent items vH, vL, and vC were apparently assigned the last good color and syle (per lines 143, 144, 145). Fixed the typo, and everything displays as intended.

              Comment

              Working...
              X