arkochhar / technical-indicators Goto Github PK
View Code? Open in Web Editor NEWTechnical Indicators used in Stock Market Analysis
License: GNU General Public License v3.0
Technical Indicators used in Stock Market Analysis
License: GNU General Public License v3.0
It would make it easier to install and use it in multiple systems.
Moving average exponential results are not matching with the zerodha kite connect output
I have tried 20 days EMA base field as Close and results are having gap
Hi
When i'm trying to run unit test cases getting this error.
EMA Test with alpha False
Time taken by Pandas computations for EMA 0.00962901115417
Time taken by manual computations for EMA 0.0966241359711
Total Rows: 5232
Columns Match: 5
Success Rate: 0.0%
EMA Test with alpha True
Traceback (most recent call last):
File "indicator.py", line 763, in
test_EMA(df, forATR=True)
File "indicator.py", line 388, in test_EMA
EMA(df, colFrom, colTo, test_period, alpha=forATR)
File "indicator.py", line 142, in EMA
df[target] = con.ewm(alpha=1 / period, adjust=False).mean()
File "/Users/anil.bhatt/anaconda/lib/python2.7/site-packages/pandas/core/generic.py", line 6069, in ewm
adjust=adjust, ignore_na=ignore_na, axis=axis)
File "/Users/anil.bhatt/anaconda/lib/python2.7/site-packages/pandas/core/window.py", line 2066, in ewm
return EWM(obj, **kwds)
File "/Users/anil.bhatt/anaconda/lib/python2.7/site-packages/pandas/core/window.py", line 1658, in init
self.com = _get_center_of_mass(com, span, halflife, alpha)
File "/Users/anil.bhatt/anaconda/lib/python2.7/site-packages/pandas/core/window.py", line 1971, in _get_center_of_mass
raise ValueError("alpha must satisfy: 0 < alpha <= 1")
ValueError: alpha must satisfy: 0 < alpha <= 1
Can you please help here
I am new to this please help me
Have you ever thought to develop VZO indicator? @arkochhar
Checked the output for differrent parameter and it looks the accuracy is missing in the output.
try to run your code and compare the result with tradingview or with chartink.com the outputs are not matching at all.
Need correction so that accurate output can be obtained.
@arkochhar Thank you for writing supertrend calcuator in Python.
Once supertrend is calculated and stored in dataframe, if new data comes, we should be able to append the new data to existing dataframe and supertrend should be calculated to only new data but not for entire data.
Technical-Indicators/indicator/indicators.py
Line 163 in c3f9e09
Consider removing the above line as TR is not calculated if same dataframe is passed with new rows as it happens in realtime situation. Hence ATR gets calculated incorrectly. I am calling ST / ATR post creation of each 2 min candle (dataframe row), so every 2 mins ST / ATR function gets called with new dataframe rows appended.
Thanks for you work on Technical-Indicators.
RSI function :
Args :
df : Pandas DataFrame which contains ['date', 'open', 'high', 'low', 'close', 'volume'] columns
base : String indicating the column name from which the MACD needs to be computed from (Default close)
period : Integer indicates the period of computation in terms of number of candles
Returns :
df : Pandas DataFrame with new columns added for
Relative Strength Index (RSI_$period)
"""
delta = df[base].diff()
up, down = delta.copy(), delta.copy()
if len(delta)>(period-1):
up[up < 0] = 0
down[down > 0] = 0
rUp = up.ewm(com=period - 1, adjust=False).mean()
rDown = down.ewm(com=period - 1, adjust=False).mean().abs()
df['RSI_' + str(period)] = 100 - 100 / (1 + rUp / rDown)
df['RSI_' + str(period)].fillna(0, inplace=True)
else:
df['RSI_' + str(period)] = pd.Series()
df['RSI_' + str(period)].fillna(0, inplace=True)
return df
`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.