periodically or in some time-based frequency.
For example:
- Strategy need to move stoploss behind drawdown after 5 minutes in trades.
- Or wants to enter the trades 15 seconds before 8:30 AM CST.
With current events - like OnBarUpdate() this is not able to achieve in a timely manner,
because this event comes once for a bar-update, which can be much more later,
then required.
Example of problem:
strategy used M15 timeframe and if there is no bar update (in the night time),
then the strategy cannot detect such an time-based event.
I know, the solution can be custom implemented, for example with some new thread calling our strategy each 5 seconds, but time-based events are very common thing
used in trading strategies. And such a basic thing should not require much of custom programmin - they should be implemented in the strategy and should just use it.
Solution:
Add new virtual method OnTimeUpdate(),
which would be empty by default and called with default 1 second frequency.
User can then implement any time-based events.
Comment