GiantBarV03Arrows
Download scriptThis script is designed to monitor live market activity and automatically identify significant price movements by detecting "Giant Bars"—candles that exceed a specific size threshold set by the user.
Core Functionality
The primary goal of this tool is to filter out minor market noise and highlight instances where the price moves rapidly in either an upward (Bullish) or downward (Bearish) direction. It does this by constantly calculating the difference between the opening and closing prices of the current live candle.
How it Works
- Volatility Detection: The tool compares the size of the current candle against a predefined height limit. If the candle's price movement is larger than this limit, the script triggers its logic.
- Directional Identification: Once a large move is detected, the script determines the market's direction:
- Bullish Move: If the price closes higher than it opened, the script identifies it as a "Giant Bull" movement.
- Bearish Move: If the price closes lower than it opened, it identifies it as a "Giant Bear" movement.
- Visual Indicators: To make these movements easy to see on a chart, the tool places visual icons (symbols) at the opening price of the candle. Bullish moves are marked with a "Thumbs Up" icon in Turquoise, while Bearish moves are marked with a "Thumbs Down" icon in Magenta.
- Smart Notifications: The script includes an automated alert system that notifies the user of these significant moves. To prevent constant overlapping alerts during a single price swing, it features a built-in "cool-down" period. This ensures that once an alert is triggered, the tool waits for a specific amount of time before notifying the user again, making the data much easier to manage in fast-moving markets.
Summary for Traders
Essentially, this tool acts as a visual and audible guard, highlighting moments of high momentum. Instead of having to watch every minor tick, traders can use this script to quickly spot large, aggressive price actions that might signal a significant trend shift or a burst of volatility.
//+------------------------------------------------------------------+
//| Giant Bar.mq4 |
//| Novice |
//| ver. 03 |
//| Robert Hill: ver. 03 - changed to work on timeframes less than |
//| hourly |
//| John Smith: added visual part but does not work properly |
//+------------------------------------------------------------------+
#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;
double GiantBULL[];
double GiantBEAR[];
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)
{
ObjectCreate("GiantBULL",OBJ_ARROW,0,Time[0],iOpen(0,0,0)-20*Point); // offset arrow by 20 pips from Open
ObjectSet("GiantBULL",OBJPROP_ARROWCODE,SYMBOL_THUMBSUP);
ObjectSet("GiantBULL",OBJPROP_COLOR,Turquoise);
barbody=" min. - BULL candle moved ";
}
else if(mClose < mOpen)
{
ObjectCreate("GiantBEAR",OBJ_ARROW,0,Time[0],iOpen(0,0,0)+20*Point);
ObjectSet("GiantBEAR",OBJPROP_ARROWCODE,SYMBOL_THUMBSDOWN);
ObjectSet("GiantBEAR",OBJPROP_COLOR,Magenta);
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