Login Page - Create Account

Support Board


Date/Time: Tue, 21 Jan 2025 04:12:55 +0000



[Programming Help] - HOWTO GET askvolume by GetAskVolumeAtPrice ?

View Count: 1955

[2018-07-29 10:37:33]
User574685 - Posts: 28
Hi,

i need get a askvolume at price... but GetAskVolumeAtPrice, doesn`t work at all.
i receive "0" as a result .....
What is wrong with that ?

Thanks 4 Help
Dave

-------------------

if ((int)sc.VolumeAtPriceForBars->GetNumberOfBars() < sc.ArraySize)  return;
s_VolumeAtPriceV2 *p_VolumeAtPrice;
  
sc.VolumeAtPriceForBars->GetVAPElementAtPrice(sc.Index-1, p_VolumeAtPrice->PriceInTicks * sc.TickSize);
MaxAskVolume_First = sc.VolumeAtPriceForBars->GetAskVolumeAtPrice(sc.Index-1, p_VolumeAtPrice->PriceInTicks * sc.TickSize);
[2018-07-30 00:53:10]
Sierra Chart Engineering - Posts: 104368
Change this line as follows:

MaxAskVolume_First = sc.VolumeAtPriceForBars->GetAskVolumeAtPrice(sc.Index-1, p_VolumeAtPrice->PriceInTicks);

Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-07-30 07:49:05]
User574685 - Posts: 28
Doesn`t help at all ..........

if ((int)sc.VolumeAtPriceForBars->GetNumberOfBars() < sc.ArraySize)  return;
s_VolumeAtPriceV2 *p_VolumeAtPrice;

sc.VolumeAtPriceForBars->GetVAPElementAtPrice(sc.Index-1, MaxAskQuantityPrice_First);
if (p_VolumeAtPrice){MaxAskVolume_First = sc.VolumeAtPriceForBars->GetAskVolumeAtPrice(sc.Index-1, MaxAskQuantityPrice_First);}


I don`t get it ........
I get a vap element at exact price and then and i should receive askvolume at that price by GetAskVolumeAtPrice, right ?


That is working code, but how can i get a Vbp index from exact price ? ......
sc.VolumeAtPriceForBars->GetVAPElementAtIndex(sc.Index-1, MaxAskQuantityPrice_First*sc.TickSize, &p_VolumeAtPrice);
if (p_VolumeAtPrice){MaxAskVolume_First = p_VolumeAtPrice->AskVolume;}
sc.VolumeAtPriceForBars->GetVAPElementAtIndex(sc.Index-1, MaxBidQuantityPrice_First*sc.TickSize, &p_VolumeAtPrice);
if (p_VolumeAtPrice){MaxBidVolume_First = p_VolumeAtPrice->BidVolume;}
Date Time Of Last Edit: 2018-07-30 07:52:10

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account