[i]BollTrade_Ron_MT4
Download scriptThis tool is designed to identify specific price extremes by monitoring the relationship between market action and standard volatility boundaries. It functions as a visual guide for traders looking to spot significant "overextended" moments in the market.
Core Logic Overview
The script relies on the Bollinger Bands—a common technical analysis indicator that establishes a range of expected price movement based on average volatility. Instead of simply showing where the price is currently, this script looks for instances where the price moves significantly beyond these expected boundaries.
How it Works
- Establishing the Boundaries: The tool calculates an upper and lower "ceiling" and "floor" based on a specific time period and standard deviation (user-adjustable settings).
- Detecting Extremes: The script scans historical price data to find specific "breakout" events:
- Upper Breakout: It identifies moments where the highest price of a bar pushes significantly above the upper boundary.
- Lower Breakout: It identifies moments where the lowest price of a bar drops significantly below the lower boundary.
- The Buffer Zone: Rather than marking every time the price touches a boundary, the logic requires the price to exceed the boundary by a specific set amount (a "buffer"). This helps filter out minor fluctuations and highlights only the most aggressive price movements.
- Visual Output: When these conditions are met, the script places visual markers on your chart. These markers serve as historical signposts, showing exactly where the market reached an extreme state that may signal a potential reversal or a period of high exhaustion.
Summary for the User
In simple terms, this tool acts as an "extreme zone" detector. It looks back at your charts and highlights the specific candles where price "stretched" too far in one direction. By visualizing these overextended points, it helps traders identify areas where market momentum may have reached a limit, potentially providing insight into future price shifts.
/*-----------------------------+
| |
| Shared by www.Aptrafx.com |
| |
+------------------------------*/
//+-----------+
//| TwoPerBar |
//+-----------+
#property copyright "Ron Thompson"
#property link "http://www.lightpatch.com/forex/"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 DodgerBlue
#property indicator_color2 Magenta
extern double BDistance = 14; // plus how much
extern int BPeriod = 15; // Bollinger period
extern int Deviation = 2; // Bollinger deviation
//---- buffers
double val1[];
double val2[];
//+----------------+
//| Custom DE-init |
//+----------------+
// Called ONCE when EA is removed from chart
int deinit()
{
int i;
string o;
//remove the old objects
for(i=0; i<Bars; i++)
{
o=DoubleToStr(i,0);
ObjectDelete("myx"+o);
}
Print("DE-Init happened ",CurTime());
Comment(" ");
}
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(2);
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,233);
SetIndexBuffer(0,val1);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1,234);
SetIndexBuffer(1,val2);
}
//+-----+
//| TPB |
//+-----+
int start()
{
int i;
int mybars=2000;
double bup=iBands(Symbol(),0,BPeriod,Deviation,0,PRICE_OPEN,MODE_UPPER,0);
double bdn=iBands(Symbol(),0,BPeriod,Deviation,0,PRICE_OPEN,MODE_LOWER,0);
for (i=mybars; i>=0; i--)
{
bup=iBands(Symbol(),0,BPeriod,Deviation,0,PRICE_OPEN,MODE_UPPER,i);
bdn=iBands(Symbol(),0,BPeriod,Deviation,0,PRICE_OPEN,MODE_LOWER,i);
if( High[i]>=bup+(14*Point) )
{
val2[i]=bup+(15*Point);
//ObjectDelete ("myx"+DoubleToStr(objtick,0));
//ObjectCreate ("myx"+DoubleToStr(objtick,0), OBJ_TEXT, 0, Time[i], High[i]+(7*Point));
//ObjectSetText("myx"+DoubleToStr(objtick,0),"X",15,"Arial",Red);
//objtick++;
}
if( Low[i]<=bdn-(14*Point) )
{
val1[i]=bdn-(15*Point);
//ObjectDelete ("myx"+DoubleToStr(objtick,0));
//ObjectCreate ("myx"+DoubleToStr(objtick,0), OBJ_TEXT, 0, Time[i], High[i]+(7*Point));
//ObjectSetText("myx"+DoubleToStr(objtick,0),"X",15,"Arial",Red);
//objtick++;
}
}//for
//Comment(DoubleToStr(mybars,0)+" bars with usable ="+DoubleToStr(objtick,0)+" and unusable="+DoubleToStr(noobj,0)+" maxTR="+DoubleToStr(maxTR,4));
}//start
Comments