hi folks,
i have this trend line alert (found it here, thx!)
how can i declare that i only get an alert when price breaks at least 10 pips through the trend line and pulls back within 3 pips of the trend line?
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 ( (MailSent <= Bars) && Bid-AlertPipRange*Point <= val && Bid+AlertPipRange*Point >= val)
{SendMail( Symbol() ,"");
MailSent = Bars + 3;
}
if ((SoundPlayed <= Bars) && Bid-AlertPipRange*Point <= val && Bid+AlertPipRange*Point >= val)
{PlaySound(AlertWav);
SoundPlayed = Bars + 3;
}
return(0);
}
thanks!
i have this trend line alert (found it here, thx!)
how can i declare that i only get an alert when price breaks at least 10 pips through the trend line and pulls back within 3 pips of the trend line?
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 ( (MailSent <= Bars) && Bid-AlertPipRange*Point <= val && Bid+AlertPipRange*Point >= val)
{SendMail( Symbol() ,"");
MailSent = Bars + 3;
}
if ((SoundPlayed <= Bars) && Bid-AlertPipRange*Point <= val && Bid+AlertPipRange*Point >= val)
{PlaySound(AlertWav);
SoundPlayed = Bars + 3;
}
return(0);
}
thanks!