This tool is designed to monitor price movements on your trading charts and provide real-time notifications when the market experiences significant "spikes" or large candle movements. Instead of cluttering your screen with complex graphics, it acts as a vigilant background observer that alerts you only when specific volatility conditions are met.
How it Works
The logic operates based on three primary criteria:
1. Significant Movement Detection The script constantly monitors the current price candle. It calculates the distance between the opening price and the closing price of that candle. If that movement exceeds a specific size (which you can customize in the settings), the script triggers its logic. This allows you to filter out "market noise" and only focus on high-impact moves.
2. Directional Identification Once a large move is detected, the tool automatically determines the market's direction:
- If the price closed higher than it opened, it identifies it as a Bullish movement.
- If the price closed lower than it opened, it identifies it as a Bearish movement.
3. Smart Alerting and Cooling Periods To prevent your screen from being flooded with constant notifications during periods of extreme volatility, the script includes a built-in "cooldown" timer. After an alert is triggered, the tool will wait for a set number of minutes before it is allowed to send another notification. This ensures that you receive meaningful information rather than repetitive alerts for every tiny tick within a single large price swing.
Summary of Notifications
When the criteria are met, the tool will trigger a pop-up alert on your platform showing:
- The specific currency pair and timeframe.
- The direction of the move (Bullish or Bearish).
- The exact number of pips moved during that significant candle.
//+------------------------------------------------------------------+
//| Giant Bar.mq4 |
//| Novice |
//| ver. 01 |
//+------------------------------------------------------------------+
#property indicator_chart_window
extern int barsolidheight=30;
extern int alertinterval=5;
string barbody="";
int NextMinute=0;
int NextHour=0;
int start()
{
if((MathAbs(iClose(0,0,0)-iOpen(0,0,0))>barsolidheight*Point) && Minute()>=NextMinute && Hour()>=NextHour )
{if(iClose(0,0,0)>iOpen(0,0,0)) barbody=" min. - BULL candle moved "; else if(iClose(0,0,0)<iOpen(0,0,0)) barbody=" min. - BEAR candle moved ";
Alert(Symbol()," ",Period(),barbody,MathAbs(iClose(0,0,0)-iOpen(0,0,0))/Point," pip(s)");
NextMinute=Minute()+alertinterval; if(NextMinute>=60) {NextMinute-=60;NextHour=Hour()+1;}
}
return(0);
}
Comments