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

Indicator syntax help request



PureBytes Links

Trading Reference Links

Is there any way to get around not being able to
use "variables" in indicator parameter lists? For 
instance, if I do the following:

Lookback:=Input("Time Periods",2,200,10);

PctChg:=If(Lookback<=30,3,
 If(Lookback>30 AND Lookback<=100,
  3+((Lookback-30)/10),
  10+((Lookback-100)/20)));

Peak(1,H,PctChg);

I get a message from Indicator Builder that says that
I can't use a "variable" (PctChg) in the Peak function.
You'll notice that PctChg only uses Lookback, which
doesn't change from bar to bar, so it stays constant. 
I'm not clear as to why this doesn't work, but if it's OK 
if I do:

PctChg:=Input("Percent Change",3,50,3);

Peak(1,H,PctChg);

Is this a feature?