Candlestick pattern indicator question

Wonder if anyone can advise me?
I’m using the candlestick pattern indicator, specifically for Doji Candles.
Id like an audible alert “after” the Doji has appeared.
but I’m getting an alert on every new candle.

I’ve tried setting “Bars ago” to 1 on both sides in the conditions menu, but this has no effect.

Any thoughts would be greatly apricated :grinning_face:

@Richard_K

Look for this code at line 124

case ChartPattern.Doji:
	BarBrushes[0] 			= upBrush;
	CandleOutlineBrushes[0] = downBrush;
	int yOffset 			= Close[0] > Close[Math.Min(1, CurrentBar)] ? 20 : -20;
	DrawText("Doji", 0, (yOffset > 0 ? High[0] : Low[0]), yOffset);
break;

Add your Alert() or PlaySound underneath the DrawText.
I suggest adding a condition for only real time alerts,
as well as checking only alerting on FirstTickOfBar.

case ChartPattern.Doji:
	BarBrushes[0] 			= upBrush;
	CandleOutlineBrushes[0] = downBrush;
	int yOffset 			= Close[0] > Close[Math.Min(1, CurrentBar)] ? 20 : -20;
	DrawText("Doji", 0, (yOffset > 0 ? High[0] : Low[0]), yOffset);
	if(State == State.RealTime && IsFirstTickOfBar) Alert(...);
break;

Be Safe in this Crazy World!
:smiling_face_with_sunglasses: