-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ZigZag Indicator, Sometime Showing Incorrect Waves for Deviation: 0.1% or more #856
Comments
Could you share the dataset which results in inconsistent results? Perhaps you can make a temporary csv file to store results. My intuition is that maybe there are null values reported in dataset by yfinance. Did you try using other tickers? If yes, did you face occasional inconsistent results there too? |
DataSet ES=F: Output ScreenShot (Yellow Wave: Deviation: 0.1%):
Current ScreenShot of ZigZag Waves on 0.1% Deviation for ES=F:
Yes, I check on Other Ticker: |
Hopefully @aligheshlaghi97 has some insight on this or how to fix perhaps? 🤷🏼♂️ |
Hi @twopirllc |
Hi there everyone. After reviewing the data provided by @divyankm, I’ve come to the following conclusions: 1. Low legs values lead to inaccurate swing detectionWhen legs is set to very low values (e.g., legs=3), it often results in poor swing detection. For example, a minor bottom might be identified while the chart values are in their peak (or vice versa). Therefore, using very small legs values is not recommended. 2. Right-to-left swing calculationMy code, like TradingView's script, calculates swings from right to left. If the issue in point 1 occurs, the algorithm might fail to identify swings needed to form a proper zigzag. This can lead to large gaps in the chart. However, I couldn’t replicate this specific behavior using TradingView. The data shared by @divyankm highlights an example of such gaps: As shown in the chart, no valid peaks are possible after that bottom, leading to the gap. Lastly, I couldn’t review all of the code in detail, but I would like to ask @twopirllc if there have been any major changes made since the previous code review that might be relevant to this issue. |
Usually I touch up PRs before pushing to development. Hopefully I didn’t make a mistake in that process. 😅 I’ll take a deeper look next week and compare the commits. Thanks for helping. 😎 |
Which version are you running? The lastest version is on Github. Pip is for major releases.
Have you tried the development version? Did it resolve the issue?
Describe the bug
Sometime the ZigZag Waves are not formed correctly for Deviation: 0.1% or greater
To Reproduce
Expected behavior
As Data is coming on 1min Basis, sometimes zigzag are plotted correctly as below.
Screenshots
While Rest of Time Zigzag is not plotted correctly, like below.
The text was updated successfully, but these errors were encountered: