Login Page - Create Account

Support Board


Date/Time: Wed, 22 Jul 2026 04:57:56 +0000



[Programming Help] - : Reading rectangle price coordinates from ACSIL via GetUserDrawnChartDrawing

View Count: 291

[2026-06-05 05:11:28]
User516084 - Posts: 17
Hi,
I'm writing an ACSIL study that reads user-drawn extended rectangles (DRAWING_RECTANGLE_EXT_HIGHLIGHT) on a chart to get their top and bottom price values. I'm using sc.GetUserDrawnChartDrawing() to retrieve the drawings successfully, but the BeginValue and EndValue fields are returning values like 15000000 and 26000000 rather than actual prices (instrument is MNQ, price ~30200).
UseRelativeVerticalValues is returning 0, so I expected actual prices.
Specifically I need to know:

Which s_UseTool member fields contain the top and bottom price (Y-axis) values for a user-drawn extended rectangle?
Is BeginValue a DateTime or some other encoded value for rectangles, and if so how do I convert it to price?
Is there a different function I should use to read the price coordinates of user-drawn rectangles?
The BeginIndex and EndIndex contain bar indices — is the correct approach to get the price from the bar data at those indices?

Thank you
[2026-06-05 14:24:11]
Sierra_Chart Engineering - Posts: 24290
These are the right members to use to get the beginning and ending vertical axis coordinates according to the values of the chart region:

Using Drawing Tools From an Advanced Custom Study: s_UseTool::BeginValue
Using Drawing Tools From an Advanced Custom Study: s_UseTool::EndValue

These are float values. You should be seeing the correct values. Maybe you are misinterpreting the actual values and interpreting them as an integer.
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2026-06-05 14:24:46
[2026-06-05 16:39:13]
User516084 - Posts: 17
Thank you for the response. I've confirmed BeginValue and EndValue are the correct fields. However I'm having trouble actually retrieving the drawings.
I'm using sc.GetUserDrawnDrawingsCount(ChartNumber, 0) which correctly returns the number of drawings (e.g. 2 or 4). But when I call sc.GetUserDrawnChartDrawing(ChartNumber, LineNumber, Drawing, 0) it returns 0 for every LineNumber I try.
What I've tried:

Scanning LineNumbers -1 to -10000 sequentially — all return 0
Using index 0, 1, 2, 3 as the LineNumber parameter — only index 0 occasionally returns a drawing with LineNumber=-5
Scanning from -5 downward — returns 0 for -6, -7, -8 etc. even though numDrawings=4

Questions:

What is the correct way to iterate through all user drawn drawings to retrieve each one?
Is the 2nd parameter to GetUserDrawnChartDrawing a LineNumber or an index?
Is there a function to get the LineNumber of each drawing so I can retrieve them correctly?
[2026-06-05 16:59:17]
User431178 - Posts: 893
But when I call sc.GetUserDrawnChartDrawing(ChartNumber, LineNumber, Drawing, 0) it returns 0 for every LineNumber
You are using the function incorrectly, check the function signature on the docs page.

Using Drawing Tools From an Advanced Custom Study: sc.GetUserDrawnChartDrawing()
Using Drawing Tools From an Advanced Custom Study: sc.GetUserDrawnDrawingByLineNumber()


What is the correct way to iterate through all user drawn drawings to retrieve each one?
Call sc.GetUserDrawnChartDrawing with increasing index value until it returns 0, drawing index being the fourth parameter.


Is the 2nd parameter to GetUserDrawnChartDrawing a LineNumber or an index?
Neither, it's the drawing type. There is a different function that accepts a line number.


Is there a function to get the LineNumber of each drawing so I can retrieve them correctly?
When you retrieve them by index, you have access to the LineNumber as part of the tool structure.

If you want the line number of a manually selected drawing, then there is a separate function for that.

Using Drawing Tools From an Advanced Custom Study: sc.GetLineNumberOfSelectedUserDrawnDrawing()

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

Login

Login Page - Create Account