Support Board
Date/Time: Tue, 26 Aug 2025 10:25:45 +0000
[Programming Help] - Horizontal Volume by Price Feature Request .....
View Count: 429
[2025-07-03 00:00:53] |
User303857 - Posts: 157 |
Thank You
Date Time Of Last Edit: 2025-08-25 06:19:22
|
[2025-07-03 17:48:51] |
Tony - Posts: 618 |
[post edited as one solution was found] We have access to VbP data by using something called "sc.VolumeAtPriceForBars" in Sierra's toolbox. Link To Documentation The solution I have is to draw a Subgraph, as it is showed in the attached animated 20-second screenshot, (ES mini July-01 2025, right after market open, around 09:31 Eastern), chart bar space has to be 1 to have a smooth looking of the distribution curve. Unfortunately there are a few issues, first of all, although almost identical with VbP study, not all values are accurate; also, when vector is used, study's recalculating time went up to 80ms and Sierra crashes after using this study for about 5 to 10 minutes, then I switch to int array, the recalculating time improved (still high, around 35ms) and Sierra doesn't crash any more. The problem using int array is that we would experience out of range error when there is a wide daily price range. The recalculating time for original custom study before I added this subgraph on top of it, is less than 3ms, apparently I did something terribly wrong, I just don't have time to find out what was wrong. 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, it should work with min. modifications), "ProfileLine" is a subgraph 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 = "My Custom Study"; sc.GraphRegion = 0; sc.AutoLoop = 1; sc.UpdateAlways = 1; sc.MaintainVolumeAtPriceData = 1; return; } //std::vector <int> ProfileValues; //ProfileValues.clear(); //for (double LevelCount {VbP_Lowest}; LevelCount<=VbP_Highest; LevelCount+=0.25) //ProfileValues.push_back(0); int TotalLevels = (int)((VbP_Highest - VbP_Lowest) / 0.25) + 1; int ProfileValues[4000] {}; // int array size 4000 (ticks) or 1000 points is probably good enough // as this code was written in July 2025 // largest daily range was recorded on Apr.09, 2025, 532.91 points 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 - VbP_Lowest) / 0.25)}; ProfileValues[IndexID] += p_VolumeAtPrice->Volume; } } int HighestVolume {0}; for (int IndexCount {0}; IndexCount<TotalLevels; IndexCount++) { if (ProfileValues[IndexCount] > HighestVolume) HighestVolume = ProfileValues[IndexCount]; } int HorizShift = sc.IndexOfFirstVisibleBar + 137; int BaseLine = (VbP_Lowest + VbP_Highest) / 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] - VbP_Lowest) / 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-13 04:37:50
|
[2025-07-03 19:52:33] |
User303857 - Posts: 157 |
Thank You
Date Time Of Last Edit: 2025-08-25 06:19:36
|
[2025-07-04 22:28:33] |
User303857 - Posts: 157 |
Anything from John & support team?
|
[2025-07-07 15:43:29] |
John - SC Support - Posts: 41464 |
We have noted the request. We can not say when we would get to any particular item. The best option available would be to create a custom study to do what you want. For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2025-07-08 15:24:29] |
John - SC Support - Posts: 41464 |
There is nothing close to what you want in the existing studies and examples. What you are wanting to do is to assign the volume at a price level to a specific bar. And you need to be careful with how you adjust the location based on scrolling the chart.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
To post a message in this thread, you need to log in with your Sierra Chart account: