DaveSkender / Stock.Indicators

Stock Indicators for .NET is a C# NuGet package that transforms raw equity, commodity, forex, or cryptocurrency financial market price quotes into technical indicators and trading insights. You'll need this essential data in the investment tools that you're building for algorithmic trading, technical analysis, machine learning, or visual charting.
https://dotnet.StockIndicators.dev
Apache License 2.0
970 stars 246 forks source link

Volume profile #358

Open arcadeindy opened 3 years ago

arcadeindy commented 3 years ago

Please add Session Volume indicator [Volume Profile].

DaveSkender commented 3 years ago

I’ll take a look at it. Do you have a good website reference to it that I can review.

arcadeindy commented 3 years ago

https://www.tradingview.com/blog/en/session-volume-hd-16628/ https://th.tradingview.com/chart/ETHUSD/ztOxu8Hm-Volume-Profile-Fixed-Range-Session-Volume-Visible-Range/

Thank you for your reply.

DaveSkender commented 3 years ago

We tend to avoid using random user customized indicators in this library, as in your link. Is there a more reputable version and source available? I’d like to stay with things that’s are published or recognized in professional journals or books.

I would like to find something like this. I think it’s a good indicator type to add.

image

arcadeindy commented 3 years ago

Thank you sir.

DaveSkender commented 3 years ago

I'll continue to look for a version of a volume profile that we can use, so thank you for the idea. If you see something in your journey that might work, let us know.

DaveSkender commented 2 years ago

@JGronholz, fyi

JGronholz commented 2 years ago

Hello, again, Dave! I couldn't find the source for TradingView's VP indicator, so I just asked Google what it was doing, instead, then wrote my own. I don't have any references to cite, unit tests, etc., etc., but I do have some free code for you that made this chart. I'll work through the contributing guidelines asap, but am currently unaware of the proper way to give you this. 🤷‍♀️🙏

Volume profile diagram 1

JGronholz commented 2 years ago

This was to be part of my documentation, showing the "cliffs" where the price likes to stop.

Volume profile diagram 2

JGronholz commented 2 years ago

To implement "Visible Range," just filter the quotes, like so:

results[klineInterval] = QuoteSource.Quotes[klineInterval].Where((quote) => { return ((quote.Date >= Chart.StartDate) && (quote.Date <= Chart.EndDate)); }).GetVpvr(Chart.YInterval / 4);

JGronholz commented 2 years ago

TradingView's VP indicator appears to output only the cumulative total, for only the last quote. I liked how your indicators are all time-series, and made this one the same. Each quote generates one VpvrResult, which each contain a list of VpvrValues(price/volume tuple) for that specific quote. The cumulative profile for a date is recursively assembled from those values.

When you move the cursor around, TradingView's VP indicator uses the Y value only. Since the output from my indicator can be indexed by date (X), before price (Y), the chart is able to visualize subsets of the volume profile. As far as I know, you cannot "time-step" like that, with TradingView's indicator. I often have to pan/zoom to impractical views of the candles, just to get their VPVR to show me what(when) I want. I began to work on a caching mechanism to improve performance, but put that on hold, for now. Currently, it's very functional.

When the cursor is not within my chart's ClientBounds, my app uses the last quote, producing an experience similar to TradingView's.

JGronholz commented 2 years ago

Volume Profile is one of the most powerful indicators, IMO, and is unavailable without a TradingView subscription. Coincidence? 😁

DaveSkender commented 2 years ago

is unavailable without a TradingView subscription. Coincidence? 😁

It's a business model!

DaveSkender commented 2 years ago

Do you have any plan or intention on adding Volume Profile indicator to the project? more info about this indicator: https://www.tradingview.com/support/solutions/43000502040-volume-profile/

_Originally posted by @Cage-e in https://github.com/DaveSkender/Stock.Indicators/discussions/858