PureBytes Links
Trading Reference Links
|
> From: Todd Hanson [mailto:todd@xxxxxxxxxxxx]
> Is there anyone out there who can point me in the right direction
> for either
> a work around using easylangauge or a .dll that will allow a strategy to
> generate a order based on a intrabar signal and not wait until
> end of bar to
> calculate the strategy? Thank you and take care.
Todd,
What I do is to put multiple data streams onto a single chart and serious
programming. If you get your signals from a fifteen-minute chart, put the
one-minute chart (for instance) as Data1 and the fifteen as Data2.
Next, capture the signal results from the finished fifteen minute bar and
store that answer, for instance on the Stochastic (Note the "15" variables):
if Mod(T, 15) = 0 then
signal15 = Stochastic(H Data2, L Data2, C Data2, 5, 3, 5 1, fastK15,
fastD15, slowK15, slowD15);
To calculate the signal intra fiften minute bars, you now need to reset the
Stochastic's rolling calculations to the previous 15-minute bar's signal
each time you call the Stochastic for minutes 1-14:
fastK1 = fastK15;
fastD1 = fastD15;
slowK1 = slowK15;
slowD1 = slowD15;
signal1 = Stochastic_Intra(H Data1, L Data2, C Data1, 5, 3, 5, 1, fastK1,
fastD1, slowK1, slowK1);
Note that you are now passing one-minute prices into the stochastic but
using the results from the previous fifteen minute bars.
This was the easy part. The more challenging part is that any function you
use for a signal that references past values (e.g. MyFunction =
MyFunction[1], Price[1], etc), you will just need to rewrite the function to
make such references NumericRefs and pass the state back and forth to and
from your strategy (as the Stochastic does).
Sincerely,
Wes Williams
Software Architect
|