Support Board
Date/Time: Sun, 06 Jul 2025 23:25:54 +0000
[Programming Help] - Horizontal Volume by Price Feature Request .....
View Count: 161
[2025-07-03 00:00:53] |
User303857 - Posts: 137 |
Hello Support, would like to have the VBP on the same scale as the time & volume.... probably impossible... since the scale would have to function in both directions.... Here is a rough sketch.... |
Attachment Deleted. |
[2025-07-03 17:48:51] |
Tony - Posts: 609 |
I had exactly the same thought a few years ago, I have a general idea how it can be done, but I thought I would put tremendous amount of time and effort, didn't do anything, not worth it. There is something called "sc.VolumeAtPriceForBars" in Sierra's toolbox, it gives us the access of volume of each price level within a chart bar, and then I guess we will just have to include all the chart bars of the VbP and calculate the accumulative volume of each price level. Update: I finally could get something working quick and dirty (see animated 20-second screenshot, ES mini July-01 2025, right after market open, around 09:31 Eastern), I am basically draw a Subgraph, and chart bar space has to be 1 to have a smooth looking of the distribution curve. Unfortunately there are a few issues, not all VbP values are accurate; and my study's recalculating time went from 3ms to 80ms; also Sierra crashes after using this study for about 5 minutes, it is basically not usable. This is pretty much as far as I can go, I am a very low level armature coder. Hopefully you would be able to optimize it. (the code below just to give you a rough idea, not ready for copy and paste, because some functions and variables are claimed somewhere else), "ProfileLine" is a subgraph. ProfileRange[0]/ProfileRange[1] are lowest and highest prices of profile/trading day Good luck BTW, you didn't explain the reason why you need a view VbP with different angle, maybe you could elaborate when you have time ... besides having whole lot of fun, I don't see any other reasons. if (sc.SetDefaults) { sc.GraphName = "Process"; sc.GraphRegion = 0; sc.AutoLoop = 1; sc.UpdateAlways = 1; sc.MaintainVolumeAtPriceData = 1; return; } //std::vector <int> ProfileValues; //ProfileValues.clear(); //for (double LevelCount {ProfileRange[0]}; LevelCount<=ProfileRange[1]; LevelCount+=0.25) //ProfileValues.push_back(0); int TotalLevels = (int)((ProfileRange[1] - ProfileRange[0]) / 0.25) + 1; int ProfileValues[400] {}; for (int IndexCount {ProfileStartIndex}; IndexCount<=ProfileEndIndex; IndexCount++) { const s_VolumeAtPriceV2 *p_VolumeAtPrice=NULL; int VAPSizeAtBarIndex = sc.VolumeAtPriceForBars->GetSizeAtBarIndex(IndexCount); for (int VAPIndex {0} ; VAPIndex<VAPSizeAtBarIndex; VAPIndex++) { if (!sc.VolumeAtPriceForBars->GetVAPElementAtIndex(IndexCount, VAPIndex, &p_VolumeAtPrice)) break; int IndexID {(int)((sc.Low[IndexCount] + 0.25*VAPIndex - ProfileRange[0]) / 0.25)}; ProfileValues[IndexID] += p_VolumeAtPrice->Volume; } } //DebuggingText.Format("Result:\n\n"); int HighestVolume {0}; for (int IndexCount {0}; IndexCount<TotalLevels; IndexCount++) { //DebuggingText.AppendFormat("%d\n", ProfileValues[IndexCount]); if (ProfileValues[IndexCount] > HighestVolume) HighestVolume = ProfileValues[IndexCount]; } //DebuggingText.AppendFormat("HighestVolume: %d", HighestVolume); int HorizShift = sc.IndexOfFirstVisibleBar + 137; int BaseLine = (ProfileRange[0] + ProfileRange[1]) / 2.0 - 17.0; for (int IndexCount{HorizShift}; IndexCount<TotalLevels+HorizShift; IndexCount++) ProfileLine[IndexCount] = BaseLine + 20.0*ProfileValues[IndexCount-HorizShift]/HighestVolume; AddDrawing(sc, UniqueNumber++, 1, HorizShift, TotalLevels+HorizShift, DRAWING_LINE, BaseLine, BaseLine, RGB(37,37,37), 1, ""); int IndexOfLastPrice {(int)((sc.Close[sc.Index] - ProfileRange[0]) / 0.25) + HorizShift}; AddDrawing(sc, UniqueNumber++, 0, IndexOfLastPrice, IndexOfLastPrice, DRAWING_LINE, BaseLine, BaseLine+20, RGB(37,37,37), 1, ""); Date Time Of Last Edit: 2025-07-06 13:54:46
|
[2025-07-03 19:52:33] |
User303857 - Posts: 137 |
Thanks Tony, appreciate the input & feedback. I guess one could just get a square monitor and turn it sideways..... What it seems to reveal is when it is fat tail time and the small continuous volume shifting the distribution curve..... There has to be a way.... to code it... There is just no reason to have it locked on the horizontal price scale.... Or have a combo price scale of volume & price on one scale... Date Time Of Last Edit: 2025-07-03 19:54:27
|
[2025-07-04 22:28:33] |
User303857 - Posts: 137 |
Anything from John & support team?
|
To post a message in this thread, you need to log in with your Sierra Chart account: