Login Page - Create Account

Support Board


Date/Time: Wed, 24 Apr 2024 20:09:46 +0000



DrawingType 'DRAWING_CYCLE' how to?

View Count: 1632

[2018-05-05 14:35:30]
b3cker - Posts: 34
Hello, I was not able to find any example on how to use DrawingType 'DRAWING_CYCLE' in custom study.

For example following will display text in the study window, but when I tried to use DRAWING_CYCLE instead of DRAWING_TEXT I am not getting cycle displayed.

Can you help?

      s_UseTool CycleTool;
      CycleTool.Clear();
      CycleTool.ChartNumber = sc.ChartNumber;
      CycleTool.DrawingType = DRAWING_CYCLE;
      int CycleNumber = sc.GetPersistentInt(1);
      if (CycleNumber != 0)
        CycleTool.LineNumber = CycleNumber;
      CycleTool.Region = sc.GraphRegion;
      CycleTool.ExtendRight;
      CycleTool.UseToolConfigNum;
      CycleTool.BeginDateTime = sc.BaseDateTimeIn[sc.ArraySize - 100];
      CycleTool.Color = RGB(255, 255, 0);
      CycleTool.AddMethod = UTAM_ADD_OR_ADJUST;
      CycleTool.ReverseTextColor = 0;
      sc.UseTool(CycleTool);
[2018-05-07 19:49:09]
Sierra Chart Engineering - Posts: 104368
Cycle drawings from advanced custom studies are not currently supported. We will have to add this but we do not know how soon.
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
[2018-05-20 22:32:12]
Sierra Chart Engineering - Posts: 104368
Cycle drawings are now supported in ACSIL. You need the latest prerelease for this:
Software Download: Fast Update
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
Date Time Of Last Edit: 2018-05-20 22:33:27
[2018-05-27 18:12:25]
b3cker - Posts: 34
Hello,

Installed pre-released version, added following code. Cycle tool is not displayed.
What am I doing wrong? Can you provide one example?     


s_UseTool CycleTool;
      CycleTool.Clear();
      CycleTool.ChartNumber = sc.ChartNumber;
      CycleTool.DrawingType = DRAWING_CYCLE;
      int CycleNumber = sc.GetPersistentInt(1);
      if (CycleNumber != 0)
        CycleTool.LineNumber = CycleNumber;
      CycleTool.Region = sc.GraphRegion;
      CycleTool.ExtendRight;
      CycleTool.UseToolConfigNum;
      CycleTool.BeginDateTime = sc.BaseDateTimeIn[sc.ArraySize - 100];
      CycleTool.Color = RGB(255, 255, 0);
      CycleTool.AddMethod = UTAM_ADD_OR_ADJUST;
      CycleTool.ReverseTextColor = 0;
      sc.UseTool(CycleTool);
[2018-05-28 21:41:17]
Sierra Chart Engineering - Posts: 104368
Refer to the scsf_UseToolExampleDrawingCycle function in the /ACS_Source/studies.cpp file.
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
Date Time Of Last Edit: 2018-05-28 21:41:29
[2018-06-09 13:19:17]
b3cker - Posts: 34
Hello,

Cycle object region is set to Cycle.Region = sc.GraphRegion; but the cycle is always displayed to Cycle.Region= 0 ;

Bug?


Regards



  int& r_LineNumber = sc.GetPersistentInt(1);
  if (sc.IsFullRecalculation)
  {
    r_LineNumber = 0;
  }
  //Add or update cycle drawing.

  s_UseTool Cycle;
  Cycle.Region = sc.GraphRegion;
  Cycle.Clear();
  Cycle.ChartNumber = sc.ChartNumber;
  if (r_LineNumber != 0)
  Cycle.LineNumber = r_LineNumber;
  Cycle.DrawingType = DRAWING_CYCLE;
  Cycle.BeginDateTime = sc.BaseDateTimeIn[sc.ArraySize - 33];
  Cycle.EndDateTime = sc.BaseDateTimeIn[sc.ArraySize - 77];
  //Cycle.Region = 0;
  Cycle.Color = RGB(255, 255, 0);
  Cycle.LineWidth = 1;
  Cycle.NumCycles = 5;
  Cycle.AddMethod = UTAM_ADD_OR_ADJUST;

  if (sc.UseTool(Cycle) > 0)
  r_LineNumber = Cycle.LineNumber;



http://www.sierrachart.com/image.php?Image=1528550253977.png
[2018-06-10 01:28:19]
Sierra Chart Engineering - Posts: 104368
It works properly for us when using Chart Region 1. Use this code as a test:
SCSFExport scsf_UseToolExampleDrawingCycle(SCStudyInterfaceRef sc)
{
  // Set configuration variables
  if (sc.SetDefaults)
  {
    sc.GraphName = "UseTool Example: Cycle";
    sc.GraphRegion = 1;
    sc.FreeDLL = 0;
    sc.AutoLoop = 0; //No automatic looping

    return;
  }

  int& r_LineNumber = sc.GetPersistentInt(1);

  if (sc.IsFullRecalculation)
  {
    r_LineNumber = 0;
  }

  //Add or update cycle drawing.
  s_UseTool Tool;
  Tool.Clear();
  Tool.ChartNumber = sc.ChartNumber;
  Tool.Region = 1;
  if (r_LineNumber != 0)
    Tool.LineNumber = r_LineNumber;
  Tool.DrawingType = DRAWING_CYCLE;
  Tool.BeginDateTime = sc.BaseDateTimeIn[sc.ArraySize - 100];
  Tool.EndDateTime = sc.BaseDateTimeIn[sc.ArraySize - 90];
  Tool.Color = RGB(255, 255, 0);
  Tool.LineWidth = 5;
  Tool.NumCycles = 5;
  Tool.AddMethod = UTAM_ADD_OR_ADJUST;

  if (sc.UseTool(Tool) > 0)
    r_LineNumber = Tool.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

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

Login

Login Page - Create Account