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

Re: EL Averaging Function



PureBytes Links

Trading Reference Links

Dale Williams <dalew@xxxxxxxxxxxx> asks:
>I support a commodity trader's PC equipment. He is running TS2000i
>on a trial basis under WinNT and he has an indicator that is taking
>the Average (Open, Low, High, Close) of a bar and he would rather
>have it take the average of the ticks in that bar... 
>
>Does anyone know which built-in function in Easy Language would do what he
>is asking for, or is this getting into more programming steps than I (the
>hardware guy) or he (the computer illiterate) is capable of doing?

I don't know about TS2000i, but in earlier versions here's what you'd
do: Using a third-party Global Variables add-on, such as Doug
Deming's GlobalPro, keep track of the end of each bar, that is, note
when it occurs, and also keep track of the price of each tick during
that bar (add it to a running sum in this case), as well as the
number of ticks in the bar.  When you detect the end of the bar,
compute your average function, clear your running sum for the next
bar, and plot the result.  Set your indicator to "run on every tick"
and you're in business. 

The reason you need to use global variables is because EL indicators
don't "remember" the values of internal variables except at the ends
of a bar, even though they may be set to run each tick.

Obviously this is non-trivial programming, although it's quite
straightforward.  If TS2000i actually has global variables, as
was mentioned some time ago as a posibility, perhaps you can use
that feature.

Jim