I am working on an indicator that will alert the user the current price is near one of the HorizontalLine or lines that are drawn on the Chart.
What I am looking for now, is a way to get the line's price (more important - HorizontalLine, and later I will try the same with other lines)
From the documentation, I should use this (Start & End Anchor):
(draw as DrawingTools.HorizontalLine).StartAnchor.Price
Error on calling OnBarUpdate method on bar 0
if ( draw.GetType().Name == "HorizontalLine")
if (draw is DrawingTools.HorizontalLine)
This is the full code I am using now to test:
foreach (DrawingTool draw in DrawObjects.ToList()) { Print(draw.DisplayName + " --> " + draw.GetType().Name); if ( draw.GetType().Name == "HorizontalLine") { double myDbl = (draw as DrawingTools.HorizontalLine).StartAnchor.Price; Print("FOUND!!!! " + draw.DisplayName); //myDbl.ToString()); } }
Thank you for the help
Comment