-
Notifications
You must be signed in to change notification settings - Fork 249
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
Large ZigZag % threshold is not drawing on intraday data #600
Comments
We always remove the first trend period in ZigZag because it is based on an initial guess at the direction and is unreliable information. As a result, if the first trend runs for a while before reversing 5% (in your case), there can be a large chunk removed at the front end of the results data. Thanks for providing data; I'll take a closer look to confirm that this is what is happening. |
Yeah, but I think its not about the first trend, kinda it always the last trend the algorithm keeps! I've tested on couple of other markets, it always keeps the latest possible trend. |
Oh, I see. I misread and thought you were referring to the first trend. The last trend should be there, assuming it's not also the first trend. The last trend does repaint though, so that's worth noting. I'll take a look with your data this weekend and give a better explanation of what you're seeing. Are you suggesting that when there is only one trend, we shouldn't throw it away as we usually do? If so, all that would only be is a single straight line between the first and last point. |
I suspect the issue here is that there is no 5% reversal in the first 300 points of data; and therefore no confirmed trend to produce. ZigZag, by definition, is the straight line between high and low points that exceed the provided percent change threshold. The first point in your quote history is neither a high or low point, it's just a random point. That's why the lines are only drawn after the first confirmed high or low point. |
With just a quick look at your Close prices, here's what your chart looks like: Given the price around ~$4,000, a 5% range would mean you only plot swings > ~$200. From your start point around $4,250 it continues to go down, without a 5% rebound, until it gets to the first suspected bottom at $3,915 at bar number 224. |
If you were to use a wider timeframe, 5% might look and work better: |
The basic issue in your use case is that you're not using enough quote history to have a meaningful ZigZag(5) drawn. |
This Issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new Issue for related bugs. |
Hi, thank you for your great tools,
I got 300 candles, when I run ZigZag(percentChange: 5) on them, it returns 300 ZigZagResult
but only its 74 latest results have values inside, the first 226 values all show null.
I expect the algorithm check all 300 candles
I pull data from coinex, its about ETH/USDT, timeframe is 5min
I attach a sample data as json here
will you please check it out?
ethusdt.txt
The text was updated successfully, but these errors were encountered: