Login Page - Create Account

Support Board


Date/Time: Wed, 05 Mar 2025 19:30:22 +0000



Problems with Drawing Tools

View Count: 936

[2022-01-05 15:18:45]
Sierra123 - Posts: 27
I have two problems with the drawing tools, one is API-based, and the 2nd is with the User Interface. I've read documentation specific to these problem areas and nothing I could find applies.

1) I create a DRAWING_TEXT on the chart, with a BeginDateTime Anchor that is specified down to the second. E.G. Jan 4, 2022 at 10:30:07. It doesn't matter if I create it on a 1 second chart, 5 second chart, 1 minute chart, or any other time interval chart. The value of the Anchor remains accurate down to the second. (I can see it in Manage Drawings Window). As part of my application, I need to Hide/Show the Drawing. Here is where the problem is. As soon as I send the sc.UseTool() method to update the Drawing to be Hidden (or Shown if already Hidden), The BeginDateTime Anchor is also updated to have a value that is justified to the current barInterval of the chart. As per example above, it is modified to 10:30:00 on a 1-minute chart, losing the seconds of precision.
What can I do to avoid this, other than deleting the DRAWING and RE-ADDING it? That is very time consuming for lots of Drawings.

[Removed 2nd question, moving to anther thread.]
Date Time Of Last Edit: 2022-01-07 18:27:41
[2022-01-06 04:43:14]
Tony - Posts: 552
Regarding question 1, instead of hiding/showing the drawing, you can also relocate
the drawing out of chart vertical range:

s_UseTool DrawingTool;
DrawingTool.Clear();
DrawingTool.BeginValue = sc.YPixelCoordinateToGraphValue(sc.ChartRegion1TopCoordinate+1000);
// or
// DrawingTool.BeginValue = sc.YPixelCoordinateToGraphValue(sc.ChartRegion1BottomCoordinate-1000);

it will also make the drawing disappear from the chart, see if BeginDateTime Anchor stay the same
or not.

Also, have you tried to set BeginDateTime Anchor with ACSIL code?

SCDateTime AnchorForText;
AnchorForText.SetDateYMD(2022, 1, 4);
AnchorForText.SetTimeHMS(10, 30, 07);
DrawingTool.BeginDateTime = AnchorForText;
[2022-01-06 15:50:14]
Sierra123 - Posts: 27
Re Question #1 response : Yes, when creating the drawing, I initially set the BeginDateTime anchor using the ASCIL methods SetDate and SetTime. Upon updating the Drawing to Hide it, I first retrieve the Drawing, then with the returned tool settings, I simply modify the Hide setting and resubmit, as follows (error checking removed below for simplicity).

int setHideShow(int lineNumber, int hide) {
s_UseTool Tool;
sc.GetUserDrawnDrawingByLineNumber(0, lineNumber, Tool);
if (hide == 1) Tool.HideDrawing = 1; else Tool.HideDrawing = 0;
return sc.UseTool(Tool);
}

I can try to see if your suggestion update via relocating the drawing will affect the BeginDateTime after submitting the update. It is a nice idea to try, but it will require me to persist the BeginValue for every drawing that I want to Hide and then Show later, which is adding a level of complexity as a workaround -- or -- I could try to see if setting the Value to a negative number will work, so I could change a 4700 to -4700, then I wouldn't have to persist the value, I could just multiply it by -1. [Potential workaround, thanks!]

But wrt the proper solution, When I use the Hide/Show checkbox in the Drawing Properties dialog box, I don't have this problem. That's why I am thinking that there is another setting within the Tool that I should be able to change within ASCIL calls such that the Hide should work properly. -- Or is this expected behavior, or a bug in the ASCIL interface that I have to workaround? Thanks!!
Date Time Of Last Edit: 2022-01-06 16:59:10
[2022-01-07 16:51:31]
Sierra Chart Engineering - Posts: 104368
We will be looking over the items in post #1 as soon as we can.
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
[2022-01-11 16:00:20]
Sierra123 - Posts: 27
I have tried a couple more things to try to isolate the issue further (and workaround it) but have not found anything thus far. If you (Sierra Chart Engineering) have any updates, I would appreciate it. Thanks
[2022-01-16 21:36:36]
Sierra_Chart Engineering - Posts: 18663
1. We think we determined the reason for this, and we will implement a solution today.
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

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

Login

Login Page - Create Account