PSAR indicator - Incorrect value
See original GitHub issueWhich version are you running? The lastest version is on Github. Pip is for major releases.
import pandas_ta as ta
print(ta.version)
0.2.28b0
Upgrade.
$ pip install -U git+https://github.com/twopirllc/pandas-ta
Describe the bug A clear and concise description of what the bug is. The value of PSAR seems incorrect (as compared to TradingView).
– Pandas_ta for 2020-12-31 PSARs_0.02_0.2 = 377.265728 TradingView for 2020-12-31 PSAR = 363.67
To Reproduce Provide sample code.
from pandas_datareader import data
from IPython.display import display, HTML
import pandas as pd
import datetime
import pandas_ta as ta
start = datetime.datetime(2020, 1, 1)
end = datetime.datetime.now()
ticker = "SPY"
df = data.DataReader(ticker,
start=start,
end=end,
data_source='yahoo')
df.ta.psar(append=True)
display(HTML(df.sort_index(ascending=False).to_html()))
Expected behavior A clear and concise description of what you expected to happen. The value of PSAR should be as close as possible to TradingView Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
Thanks for using Pandas TA!
Issue Analytics
- State:
- Created 3 years ago
- Comments:23 (11 by maintainers)
Top Results From Across the Web
What Is the PSAR Indicator? - Bullish Bears
What's the PSAR indicator and how do you read it? It stands for stop and reverse and shows whether the price will continue...
Read more >Parabolic SAR - Overview, How It Works, and How to Calculate
The Parabolic SAR is a technical indicator developed by J. Welles Wilder to determine the direction that an asset is moving.
Read more >PSAR - Parabolic Stop And Reverse: Identifying Trend ...
When the Parabolic SAR touches the price, the trend changes its direction. This risk-following indicator can be used to estimate optimal entry/ ...
Read more >How to Use the Parabolic SAR Indicator to Spot a Crypto Buy ...
Parabolic SAR (PSAR) is a technical indicator for traders to spot an uptrend of the downtrend price signal. Learn how PSAR works in...
Read more >Parabolic Sar Indicator - Settings, Strategies and Tips - YouTube
The parabolic SAR is a time and price indicator in technical trading. It's used to identify the direction of the asset's price and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @twopirllc, I’ve made some changes as well as I’ve done some correlation tests, but I have no idea if it’s enough.
Code:
Should be reviewd.
Tests:
Results 1m data:
Results 4h data:
Hope that’s ok and helpful as well.
Kind regards, AA
Hello, I’ve tried reproduce TV psar from chart today, but i put there no more than half of hour. I wrote code in different language but here is python version (hope that it’s ok). This code produced similar results to TV on some live tests, but I have no time to test it properly. Maybe it’ll help, but I think that definition of psar is slightly different.
Let me know if there are some incorrections and I’ll take a look.
Best regards, AA