Login Page - Create Account

Support Board


Date/Time: Fri, 31 Jan 2025 22:53:29 +0000



sc.GetPointOfControlPriceVolumeForBar compile error

View Count: 945

[2019-06-10 02:39:41]
User189399 - Posts: 43
I try to use sc.GetPointOfControlPriceVolumeForBar() to find the POC price of a bar with code below

int BarIndex
const s_VolumeAtPriceV2 *p_VolumeAtPrice=NULL;
sc.GetPointOfControlPriceVolumeForBar(BarIndex,&p_VolumeAtPrice);

and get the compile error as below:-
error: invalid initialization of non-const reference of type 's_VolumeAtPriceV2&' from an rvalue of type 'const s_VolumeAtPriceV2**'
sc.GetPointOfControlPriceVolumeForBar(BarIndex,&p_VolumeAtPrice);

By referring the link:-
sc.GetPointOfControlPriceVolumeForBar()

It does not provide example how to use this function. Could u provide the example or correct syntax for it?
[2019-06-10 12:45:35]
Sierra Chart Engineering - Posts: 104368
Make sure you define s_VolumeAtPriceV2 as a const:
const s_VolumeAtPriceV2 *

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
Date Time Of Last Edit: 2019-06-10 16:32:12
[2019-06-10 13:47:01]
User189399 - Posts: 43
I have defined const as follows:-

const s_VolumeAtPriceV2 *p_VolumeAtPrice=NULL;

Is it correct?
[2019-06-10 16:36:33]
Sierra Chart Engineering - Posts: 104368
We apologize we did not have a close look at this. This is how it needs to be:
  s_VolumeAtPriceV2 VolumeAtPrice;
  sc.GetPointOfControlPriceVolumeForBar(BarIndex, VolumeAtPrice);

We will update the documentation with an example.
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
Date Time Of Last Edit: 2019-06-10 16:37:16
[2019-06-11 01:30:09]
User189399 - Posts: 43
Now it can be successfully complied. However, I want to get the POC price value. I try to get the POC price by

s_VolumeAtPriceV2 VolumeAtPrice;
float POCprice;
int BarIndex

sc.GetPointOfControlPriceVolumeForBar(BarIndex, VolumeAtPrice);

POCprice=VolumeAtPrice.PriceInTicks * sc.TickSize;

The =VolumeAtPrice.PriceInTicks value seems incorrect. Do this function return volume of POC only and I should not use it for POC price? If it is inapporiate, any suggestion to achieve my purpose?
[2019-06-11 17:44:56]
Sierra Chart Engineering - Posts: 104368
There was a problem with this function and has been resolved . We will have a new release out today or tomorrow. And we have also done an additional update to the documentation.

You need to add this line to your code:
sc.MaintainVolumeAtPriceData = 1;

Refer to the updated documentation.
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

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

Login

Login Page - Create Account