I am trying to write a strategy that will do something based on reading a text object that is drawn on the chart. I’m having trouble getting it to read the actual text drawn on the chart. I cannot figure out how to get this set. Here is a snippet of the code…
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
foreach (DrawingTool draw in DrawObjects.ToList())
{
if (draw is DrawingTools.Text)
{
// Indicates if this is a manually drawn or script generated line
Print("Text is: " + draw);
}
}
This is what I’m getting in the output window
Text is: NinjaTrader.NinjaScript.DrawingTools.Text