[i]BollTrade_Ron_MT4_v1
Download scriptThis tool is designed to identify specific price action extremes on a trading chart by analyzing the relationship between the current market price and established volatility boundaries. It serves as a visual aid for traders who want to spot "overextended" movements where the price has pushed significantly beyond normal statistical norms.
How the Logic Works
The script relies on a common technical analysis tool known as Bollinger Bands. These bands create a "channel" around the price, representing the standard range where the market typically fluctuates. The logic follows these specific steps:
1. Establishing the Baseline The tool looks at a set period of historical data (defined by the user) to calculate the upper and lower boundaries of the market's volatility. These boundaries act as a "ceiling" and a "floor" for the price.
2. Identifying Extremes (The "Breakout") Instead of simply looking for when the price touches these boundaries, the script looks for much more aggressive movements. It checks if the price has surged high enough to exceed the upper boundary or dropped low enough to fall below the lower boundary by a specific additional distance.
3. Visual Signaling When the market fulfills these conditions—meaning the price has pushed significantly further than the standard volatility suggests it should go—the script places visual markers on the chart:
- Upper Signals: These appear when the price pushes aggressively above the upper boundary, highlighting potential "overbought" conditions or extreme upward momentum.
- Lower Signals: These appear when the price drops aggressively below the lower boundary, highlighting potential "oversold" conditions or extreme downward momentum.
Summary for the Trader
Essentially, this script filters out the "noise" of normal market movement. It only alerts you when the price behaves abnormally by stretching far beyond its usual limits. By identifying these high-intensity zones, it helps traders visualize areas where the market might be overextended, potentially providing clues on where a reversal or a significant pause in price action might occur.
//+-----------+
//| 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