hi folks,
how can i define that an alert email (when trend line is broken) will be sent only once, not with every tick?
(found this one here in the forum
int start()
{
int counted_bars=IndicatorCounted();
ObjectCreate(TLineName, OBJ_TREND, 0, Time[25], Bid, Time[0], Ask);
ObjectSet(TLineName, OBJPROP_STYLE, LineStyle);
ObjectSet(TLineName, OBJPROP_COLOR, LineColor);
ObjectSet(TLineName, OBJPROP_WIDTH, LineWidth);
double val=ObjectGetValueByShift(TLineName, 0);
if (Bid-AlertPipRange*Point <= val && Bid+AlertPipRange*Point >= val)SendMail("- " + Symbol() + " -","-");
return(0);
}
thx!
how can i define that an alert email (when trend line is broken) will be sent only once, not with every tick?
(found this one here in the forum
int start()
{
int counted_bars=IndicatorCounted();
ObjectCreate(TLineName, OBJ_TREND, 0, Time[25], Bid, Time[0], Ask);
ObjectSet(TLineName, OBJPROP_STYLE, LineStyle);
ObjectSet(TLineName, OBJPROP_COLOR, LineColor);
ObjectSet(TLineName, OBJPROP_WIDTH, LineWidth);
double val=ObjectGetValueByShift(TLineName, 0);
if (Bid-AlertPipRange*Point <= val && Bid+AlertPipRange*Point >= val)SendMail("- " + Symbol() + " -","-");
return(0);
}
thx!