```
protected override void OnBarUpdate()
{
if (CurrentBar == 0)
return;
// Define the coordinates for the rectangle
double top = SomeCalculationTop;
double bot= SomeCalculationBot;
// Draw the rectangle
Draw.RegionHighlightY(this, "Example", false, top, bot, Brushes.Blue, Brushes.DodgerBlue, 25);
// Remove the rectangle on each new bar to avoid multiple rectangles being drawn
if (Bars.IsFirstBarOfSession)
RemoveDrawObject("Example");
}
```
From now it draws the RegionHighlighY as it should, but now I want to onEachTick detects if the price touches the object decrease (from top or from bottom depending on the price touching part).
I've tried to get the High[0] and Low[0] but it doesn't react.
Note: If the price pierces the object it should be deleted.
Any hints? I'm drawing from now one RegionHighlightY, but it should draw N depending on the days loaded.
Thanks in advantage.
Comment