I use this code to alert, when the bar is drawn to 90% or greater.
#region Alert
if (IsFirstTickOfBar) RearmAlert("PASuppResBreakoutTest_Resistance");
if (showAlert && DrawObjects["BT_Swing_Low"+(CurrentBar)] != null)
{
/*if (myrearmSeconds>1)
Alert("PASuppResBreakoutTest_Resistance", Priority.High, "PASuppResBreakoutTest Resistance " + swingStrength.ToString("N0"), soundFile, myrearmSeconds, Alert_Background, bear_Color);
else*/
if (Bars.PercentComplete >= percent/100)
Alert("PASuppResBreakoutTest_Resistance", Priority.High, "PASuppResBreakoutTest Resistance " + swingStrength.ToString("N0"), soundFile, 10000, Alert_Background, bear_Color);
}
#endregion
The alert seems to rearm somehow despite the 10000 seconds set in rearmSeconds!?
another question:
The indicator draws lines, only when there is a change in price, but to catch the alerts for slow markets it needs to run on Calculate.OnEachTick. Is there another option like?
set calculate to Calculate.OnPriceChange and do this:
protected override void OnMarketData(MarketDataEventArgs e)
{
Alert logic here
}

Comment