jbn / ZigZag

Python library for identifying the peaks and valleys of a time series.
BSD 3-Clause "New" or "Revised" License
444 stars 178 forks source link

Upgrade to a high and low price calculation is even better #8

Open traddo opened 4 years ago

traddo commented 4 years ago

Generally, ZigZag is calculated using the high and low prices in the candle diagram. How can code be applied to high and low prices? If high and low prices are calculated separately and combined, the performance will be much lower.

quantfiction commented 3 years ago

+1 for this

HumanRupert commented 3 years ago

I think I've got time to implement this; should I make a PR, @jbn?

pepeto commented 2 years ago

Is there any implementation of this? Please share. Thank you!!!

flowtrader2016 commented 2 years ago

See https://github.com/jbn/ZigZag/issues/11

jbn commented 2 years ago

I've been pretty burnt out on all my OSS stuff but my brain is recovering. I'm going to try and integrate @flowtrader2016 work this weekend. Sorry for the...checks notes...multi year delay

jbn commented 2 years ago

Without having read the fixes proposed yet, my concern at the time of initial implementation was: you don't know if the high came before the low in the day, so there can be some temporal issues? Not sure if that is correct though gotta think about it

jbn commented 2 years ago

Okay, took longer than expected, but I upgraded the build system so it's not a pain to develop on. New version is now 0.3.0. Seems like this is an old feature request. (E.g. https://github.com/jbn/ZigZag/pull/1) IIRC, I didn't implement this because there is an ambiguity with which came first the high or the low and under some circumstances, that requires a careful decision.

Now that I have the build system set up, I'll see what i can add.