Login Page - Create Account

Support Board


Date/Time: Fri, 03 May 2024 10:55:22 +0000



ACSIL - Getting the relative X position(1-150) of a specific bar

View Count: 1246

[2017-05-28 19:38:31]
Zosimus - Posts: 345
Is there a way to get the relative X position(1-150) of a specific bar (specific index)? Something in the spirit of sc.BarIndexToXPixelCoordinate() but that uses the 1-150 pixels of the Relative s_UseTool::BeginDateTime.
This would be extremely beneficial for drawing Tools (s_UseTool) on or around specific bars when one needs to use relative X positioning.
Date Time Of Last Edit: 2017-05-28 20:10:27
[2017-05-29 20:54:37]
Sierra Chart Engineering - Posts: 104368
We will add this:

sc.BarIndexToRelativeHorizontalCoordinate(int BarIndex)

But it has not been tested.
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
[2017-05-30 17:33:27]
Zosimus - Posts: 345
Wonderful.
Will this be implemented in 1562?
[2017-05-30 18:19:31]
Sierra Chart Engineering - Posts: 104368
It will be in version 1563.
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
[2017-06-01 16:57:53]
Zosimus - Posts: 345
Whenever you have time for this:

As far as I understand the sc.BarIndexToRelativeHorizontalCoordinate(int BarIndex) function does not give the correct values when there is a space on the right edge of the chart (when the last bar is not at the most right edge of the chart).

This is illustrated in the 2 attached images.
One image shows that when the last bar is at the right edge the Relative Horizontal coordinate seems reasonable (147).
The second image shows that when the last bar is around the middle of the horizontal scale the value seems wrong (145 while it should be around 75).

The code I used to check this is:

int RelHorzPosBar = sc.BarIndexToRelativeHorizontalCoordinate(sc.Index);  
  SCString str;
  str.Format("RelCoordinate = %i", RelHorzPosBar);
  sc.AddMessageToLog(str, 0);

Release 1564.
Date Time Of Last Edit: 2017-06-01 17:03:57
imageRelBarXCoordinate__1.png / V - Attached On 2017-06-01 16:55:29 UTC - Size: 59.86 KB - 290 views
imageRelBarXcoordinare_2.png / V - Attached On 2017-06-01 16:55:35 UTC - Size: 59.15 KB - 279 views
[2017-06-01 17:43:25]
Sierra Chart Engineering - Posts: 104368
This will be resolved in the next release.
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