How to read all Anchors of Short Line (brush.cyan generated by a strategy) .
If I draw a line manually , code works good. But when I add strategy that make short line , I have an issue.
GetType show that is a Line , but impossible to get Anchors.
Name: Line GetType().Name: Line draw.Tag: Line 3 (FOR manual drawing Line)
draw: 4996 End: 5007 .Price 3558.37752711497
Name: Line GetType().Name: Line draw.Tag: sline_09/11/2020 17:26:00 (FOR Strategy drawing short Line color cyan)
Strategy 'M_Strategy': Error on calling 'OnBarUpdate' method on bar 5015: Object reference not set to an instance of an object.
foreach (IDrawingTool draw in DrawObjects)
{
Print("Name: " + draw.Name + " GetType().Name: " + draw.GetType().Name + " draw.Tag: " + draw.Tag);
DrawingTools.Line globalLine = draw as DrawingTools.Line;
if (draw.GetType().Name == "Line")
Print("draw: " + globalLine.StartAnchor.SlotIndex + " End: " + globalLine.EndAnchor.SlotIndex + " .Price " + globalLine.EndAnchor.Price);
}

Comment