Skip to content
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

supertrend output is not correct this is not matching with leading portal calculations #5

Open
mbmarx opened this issue Feb 12, 2018 · 7 comments

Comments

@mbmarx
Copy link

mbmarx commented Feb 12, 2018

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.

@tryrt4ms
Copy link

The problem seems to be while calculating EMA over TR. This gives a wrong ATR which in turn gives a wrong supertrend value

@mbmarx
Copy link
Author

mbmarx commented Apr 30, 2018 via email

@mbmarx
Copy link
Author

mbmarx commented Jul 17, 2018

ATR calculation is already supported by TALIB library and it is a built-in function. To get a very accurate calculation of the trend, you should use ATR from the standard library. Nowhere i have seen EMA period is given as input for ATR calculation.

@Prchakr
Copy link

Prchakr commented Feb 10, 2019

Actually EMA module needs some corrections looks like.
I have been trying this for a long time and i am getting the expected results for supertrend from this python code and it is matching with the Zerodha Kite connect portal.
But EMA results are not matching with the Zerodha kite connect portal results.
I have tried 20 period EMA, base as "Close" and results are not matching.

@Prchakr
Copy link

Prchakr commented Feb 11, 2019

@Prchakr never mind code works absolutely fine
Issue was with the parameter alpha which i set as false and got the wrong results.
After setting it up true gave proper results

@Ashutoshsingh0004
Copy link

Hi I am getting an error, Can anyone please help me to resolve this?
Code---
for i in range(period, len(df)):
df['Supertrend_10_3'].iat[i]= df['F_UBand'].iat[i] if df['Supertrend_10_3'].iat[i - 1] == df['F_UBand'].iat[i - 1] and df[df['Close_Price']].iat[i] <= df['F_UBand'].iat[i] else
df['F_LBand'].iat[i] if df['Supertrend_10_3'].iat[i - 1] == df['F_UBand'].iat[i - 1] and df[df['Close_Price']].iat[i] > df['F_UBand'].iat[i] else
df['F_LBand'].iat[i] if df['Supertrend_10_3'].iat[i - 1] == df['F_LBand'].iat[i - 1] and df[df['Close_Price']].iat[i] >= df['F_LBand'].iat[i] else
df['F_UBand'].iat[i] if df['Supertrend_10_3'].iat[i - 1] == df['F_LBand'].iat[i - 1] and df[df['Close_Price']].iat[i] < df['F_LBand'].iat[i] else 0.00

Getting an Error---
raise KeyError(f"None of [{key}] are in the [{axis_name}]")
KeyError: "None of [Float64Index([1423.95, 1422.35, 1433.55, 1423.45, 1407.2, 1401.1, 1399.5, 1383.35, 1320.85, 1284.2,\n ...\n 1727.65, 1748.95, 1723.0, 1763.9, 1761.65, 1761.75, 1775.95, 1765.75, 1788.05, 1819.3], dtype='float64', length=244)] are in the [columns]"

@ganeshv02
Copy link

indicators.txt

Attached one works for me without issues and it matches Zerodha Kite chart.

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

5 participants