Comments (9)
I don't think I'm understanding what you're asking.
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 ?
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 gain by this should be huge.
Performance is a goal of this library. There is a benchmark against ta-lib here.
from tulipindicators.
If we were storing/using the previously calculate SMA, it would be O(1) implementation.
Similar to https://github.com/askmike/gekko/blob/develop/strategies/indicators/SMA.js
from tulipindicators.
It does run in linear time. I guess you didn't look at the code I linked to?
from tulipindicators.
Hi,
I did look at the code, from what i understood, we are iterating over the input as fresh input in "for loop".
This is linear time implementation but this can be done in constant time if we have already computed SMA for previous window. (Previous SMA just didn't include the latest candle)
Is there some other platform where we can chat?
from tulipindicators.
I think whats missing here is context,
If we calculate SMA the way we are currently doing we are kind of assuming that we have a single chart of candlesticks and then we computed the SMA for it just once and displayed it as a overlay over original chart.
But in reality, the candlestick graph keeps on updating and adding new candles.
This is true for :
- Showing the graph live on some trading exchange.
- Using trading bot in live market, which needs to calculate this indicator again and again for every new candle.
- While testing existing trading-bot over historical data, we would need to calculate this indicator again and again since candles are being ingested one-at-a-time.
When we are adding new candle to graph every minute, it is sub-optimal to calculate whole SMA again and again every minute.
Instead we need to re-use the SMA which was computed without considering the latest candle from input. This will result in savings of redundant computation.
from tulipindicators.
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
from tulipindicators.
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 am pretty new to technical analysis, i will try if i can implement some reference indicator.
I will go on and request support for streaming interface in tulipy.
from tulipindicators.
And... What happened?
from tulipindicators.
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.
from tulipindicators.
Related Issues (20)
- Market Meanness Index HOT 1
- SAR HOT 1
- C++, vectors HOT 3
- make 'crossany' more useful HOT 1
- Compilation issue under VS2019 HOT 6
- NaN is omitted by tulipy HOT 1
- ATR index error HOT 2
- Polarized Fractal Efficiency indicator HOT 5
- Adding Donchian Channels HOT 1
- Missing Values in Example Calculation for Awesome Oscillator HOT 4
- Stochastic RSI cannot be negative HOT 1
- 0.9.1 Release
- Docs Duplicate Indicator to %R: Quality Factor (%Q) HOT 4
- Default options for indicators? HOT 3
- MacbookPro m1 build failed!!!! HOT 1
- Please add JMA Jurik moving average HOT 1
- How can I support append calculations? HOT 1
- Question: Why add indicators.h candles.h indicators.c candles.c into final library HOT 5
- Package library
- Correlation Trend Indicator (CTI)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tulipindicators.