//+------------------------------------------------------------------+
//| Giant Bar.mq4 |
//| Novice |
//| ver. 03 |
//| Robert Hill: ver. 03 - changed to work on timeframes less than |
//| hourly |
//+------------------------------------------------------------------+
#property indicator_chart_window
extern int barsolidheight=30;
extern int alertinterval=120;
string barbody="";
int NextMinute=0;
int NextPeriod=0;
double mOpen, mClose, mDif;
double bsh;
int init()
{
bsh = barsolidheight*Point;
NextMinute = Minute();
return (0);
}
int start()
{
mClose = iClose(0,0,0);
mOpen = iOpen(0,0,0);
mDif = MathAbs(mClose - mOpen);
if(mDif > bsh)
{
if( Minute()>=NextMinute)
{
if (NextPeriod == 0)
{
if(mClose>mOpen)
barbody=" min. - BULL candle moved ";
else if(mClose < mOpen)
barbody=" min. - BEAR candle moved ";
Alert(Symbol()," ",Period(),barbody,mDif/Point," pip(s)");
NextMinute=Minute()+alertinterval;
NextPeriod = 1;
if(NextMinute>=Period()) {NextMinute-=Period();NextPeriod=0;}
}
}
}
return(0);
}
Comments