TS code help for Demark Seq Setup

darsur

Newbie
Messages
2
Likes
0
Hi guys I have written down this code in tradestation.I get the ouptput but the problem is it doesnt give a proper output.
My code is

Code:
INPUT:COUNT(9),BARSBACK(4);

VAR:COUNTER(0),Z(0);

IF C<=C[BARSBACK] THEN COUNTER=COUNTER+1 ELSE COUNTER=0;

IF COUNTER=COUNT THEN BEGIN
 
      FOR Z=1 TO COUNT BEGIN
      z = Text_New(date[z],time[z],low[z],numtostr(z,0));
      value2 = Text_SetStyle(z,2,0);
      value2 = Text_SetColor(z,red);
  END;
END;

and the output that i get is in the picture attached. I can just see the setup numbers for the first time the loop is executed...next time it just plots 1 all the time...can anyone tell me whats the error in my code
 

Attachments

  • untitled.JPG
    untitled.JPG
    38 KB · Views: 454
Top