I am looking into creating a sideways volume profile on a chart(like a volume profile), and wondering if there is a SIMPLE code example somewhere. I have seen several, and tbh, many of them are just over my head.
A NOTE, I have drawn a histogram before in NT7. I did it in two ways, taking values from an array I updated on each bar, for the daily session....
1) I used simple lines, I.e., Draw.Line() from the calculated start and end I needed, drawing many lines that would build a developing profile.
2) I used boxes, Draw.rectanle()... in a similar way as above, but with a height of 1, which allowed me to have control over the opacity
Both of the above ways are probably not the most efficient way to accomplish this. So I'm wondering if there is a code sample that offers the SIMPLEST amount of code, so that I can understand how this works. I.e., scouring through some code examples is a bit confusing for a newb like myself.
I have attached an image of my simple, but likely inefficient way of doing it, along with one I am using now created by someone else(3 images in 1). First image shows the lines I drew, the second shows using rectangles, and third shows someone else's code done right. See image 'distinction.png'
Another question I have... you can imagine how the profile is built bar by bar... is it possible to code it in such a way that the profile would update based on the number of bars visible on the chart? I.e., imagine you had a day built completely... if you scroll the chart to the left(removing bars in view from the right edge), that it would update the profile based on the scrolling. This feature is not essential, but I'm just wondering if this is a big code change?
Lastly... I have seen profiles that are colored(like a heat-map) based on various conditions. This is also something I am wondering about, if anyone knows any samples with the base amount of code to do this. This also is not essential, but something I am thinking about. See image called 'colors.png'
So... I know this is not necessarily a supported feature, and that I have a lot of questions... worst case I'll eventually figure it out by sifting through the examples I have, but I'm hoping someone may be able to point me along the right path to find simple examples to get me started.
Just to recap, questions are:
- Is there a code example that contains the very most basic amount of code to create a simple histogram ON THE PRICE chart, like a volume profile?
- Is it possible to build it in such a way, that the profile displayed will be based on how many bars are VISIBLE on the chart, and not necessarily how many bars are available? Again, this feature is not essential, but a good-to-know.
- Is there a sample somewhere that explains how to shade the profile based on some condition? Mostly I'm just looking for what one would do to make a profile heat-map fashion as shown in the 'colors.png' image.

Comment