Login Page - Create Account

Support Board


Date/Time: Wed, 14 May 2025 05:27:28 +0000



Post From: drag and drop not working properly for horizontal lines

[2016-04-25 12:06:34]
T29_Dev1 - Posts: 22
Horizontal lines that was created from study disappears when I drag it. This code I use to create the line:


s_UseTool tool;
tool.ChartNumber  = sc.ChartNumber;
tool.DrawingType  = DRAWING_HORIZONTALLINE;
tool.TextAlignment  = DT_RIGHT;
tool.AddMethod    = UTAM_ADD_OR_ADJUST;
tool.Color    = COLOR_GREEN;
tool.LineStyle    = LINESTYLE_SOLID;
tool.LineWidth    = 2;
tool.Text    = "myline";
tool.BeginValue    = sc.BaseDataIn[SC_HIGH][sc.ArraySize - 2];
tool.DisplayHorizontalLineValue  = 1;
tool.AddAsUserDrawnDrawing = 1;
sc.UseTool(tool);

When I create a line manually in SC, it works fine. I noticed that SC creates horizontal lines with anchor datetime != 0 and I can't set the anchor time (SC ignores it).

I want to use horizontal lines to allow user to set some price level.