Support Board
Date/Time: Fri, 07 Feb 2025 13:01:16 +0000
[Programming Help] - Using DRAWING_DATE_MARKER in ACSIL study
View Count: 654
[2020-05-31 23:11:53] |
JacquesSauve - Posts: 7 |
Hello, I have successfully used several drawing tools in a custom study, but DRAWING_DATE_MARKER defeated me: I cannot get it to draw a date marker after many tries. Could you please provide an example. Thank you. |
[2020-06-01 06:53:48] |
Flipper - Posts: 65 |
You would get a better response if you show what you actually tried to do - The code.
|
[2020-06-01 15:38:16] |
JacquesSauve - Posts: 7 |
Here is the code I use: int drawDateHighlight(SCStudyGraphRef sc, SCDateTime dateTime, float beginValue, float endValue, int& dateHighlightLineNumber) { s_UseTool Tool; Tool.ChartNumber = sc.ChartNumber; if (dateHighlightLineNumber != 0) Tool.LineNumber = dateHighlightLineNumber; // Tool.DrawingType = DRAWING_VERTICALLINE; // Tool.LineStyle = LINESTYLE_DASH; // Tool.LineWidth = 1; Tool.DrawingType = DRAWING_DATE_MARKER; // Tool.UseRelativeVerticalValues = 1; Tool.BeginDateTime = dateTime; Tool.BeginValue = beginValue; Tool.EndValue = endValue; Tool.Color = COLOR_YELLOW; Tool.AddMethod = UTAM_ADD_OR_ADJUST; Tool.AddAsUserDrawnDrawing = 1; sc.UseTool(Tool); return Tool.LineNumber; } I have tried passing the beginValue and endValue in terms of tick values of the interesting bar and I have tried the values with sc.UseRelativeVerticalValues=1. Nothing ever appeared on screen. I ended up using a vertical line (commented code). Any help is appreciated. The documentation at Using Drawing Tools From an Advanced Custom Study says that DRAWING_DATE_MARKER is available but nothing is said about what other parameters must be provided. |
[2020-06-02 06:39:16] |
Flipper - Posts: 65 |
Oh! I cannot make it work either sorry. It is actually returning an error as soon as I use DRAWING_DATE_MARKER SCString MessageText; int test; test = sc.UseTool(Tool); MessageText.Format(" Index: %d, Error Code: %d ", sc.Index, test); sc.AddMessageToLog(MessageText, 0); Since this thread is marked as [Programming Help] SC staff I don't think will look at it. Maybe you could prompt them to have a look at it. |
To post a message in this thread, you need to log in with your Sierra Chart account: