[i]BollTrade_Ron_MT4_v04c

Download script
Author: Ron Thompson
[i]BollTrade_Ron_MT4_v04c

This tool is designed to help traders identify specific moments when price action moves significantly outside of "normal" volatility boundaries. It functions as a visual monitoring system that highlights potential overextended market movements on your trading chart.

Core Logic and Functionality

The script operates by analyzing two primary market components: the average price movement over a set period and the current volatility (how much the price typically swings up or down). By combining these, it creates a dynamic "envelope" around the market price.

1. Defining the Boundaries Instead of using static prices, the tool calculates a moving average and a standard deviation. This creates an upper and lower boundary. These boundaries are designed to represent the expected range of the market based on recent history.

2. Identifying Extremes (The "Breakout" Logic) The script doesn't just alert you when the price touches these boundaries; it looks for a specific level of "over-extension." It measures how far the high or low of a price bar has pushed beyond these calculated boundaries.

  • Upper Breakouts: If the high of a candle exceeds the upper boundary by a specific pre-defined distance, the tool marks this point.
  • Lower Breakouts: If the low of a candle drops below the lower boundary by that same specific distance, the tool marks this point.

3. Visual Feedback and Notifications To make this information actionable for a trader, the script provides two types of feedback:

  • Visual Markers: It places specific symbols (arrows) directly on your chart at the exact price levels where these over-extensions occur, allowing you to see historical "exhaustion" points at a glance.
  • Real-Time Alerts: When the price breaches these thresholds in real-time, the script triggers a notification. To prevent constant noise, it is programmed to alert only once per bar, ensuring you are notified of the move without being overwhelmed by repeated signals on a single candle.

Summary for the User

Essentially, this tool acts as an early warning system for "stretch" in the market. It helps you filter out standard price action and focus on those specific moments where the market is moving aggressively beyond its usual patterns, potentially signaling a reversal or a period of intense momentum.

Indicators Used
Moving average indicatorStandard Deviation indicator
Miscellaneous
Implements a curve of type %1It issuies visual alerts to the screen
13 Views
0 Downloads
0 Favorites
[i]BollTrade_Ron_MT4_v04c
//+-----------+
//| 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 double Deviation    =       2;    // Bollinger deviation

// Bar handling
datetime bartime=0;                      // used to determine when a bar has moved
int      bartick=0;                      // number of times bars have moved
bool     AlertOK=true;                   // can we do alerts?

//---- buffers
double val1[];
double val2[];
 

//+----------------+
//| Custom init    |
//+----------------+
int init()
  {
   IndicatorBuffers(2);
   
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,233);
   SetIndexBuffer(0,val1);
   
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(1,234);
   SetIndexBuffer(1,val2);
  }
  
//+----------------+
//| Custom DE-init |
//+----------------+
int deinit()
  {
   Print("DE-Init happened ",CurTime());
   Comment(" ");
  }

  
//+-----+
//| TPB |
//+-----+
int start()
  {   
   
   int i;
   int mybars=Bars;

   // bar counting
   if(bartime!=Time[0]) 
     {
      bartime=Time[0];
      bartick++; 
      AlertOK=true;
     }


	double ma = iMA(Symbol(),0,BPeriod,0,MODE_SMA,PRICE_OPEN,0);
	double stddev = iStdDev(Symbol(),0,BPeriod,0,MODE_SMA,PRICE_OPEN,0);   
   double bup0 = ma+(Deviation*stddev);
   double bdn0 = ma-(Deviation*stddev);

      
   for (i=mybars; i>=0; i--) 
     { 
      ma = iMA(Symbol(),0,BPeriod,0,MODE_SMA,PRICE_OPEN,i);
	   stddev = iStdDev(Symbol(),0,BPeriod,0,MODE_SMA,PRICE_OPEN,i);   
      bup0 = ma+(Deviation*stddev);
      bdn0 = ma-(Deviation*stddev);

      if( High[i]>=bup0+(BDistance*Point) )
        {
         val2[i]=bup0+(BDistance*Point);         
         if(i==0 && AlertOK)
           {
            Alert("Close outside by "+BDistance,Close[0],"!!!");
            AlertOK=false;
           }
        }
      if( Low[i]<=bdn0-(BDistance*Point) )
        {
         val1[i]=bdn0-(BDistance*Point);         
         if(i==0 && AlertOK)
           {
            Alert("Close outside by "+BDistance,Close[0],"!!!");
            AlertOK=false;
           }
        }
 
     }//for
   
 
  }//start
  

Comments