Skip to content

Interim Updates of Indicators #8620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
ArthurAsenheimer opened this issue Mar 11, 2025 · 0 comments
Open
3 tasks done

Interim Updates of Indicators #8620

ArthurAsenheimer opened this issue Mar 11, 2025 · 0 comments

Comments

@ArthurAsenheimer
Copy link
Contributor

ArthurAsenheimer commented Mar 11, 2025

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, 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant