[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MarketPr*file .ELA code error - code attached



PureBytes Links

Trading Reference Links

Attached is my code.  I get a verifying error at the following line:

"if c st then begin {plot line to show last tick}"

          ^--- grammar exception error, expecting word DAY or DAYS here.
  
   ?

This is located on the 12th line at the bottom of the code.

I am using TradeStation 4.0 PowerEditor, Build 21.

Thanks!:)

    


------------------------ MP.ELA (Market Pr*file code)

   {indicator: mpro4.0 (m***** profile style plot)
   put on a 1-tick chart of day session bonds, set for 1 day of data. set
   data style to invisible bars, set scaling to entire data series for both
   data & this indicator. set indicator properties to subgraph hidden, 
maxbarsback=0,       update every tick. 1st tick(open) price row is red, 
all others are yellow, red          trendline shows last tick. colors,etc. 
are harcoded but easily changed. best viewed    on black background chart. 
note: plot is at FAR LEFT edge of chart, so scroll chart    all the way to 
left and leave it there!  bar spacing should probably be set to       
minimum.}

   vars:lett("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),lcount(1),fp(0),xp(0),z(0),xp1
   (0) ;
   vars:hh(0),ll(0),x(96),count(0),y(100),minadd(30),et(0),st(720),
   clet("_A"),curtxt("");
   array:pri[200](0);

   if CurrentBar=1 then begin
   et=Addtime(st,minadd);
   fp=c; {first price, used to calc offset of later ticks in xp calc
   below}
   for y=1 to 200 begin {initialize all possible text ref locations}
   pri[y]= text_new(d,st+1,c-3+y points,".");
   TEXT_SETCOLOR(pri[y],7); {yellow}
   TEXT_SETSTYLE(pri[y],0,2);
   end;
   curtxt=text_getstring(pri[x]);
   text_setstring(pri[x],curtxt+clet);
   TEXT_SETCOLOR(pri[x],6); {make opening price red }
   hh=c;ll=c;
   end;
   xp1=xp;
   xp=intportion((3+c-fp+0.005)/0.03125) - 96;
   IF T >= ET then begin {a new time period just started}
   lcount=lcount+1; {letter count : 1=A,2=B,..}
   clet="_"+midstr(lett,lcount,1) ;
   et=addtime(et,minadd);
   hh=c;ll=c;
   curtxt=text_getstring(pri[x+xp]);
   text_setstring(pri[x+xp],curtxt+clet);
   end;

   if c > hh or c < ll then begin
   if c> hh then hh=c;
   if c st then begin {plot line to show last tick}
   z=z+1;
   if z=1 then begin
   value10=tl_new(d,st,c,d,t,c);
   tl_setcolor(value10,6);
   tl_setsize(value10,1);
   end else begin
   tl_setbegin(value10,d,st,c);
   tl_setend(value10,d,t,c);
   end;
   end;

   plot1(c,"dummy");

------------------------------------ The END! :)