Comments (4)
You can look at the Pandas TA code as well:
https://github.com/twopirllc/pandas-ta/blob/main/pandas_ta/momentum/rsi.py
This matches very close to TA-Lib
from indicators.jl.
@Sinansi Thanks for raising this, I appreciate the detailed question. Some of the difference may come from having different default conventions for computing the moving average for the relative strength. It seems like the TA-Lib function uses simple moving average, where the default for the Indicators rsi
function is exponential moving average. I tried an experiment using rsi(px, n=14, ma=sma)
and got somewhat closer, though it still doesn't perfectly replicate the TA-Lib result.
I'm having trouble discerning from the TA-Lib docs/source what the source of the difference might be. Would you happen to have a sample of RSI code that replicates the TA-Lib result that I can compare with? Happy to dive in and figure out the disconnect, but if you have a starting point from which I can compare methodology that would help a great deal.
from indicators.jl.
@dysonance thanks for the reply!
Indeed, you are correct. I totally forgot that some implementations of RSI, internally adds a smoother to the raw indicator.
I found some source code of TA-Lib in C, and they dont use SMA neither EMA. They internally apply Welles Wilder's Moving Average, which is slightly different from than the traditional moving averages.
Here is the Welles Wilder Moving Average, Quote from (www.incrediblecharts.com)
The standard exponential moving average formula converts the time period to a fraction using the formula EMA% = 2/(n + 1) where n is the number of days. For example, the EMA% for 14 days is 2/(14 days +1) = 13.3%. Wilder, however, uses an EMA% of 1/14 which equals 7.1%. This equates to a 27-day exponential moving average using the standard formula.
This is why comparing Indicators.rsi with Talib.RSI give slightly different correlation.
from indicators.jl.
@dysonance I wanted to send you a link for TALib source code as requested, but their website is broken. I have sent you the source code by email.
from indicators.jl.
Related Issues (20)
- Running Statistics Are Slow HOT 6
- TimeSeries not supported directly HOT 3
- `runmean` doesn't support `Int` array HOT 7
- Tag a new release to improve compatibility HOT 2
- Can not install "Indicators.jl" with latest "Plots(v1.6.4)" and "RecipesBase" ! HOT 1
- hurst and runmad slow HOT 2
- rolling regressions HOT 1
- `ERROR: MethodError: no method matching !(::BitVector)
- Feature Request: Exponentially Weighted Running/Rolling Statistics
- Functions that depend on `wma` don't work with `Float32` arrays
- Support views HOT 2
- Simple Moving Average with the end points HOT 1
- TagBot trigger issue HOT 1
- Incompatible with other packages HOT 4
- Updatable indicators
- Is Heikin Ashi calculation correct?
- No support for HTTP >1 due to Temporal.jl HOT 3
- Nadaraya-Watson Envelope [LUX]
- Discussion for integration with `TSFrame` HOT 1
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 indicators.jl.