Login Page - Create Account

Support Board


Date/Time: Fri, 07 Feb 2025 16:20:11 +0000



Post From: Using DRAWING_DATE_MARKER in ACSIL study

[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.