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

Re: Code Problem



PureBytes Links

Trading Reference Links

>This code is supposed to calculate the number of minutes in a tick bar and
>put it on the screen. It works most of the time but not always. Your help
>suggestions are appreciated.


NEVER expect TradeStation to parse complex expressions like a real programming language...

You have to do everything in baby steps...

The term AV(mins) looks like a function call so I hope it is a function in your system.

Bob Fulks


Input: COLOR(Tool_White), PP(H),abv(1);

  Vars: Min1(0), Mins(0), newtext(0), Sbar(0);
  Min1 = TimeToMinutes(Time);
  Mins = Min1 - Min1[1];

Value1 = Iff(Mins>0 and time>Sess1StartTime, Mins, MinInDay-AV(mins));

newtext = text_new(date,time,PP,numtostr(Value1,0));
Value2 = text_setstyle(newtext,2,abv);

{changes numbers to red for white charts.}
if GetBackGroundColor=Tool_White
   then Value4=Text_SetColor(newtext, Tool_Red)
   else Value4=Text_SetColor(newtext, Color);

if false then plot1(C,"");

B.