Login Page - Create Account

Support Board


Date/Time: Wed, 24 Apr 2024 17:39:59 +0000



DRAWING LINE is no longer working

View Count: 747

[2019-05-25 23:58:37]
WarriorTrader - Posts: 245
Hello,

After upgrading to 1919 the DRAWING_LINE is no longer working. I was able to use DRAWING_HORIZONTAL_LINE_NON_EXTENDED as a replacement for some drawings but I use the Line tool to draw vertical lines also. I did not see a "NON_EXTENDED" version for vertical lines.


I also use the Line tool for lines that are not horizontal or vertical.


In the code below you can switch drawing types to see that the DRAWING_LINE tool is not working. All variables have been commented out and replaced with fixed values for simplicity.



Thanks,

WT



  //Zero line for tick chart
  TickPrice.Clear();
  TickPrice.ChartNumber = RemoteChartNum;
  TickPrice.AddAsUserDrawnDrawing = 0;
  TickPrice.Region = 0;
  TickPrice.DrawingType = DRAWING_LINE; //DRAWING_HORIZONTAL_LINE_NON_EXTENDED; //DRAWING_LINE;
  //TickPrice.MarkerType = MARKER_TRIANGLELEFT;
  //TickPrice.MarkerSize = 5;
  TickPrice.LineWidth = 3;
  //TickPrice.MarkerSize = 8;
  TickPrice.LineStyle = LINESTYLE_SOLID;
  TickPrice.LineNumber = 34313355l; // + ChartNumID;
  TickPrice.AddMethod = UTAM_ADD_OR_ADJUST;
  TickPrice.UseRelativeVerticalValues = 1;

  TickPrice.BeginDateTime = 50; //BarLocation + 2;
  //TickPrice.BeginIndex = sc.Index+1;
  TickPrice.BeginValue = 50; //ValueLocation + TickDisplay + Overlap;
  TickPrice.EndDateTime =55; // BarLocation + 5;
  //TickPrice.BeginIndex = sc.Index+1;
  TickPrice.EndValue = 50; //ValueLocation + TickDisplay + Overlap; // will include negative numbers

  TickPrice.Color = RGB(255, 255, 255);  
  /*if (sc.BaseData[SC_LAST][sc.Index] > ValueHighPrice) {
    TickPrice.Color = RGB(0, 255, 0);
    //TickPrice.MarkerSize = 8;
    TickPrice.LineWidth = 5;
  }
  else if (sc.BaseData[SC_LAST][sc.Index] < ValueLow) {
    TickPrice.Color = RGB(255, 0, 0);
    //TickPrice.MarkerSize = 8;
    TickPrice.LineWidth = 5;
  }
  else if ((WickResetNum == 2) && (sc.BaseData[SC_LAST][sc.Index] >= 2)) //light blue
    TickPrice.Color = RGB(86, 97, 235);

  else if ((WickResetNum == 2) && (sc.BaseData[SC_LAST][sc.Index] <= -2)) //light red
    TickPrice.Color = RGB(223, 100, 100);
  else
    TickPrice.Color = RGB(128, 128, 128); */
    
  

  sc.UseTool(TickPrice);

Date Time Of Last Edit: 2019-05-26 00:00:18
[2019-05-26 02:55:51]
Sierra Chart Engineering - Posts: 104368
We do not observe any problem with this. This needs to be removed as it is ignored:
TickPrice.ChartNumber = RemoteChartNum;

Refer to the documentation for that variable:
Using Drawing Tools From an Advanced Custom Study: s_UseTool::ChartNumber

Also you should no longer be assigning a line number:
TickPrice.LineNumber = 34313355l;

Refer to:
Using Drawing Tools From an Advanced Custom Study: s_UseTool::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
Date Time Of Last Edit: 2019-05-26 02:56:37
[2019-05-26 05:09:48]
WarriorTrader - Posts: 245
We do not observe any problem with this


Hello,

I took out TickPrice.ChartNumber = RemoteChartNum; amd TickPrice.LineNumber = 34313355l;
Since AddAsUserDrawnDrawing = 0 taking thoes lines should not make a difference since it is UTAM_ADD_OR_ADJUST, but I did it anyway - same result.


If you change the tool type to DRAWING_HORIZONTAL_LINE_NON_EXTENDED the line shows up as expected. I believe using UseRelativeVerticalValues = 1 may be the issue here. I have had problems with relative values in the past. Usually I can find a work around - so I never did post anything about it.

In this case there is no work around.

Do you need me to make a chartbook with this code? Not sure this is necessary if you run my simple code with the two different Drawing Types in question.

This is an study that has been running for over four years and I have been coding SC for over eight years. I am also a professional developer outside of trading. Please let me know if you need a chartbook.


Thanks,
-WT
[2019-05-26 23:59:24]
WarriorTrader - Posts: 245
Hello,

Here is a chartbook showing the problem. The only difference between the two studies is the use of DRAWING_LINE and DRAWING_HORIZONTAL_LINE_NON_EXTENDED


Thanks,

WT
Date Time Of Last Edit: 2019-05-27 20:53:53
Private File
Private File
[2019-05-27 00:04:41]
WarriorTrader - Posts: 245
More files.
Date Time Of Last Edit: 2019-05-27 20:54:21
Private File
attachmentLine_Not_Working_64.dll - Attached On 2019-05-27 00:03:27 UTC - Size: 95 KB - 268 views
Private File
[2019-05-27 02:15:36]
Sierra Chart Engineering - Posts: 104368
Ok we see what the problem is. This will be resolved in the next release. We will have this out in about an hour.
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: 2019-05-27 02:15:43

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

Login

Login Page - Create Account