You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are able to get an intraday preview of an indicator without distorting its internal state.
Actual Behavior
This is currently not possible. Calling the Update method of an indicator does impact its internal state. For instance, the RollingSum for SMA or AverageGain and AverageLoss for RSI are also updated.
Motivation and Context
Currently, daily indicators are only updated at market close, i.e. once the daily bar has completed.
However, in many strategies, there is a need to obtain an interim indicator value (e.g. 5 minutes before market close) by using the current intraday price. This would enable making trading decisions within the ongoing trading session rather than waiting until the next day's market open.
Potential Solution
I see 2 possible approaches to handle this:
1.) Equip IndicatorBase with a Copy or Clone method.
We could then use the cloned instance for our interim (manual) updates and discard it afterwards, thereby avoiding changes to the state of our actual indicator. It's important that this is a deep copy.
I tested deepcopy in Python, but it doesn't work because the C# objects are not pickleable.
2.) Equip IndicatorBase with a Revert or Rollback method.
Essentially, it would be the inverse of Update, returning the indicator to its previous state.
I assume approach 1.) might be the easiest for you to implement. What do you think?
By the way, this is a feature that has been requested quite frequently by my clients as most other platforms also display interim updates of indicator values.
Checklist
I have completely filled out this template
I have confirmed that this issue exists on the current master branch
I have confirmed that this is not a duplicate issue by searching issues
The text was updated successfully, but these errors were encountered:
Expected Behavior
We are able to get an intraday preview of an indicator without distorting its internal state.
Actual Behavior
This is currently not possible. Calling the
Update
method of an indicator does impact its internal state. For instance, theRollingSum
forSMA
orAverageGain
andAverageLoss
forRSI
are also updated.Motivation and Context
Currently, daily indicators are only updated at market close, i.e. once the daily bar has completed.
However, in many strategies, there is a need to obtain an interim indicator value (e.g. 5 minutes before market close) by using the current intraday price. This would enable making trading decisions within the ongoing trading session rather than waiting until the next day's market open.
Potential Solution
I see 2 possible approaches to handle this:
1.) Equip
IndicatorBase
with aCopy
orClone
method.We could then use the cloned instance for our interim (manual) updates and discard it afterwards, thereby avoiding changes to the state of our actual indicator. It's important that this is a deep copy.
I tested
deepcopy
in Python, but it doesn't work because the C# objects are not pickleable.2.) Equip
IndicatorBase
with aRevert
orRollback
method.Essentially, it would be the inverse of
Update
, returning the indicator to its previous state.I assume approach 1.) might be the easiest for you to implement. What do you think?
By the way, this is a feature that has been requested quite frequently by my clients as most other platforms also display interim updates of indicator values.
Checklist
master
branchThe text was updated successfully, but these errors were encountered: