Announcement

Collapse
No announcement yet.

Support and Resistance Code for TradeStation

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

  • Support and Resistance Code for TradeStation

    Hi Alex

    Can you help me to find out Code of Support and Resistance(Pivots points) for trade station. If you have can you pl. post it ?


    Thanks
    sukh

  • #2
    sukh
    Here is a ShowMe script for Pivots that I found a while back on some other list
    Alex

    Code:
    Var:  Hi(0),
      Lo(99999),
      YHi(0),
      YLo(99999),
      YCl(0),
      Pivot(0),
      R1(0),
      S1(0),
      R2(0),
      S2(0);
    
    IF BarNumber = 1 OR Date[1] < Date THEN BEGIN
     YHi = Hi;
     YLo = Lo;
     YCl = C[1];
     Hi = H;
     Lo = L;
    END ELSE BEGIN
     IF H > Hi THEN Hi = H;
     IF L < Lo THEN Lo = L;
    END;
    
    { Formulae for "Support & Resistance" }
    
    Pivot = (YHi + YLo + YCl) / 3;
    R1 = (2 * Pivot) - YLo;
    S1 = (2 * Pivot) - YHi;
    R2 = (Pivot - S1) + R1;
    S2 = Pivot - (R1 - S1);
    
    { Note method to make 5 plots with 3 Plot statements: gains extra plots
    at a cost of resolution }
    
    IF Mod(BarNumber,2) = 0 THEN Plot1(R1,"1st") ELSE Plot1(S1,"1st");
    IF Mod(BarNumber,2) = 0 THEN Plot2(R2,"2nd") ELSE Plot2(S2,"2nd");
    Plot3(Pivot,"Pivot");
    
    { Note: Plot1 & Plot2 must be plotted as "Points" and not as "Lines" }

    Comment


    • #3
      Thanks for the reply Alex

      Let me try.
      sukh

      Comment


      • #4
        Hi Alex
        sorry to bother u again
        code is working fine but it squeeze the chart, I mean in chart window shows all pivots and bars become short.

        Is there any way that either I may wide the chart or i may see 1 or 2 pivot levels.

        Thanks
        sukh

        Comment


        • #5
          sukh
          Other than commenting out R2/S2 I can't see what else could be done.
          To comment those out insert { at the beginning and } at the end of the following line of code
          IF Mod(BarNumber,2) = 0 THEN Plot2(R2,"2nd") ELSE Plot2(S2,"2nd");
          Alex

          Comment


          • #6
            Hi Alex

            I got it.

            Thank You very much for your precious time
            sukh

            Comment

            Working...
            X