TulipCharts / tulipindicators

Technical Analysis Indicator Function Library in C
https://tulipindicators.org/
GNU Lesser General Public License v3.0
859 stars 159 forks source link

[indicator request] Zigzag #42

Closed LooOOooM closed 5 years ago

LooOOooM commented 5 years ago

Is there a chance of getting the indicator "zigzag" supprted including deepth? The zigzag is quite important to filter out noice and for determent eliot waves, as well as to better find petterns like double bottom etc.

I read in issue #36 you saying "However, if an indicator includes data from the future, then you have a data leak. This is why I've never implemented the popular Zig-zag indicator", but I cannot understand why you say that zigzag is based on data from the future, as the completion of the last zigzagline should be just an option and not an fact. In adition if you have a look at the indicator on tradingview you will find another option "deepth" which in addion tells should prevent somehow to draw the zigzag line too early propertly wrong.

Hopefully you wil find the time to implement this

Regards

codeplea commented 5 years ago

I've never seen the zigzag indicator used where the value for the current bar doesn't reference information from the future. Can you link me to a source where this is clearly refuted? Ideally, give me an example calculation in Excel. It'll be pretty obvious then where the data is coming from.

LooOOooM commented 5 years ago

Please look for an example on tradingview, especially at take attention to to option "drow to the end", which is not checked by default. I don't know where you could find and excel for zigzag. In addition find it a bit odd to ask me to provide you with data, while I basicly ask you the same first, saying I dont know why you say that this is based on future data, pointing you to the optional "drew to end" and deepth option switch.

codeplea commented 5 years ago

In addition find it a bit odd to ask me to provide you with data

I've stated that zig zag uses bars from the future to calculate data for the current bar. If you disagree, then it's on you to provide proof.

If you take the time to calculate 10 bars by hand, you would see exactly how it works.

Here's another way to look at it. Consider that you have 100 bars of data and you generate the zig zag indicator. Then you add in another 50 bars, so you now have 150 bars. Did any of the zig zag values calculated for the first 100 bars change? The answer is yes, and that shows that data from the future is incorporated into the past.

codeplea commented 5 years ago

Say you turn off "draw to end". You plot your indicator, and the last few bars don't have zig zag indicator drawn for them. You come back a few days later and now the zig zag is drawn over these bars. So what happens in the future determines the values for those bars.

LooOOooM commented 5 years ago

Never mind, I got My own Zigzag developt meanwhile. The arbumentation zigzag is based on future, whether this is true or not sounds to me as a very odd argument not to develop it or in other words simply to ignore this important indicator. Just because people using AI they cannot reley on that is another odd one, because everybody got the fredom to use this or not. However it is there and it is famous and it is heavily used i.e elliot, SL teterment, etc.

The fact is -- nobody knows the future, and what goes up must go down. If a zigzag is "not drawn to the end" fine, what should happen with that in the future ? I do not care . Zigzag is not an indicator to help you fore decition of enter or not into the market, but It could tell you a lot of the phase of the elliot wave as well as trend, as well as support and resistence. But as I saied, never mind. You can close this call of.

codeplea commented 5 years ago

I really don't understand where you're coming from.

If you've implemented zig zag yourself, as you claim, then just pick a bar from the middle of your data set. Look at it's zig zag value, and ask yourself if calculating that number used only bars before it. This isn't a hard concept.