Dynamically extend Lookback period

Posted By: AndrewAMD

Dynamically extend Lookback period - 12/28/22 16:09

LookBack can currently be set to a fixed value (i.e. 0, 500).

But sometimes I have a series() that accumulate elements under strange occasions. I can identify programmatically when I have enough elements.

So it can work like this:

Script calls extendLookBack(1) when more lookback is needed to accumulate enough series elements.
Script later calls extendLookBack(0) when enough elements are accumulated. At the end of this run, Logfile will read, "End of lookback period".
Posted By: jcl

Re: Dynamically extend Lookback period - 01/02/23 09:27

That would be difficult to implement, because many functions rely on a fixed download period. You could either use a download period that covers the maximum elements of that series, or calculate the number of elements before setting LookBack, or use a flag that prevents trading until the series is filled.
© 2024 lite-C Forums