I am trying to get the end (current) price of a drawn region, but it always returns 0. The region is drawn by a custom indicator, an anchored VWAP.
Currently I use this logic in OnBarUpdate():
if (DrawObjects.Count > 0)
{[INDENT]foreach (DrawingTool draw in DrawObjects.ToList())
{[/INDENT][INDENT=2]if (draw is DrawingTools.Region )
{[/INDENT][INDENT=3]Print ("Tag name: "+draw.Tag);
DrawingTools.Region temp = draw as DrawingTools.Region;
Print("startYPrice: " + temp.StartAnchor.Price);
Print("startXTime: " + temp.StartAnchor.Time);
Print("endYPrice: " + temp.EndAnchor.Price);
Print("endXTime: " + temp.EndAnchor.Time);
Print("SlotIndex: " + temp.EndAnchor.SlotIndex);[/INDENT][INDENT=2]}[/INDENT][INDENT]}[/INDENT]
}
Tag name: region1 startYPrice: 0 startXTime: 26-2-2021 0:02:00 endYPrice: 0 endXTime: 12-3-2021 9:10:00 SlotIndex: 13789
Any ideas how to get the end/current price data of the region?
Would appreciate your help!
André

Comment