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

Re: Indicator Refresh



PureBytes Links

Trading Reference Links

Tom <options@xxxxxxxxxxxxxxx> asks:
>I would like to refresh an indicator one bar at a time, is this
>possible to do in ELA code? I do it now by turning the status on off
>on but this gets old by lunch and real old by the close. 

Another FAQ, and the answer is probably "no."

You can try adding a refresh-triggering set of plot statements to
your code, something like: 

plot1(9999999, "trigger");
plot1(close, "trigger");

with scaling set to "screen."

I don't know if two plot1() statements like that would actually
trigger a refresh; I've considered trying it, out of curiosity, but
have never gotten around to it during trading time, when the real-time
data would be there to test it.  The theory would be that the
outlandish value would trigger a rescaling operation on the chart,
and the second plot would restore the chart to sanity. 

Another approach is to remember the old value of your indicator,
and "erase" the old mark by plotting over it with a spare plotx[1]()
statement, set to the chart background color.  It isn't perfect,
as it sort of tears holes in other chart art sometimes, but it's
better than nothing.

Jim