Login Page - Create Account

Support Board


Date/Time: Fri, 29 Nov 2024 23:48:54 +0000



Post From: Creating a Chart Drawing DRAWING_HORIZONTAL_LINE_NON_EXTENDED -Sets Wrong Year on End Time

[2023-01-08 00:01:33]
Sierra_Chart Engineering - Posts: 17266
We tested this and cannot reproduce this. This is the test code that we used:
SCSFExport scsf_UseToolExampleDrawingHorizontalLineNonExtended(SCStudyInterfaceRef sc)
{
  // Set configuration variables
  if (sc.SetDefaults)
  {
    sc.GraphName = "UseTool Example: Horizontal Line Non-Extended";
    sc.GraphRegion = 0;

    sc.AutoLoop = 0; //No automatic looping

    return;
  }

  // Do data processing  

  int& r_LineNumber = sc.GetPersistentInt(1);

  s_UseTool Tool;

  Tool.ChartNumber = sc.ChartNumber;
  Tool.DrawingType = DRAWING_HORIZONTAL_LINE_NON_EXTENDED;

  if (r_LineNumber != 0)
    Tool.LineNumber = r_LineNumber;

  // Set BarIndex to 50 bars from the end
  int BarIndex = sc.ArraySize - 50;
  BarIndex = max(BarIndex, 0);

  Tool.BeginValue = sc.Close[BarIndex];

  Tool.BeginDateTime = sc.BaseDateTimeIn[BarIndex];
  Tool.EndDateTime = sc.BaseDateTimeIn[sc.ArraySize - 3];

  Tool.Color = RGB(255, 0, 0);
  Tool.LineWidth = 10;
  Tool.Region = 0;
  Tool.AddMethod = UTAM_ADD_OR_ADJUST;

  sc.UseTool(Tool); // Here we make the function call to add the line

  r_LineNumber = Tool.LineNumber;//Remember line number which has been automatically set
}

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: 2023-01-08 00:02:02