Giter Club home page Giter Club logo

Comments (3)

strikar21 avatar strikar21 commented on May 19, 2024 1

Thank you for the reply.

works just like you've shown. :)
i will wait until this month end for mplfinance then would raise an issue. if the promised matplotlib method of plotting downst help :)

from pandas-ta.

twopirllc avatar twopirllc commented on May 19, 2024

Hello @strikar21,

Volume Profile

Volume Profile is rather tricky, not just for plotting but also where to start the calculation and how many observations aka width: int = 10 (default) to use. So you can not just pass it to mpf.make_addplot(stck.VP,color='y',type = 'line', panel = 1). There is some post processing required.

Volume Profile and Matplotlib Finance Charting

Currently Matplotlib Finance does not have Volume Profile Charting, though it is a proposed feature request mplfinance Issue #162. If you want Matplotlib Finance to support Pandas TA Volume Profile, please let them know by adding onto Issue #162.

Volume Profile, Post Processing and Matplotlib Charting

Here is the code I use to visually verify Volume Profile with Matplotlib.

vpdf = df.tail(30) # Take the last 30 Daily Bars
vp = vpdf.ta.vp() # Run Volume Profile
print("Returns unsorted close\n", vp, "\n") # Visual Table Check

# Set the index to mean_close and in ascending order
vp['mean_close'] = round(vp['mean_close'], 2)
vp.set_index('mean_close', inplace=True)
vp.sort_index(ascending=True, inplace=True)
print("Sorted by mean_close\n", vp, "\n") # Visual Table Check

# Take the last three columns and plot them with horizontal bars
vp[vp.columns[-3:]].plot(
    kind='barh', 
    figsize=(5, 8),
    title="SPY VP (Recent 30 Days)",
    color=['green', 'red', 'silver'],
    alpha=0.45,
    stacked=True,
)

Visual Table Check

Screen Shot 2020-07-17 at 3 34 31 PM

Volume Profile Chart

Screen Shot 2020-07-17 at 3 34 47 PM

Thoughts? Suggestions? Solutions? Anything to make this better?
Don't forget to ⭐ if you find the library useful.

Hope this helps!
KJ

from pandas-ta.

geolectric avatar geolectric commented on May 19, 2024

Is there an easier way to plot this with Matplotlib yet?

from pandas-ta.

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.