Login Page - Create Account

Support Board


Date/Time: Tue, 26 Nov 2024 11:32:08 +0000



Iterating over user drawn chart objects

View Count: 1389

[2014-04-08 11:09:07]
onnb - Posts: 662
Can I use GetChartDrawing to iterate over user drawn chart objects?

Can I do something like this?

s_UseTool drawing;
while (sc.GetChartDrawing(0, DRAWING_LINE, drawing, 0) != 0)
{
// do something
}
If not, is there a way to iterate over user drawnings?


And some questions about the docs/api

1. "Note that when chart drawings are returned through this function, the DrawingType member is set and not the Tool member." - not clear on what circumstances the drawing variable above would not be filled.

2. The docs say on one hand "Only user drawn drawings can be retrieved. Not drawings added by Advanced Custom Studies."

and on the other "The ChartDrawing.LineNumber parameter member is set after calling this function and if a chart drawing is returned. Since user drawn chart drawings have a LineNumber of 0, you can see the last user inputed text by finding the last text with a line number of 0."

I'm not sure from this if the method returns acsil + user drawings or just user drawings. If it return only user drawings, why the comment on testing the LineNumber?
Date Time Of Last Edit: 2014-04-08 11:09:34
[2014-04-09 08:57:24]
Sierra Chart Engineering - Posts: 104368
Yes you can iterate over user drawn chart drawings like you have specified.

1. The DrawingType will always be set with the drawing type. There should never be a case where it will not be.

2. This is out of date documentation and it has been updated. Since the call, thinking about this some more this function does actually return ACSIL drawings added as "user drawn". Those can be distinguished because they have a nonzero LineNumber.
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
[2014-04-10 19:33:03]
onnb - Posts: 662
I assume I am getting drawing objects for all chart regions and that the region field will be updated correctly in the returned tool object?
[2014-04-10 19:54:19]
Sierra Chart Engineering - Posts: 104368
Yes.
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
[2014-05-07 20:25:48]
onnb - Posts: 662
we discussed a few weeks ago some changes that might be made to GetChartDrawing

I can see that in the latest version, drawings that have been added manually by the user have a negative line number. So if a drawing has a negative line number, can I be certain that it is only a manually drawn drawing?

Btw, I had a look at the docs and I don't see that this has been updated.

Onn


[2014-05-08 04:41:02]
Sierra Chart Engineering - Posts: 104368
Not necessarily but most likely.

The documentation has not been updated yet.
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
[2014-05-08 16:17:38]
onnb - Posts: 662
Not necessarily but most likely.

Apart from manual drawings, in what other cases could I have negative line numbers returned from GetChartDrawing?

[2014-05-09 02:30:55]
Sierra Chart Engineering - Posts: 104368
Only if a custom study were to add a drawing with a negative number.

Perhaps we could block that from happening.
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
[2014-05-09 02:37:33]
Sierra Chart Engineering - Posts: 104368
In the next release, negative Line Numbers will not be allowed from custom studies for tool drawings.

So a negative number would only represent a true user drawn drawing.
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