Coder Social home page Coder Social logo

Comments (7)

Jake0303 avatar Jake0303 commented on May 21, 2024 1

@viveksp were you able to fix it at all? PSAR indicator isn't working at all

from btplotting.

happydasch avatar happydasch commented on May 21, 2024 1

Go ahead with the PR. I replaced lately some markers which did not work, too

from btplotting.

loopiezlol avatar loopiezlol commented on May 21, 2024

@Jake0303 I encountered the same issue with PSAR in backtrader-plotting, which this lib is based on

found out it's related to the marker type used. this commit did the trick for me loopiezlol/backtrader_plotting@67753b9

I assume "point" or "pixel" would've worked as well, but "dot" doesn't seem to be a valid choice https://matplotlib.org/stable/api/markers_api.html

from btplotting.

loopiezlol avatar loopiezlol commented on May 21, 2024

@happydasch I'm happy to create a PR trying to fix any invalid matplotlib markers for this repo, but I am curious to learn whether this repo is still maintained beforehand

from btplotting.

happydasch avatar happydasch commented on May 21, 2024

7ca6297

from btplotting.

tlchan5 avatar tlchan5 commented on May 21, 2024

@happydasch and @loopiezlol Thanks for proposing the solution.
Just happened that I uses the same indicator and hitted the same issue.
I gave a try to the solution but the issue still exists. Same as @viveksp, the line plotting looks okay when plotting with the original backtrader plot.

I think the problem is btplotting unable to plot the line / connect the point if the value = NaN
The indicator marks the peak / valley with a value and others are set to NaN. The original backtrader plot is able to connect the point at peak & valley and ignore the NaN in between (just like
https://user-images.githubusercontent.com/3601042/108806710-731b2580-75c8-11eb-889b-07f1c0bdbf08.PNG))

I checked the implemenation of the indicator plotting in backtrader. There's a lineplotinfo._get(_skipnan, False) check in plot.py (https://github.com/mementum/backtrader/blob/master/backtrader/plot/plot.py#L466)
I wonder does the btplotting apply the same check and consider the "_skipnan" attributes when plotting the line?

I am not familiar with the rendering / plotting code so I cannot help much in this case. Hopefully this can point to the correct solution.

from btplotting.

happydasch avatar happydasch commented on May 21, 2024

latest code should be able to plot this, reopen if still not plotting corrrectly

from btplotting.

Related Issues (20)

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.