-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
Optimizing Rolling Window Indicators #90
Comments
I don't think I'm understanding what you're asking.
That is exactly how the code works. For each output, it subtracts the oldest bar in the average, and adds in a new bar. See here.
Performance is a goal of this library. There is a benchmark against ta-lib here. |
If we were storing/using the previously calculate SMA, it would be O(1) implementation. |
It does run in linear time. I guess you didn't look at the code I linked to? |
Hi, |
I think whats missing here is context, But in reality, the candlestick graph keeps on updating and adding new candles.
When we are adding new candle to graph every minute, it is sub-optimal to calculate whole SMA again and again every minute. |
I see. You're not talking about the initial calculation (in which linear time is optimal), but instead about updating the calculation over time. We're working on a streaming interface for the next release that does exactly what you're asking. It's currently in the 0.9 branch. See here: https://github.com/TulipCharts/tulipindicators/blob/0.9/indicators/sma.c |
Went through very useful discussion on #57 . I read through the comments and it was very insightful. Is 0.9 #35 ready ? Why isn't this merged to mainline? I will see if i can contribute to this project but i am not that familiar with writing optimized C code. I will go on and request support for streaming interface in tulipy. |
And... What happened? |
We lost the sponsor for this feature, and it's not a priority for me at this time. If someone else wants to sponsor the work, it'll happen much faster. The way I use this library is primarily for back-testing, and the routines are already optimal for that. The calculation load for running live algos, where the implementation isn't optimal, is minuscule compared to back-testing. |
Regarding most of the rolling window indicators for example SMA,
Why isn't the previously calculated SMA Indicator used as an optimization similar to dynamic programming?
For e.g in SMA didn't we only need to exclude the oldest period value in average and include the latest period value to calculate one additional point in SMA ?
I see that most of the indicators are like this. Performance gain by this should be huge.
Am i missing something ?
The text was updated successfully, but these errors were encountered: