Giter VIP home page Giter VIP logo

Comments (3)

hal9000cc avatar hal9000cc commented on June 15, 2024

I fix some bugs in ZigZag, thanks. However, I'm not sure that's all.
You can take the fixes from the master branch.

from live_trading_indicators.

hal9000cc avatar hal9000cc commented on June 15, 2024

And I also don't understand where the price value of 15443.20 comes from. I don't find that.

from live_trading_indicators.

lapphan avatar lapphan commented on June 15, 2024

And I also don't understand where the price value of 15443.20 comes from. I don't find that.

The pivot 15443.20 is a correct pivot that already showed in v0.7.5 (please check #console ouput in my initial comment). You can see it at highlighted text below:

image

I also tested v0.7.5.1 and now all missing pivots are showed:

(IndicatorData) source: ccxt.binanceusdm, name: ZigZag, symbol: BTCUSDT, timeframe: 1d, allowed nan
date: 2019-09-08T00:00 - 2023-05-08T00:00 (length: 1339)
Values: time, pivots, pivot_types
           time    pivots  pivot_types
101  2019-12-18   6427.00           -1
158  2020-02-13  10540.00            1
187  2020-03-13   3621.81           -1
584  2021-04-14  64986.11            1
619  2021-05-19  28688.00           -1
794  2021-11-10  69198.70            1
1170 2022-11-21  15443.20           -1
1314 2023-04-14  31059.00            1
1323 2023-04-23  27279.70           -1

But the incomplete pivot is not correct in my opinion. Perhaps we can take the logic in TradingView's Zig Zag indicator:

  • If the last completed pivot type is a High, the incomplete pivot type will be a Low and its pivot price is the Last Bar candle LOW price.
  • If the last completed pivot type is a Low, the incomplete pivot type will be a High and its pivot price is the Last Bar candle HIGH price.

My pseudocode for more clarity:

last_bar_candle = get_last_bar_candle()

if last_pivot.type = 1 # High
    incomplete_pivot.time = last_bar_candle.time
    incomplete_pivot.type = -1 # Low
    incomplete_pivot.price = last_bar_candle.low
else if last_pivot.type = -1 # Low
    incomplete_pivot.time = last_bar_candle.time
    incomplete_pivot.type = 1 # High
    incomplete_pivot.price = last_bar_candle.high

I hope you can understand my idea. Feel free to give any feedback to me.
Thank you.

from live_trading_indicators.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.