Bolingerbandfx-mission (Forex Expert Advisors - Bollinger Band)
Click to enlarge |
|
Trend Following Expert Advisors for MetaTrader 4
Bolingerbandfx-mission - FULL MQ4 CODE
This Expert Advisor in .mq4 format has fully commented code to let you test and automate the Bollinger Band squeeze also known as a volatility breakout in MetaTrader 4. As volatility goes down and the price range compresses, prices can then tend to breakout to higher volatility. By only entering positions when the BandWidth is close to it's low and confirming with a Bollinger Band breakout, this expert advisor attempts to capture trends as they take off. Exits occur when the price goes back to the middle moving average. The headfake is what John Bollinger calls a squeeze with a breakout to one band that head fakes or whipsaws to the opposite band before starting a trend.
A quick visual example to show approximate entry and exit areas:
- MA_Periods - The number of bars to use to calculate the Bollinger Band's middle moving average line. Bollinger Bands commonly use a value of 20.
- Deviations - The number of standard deviations to use to calculate the upper and lower Bollinger Bands. A value of 2 is commonly used.
- Bandwidth_Bars - The number of bars/candlesticks back to use in calculating the lowest Bollinger BandWidth. Using this lowest level and the percent threshold in the next variable, entries will only occur when the prior bar's BandWidth is within your set range.
- Bandwidth_percent - Enter a percent value to create your acceptable threshold or range for entries. Example: If you want to have entries occur when the BandWidth is 120% or less of the lowest BandWidth of the last 100 bars, enter 20 to this variable. Putting numbers to the variable, if the lowest BandWidth is 1, entries would occur if the prior bar's BandWidth is less than 1.2.
- Risk Percent - The percent risked per position if stop is hit. Example: If you want 2% of your equity to be risked per position, enter 2 to this input.
- ATR Periods - Periods to use to calculate Average True Range. Example: If you want a 14 day ATR, enter 14. 10 day ATR, enter 10.
- Stop Range ATR - Multiples of ATR to use for calculating the stop. Example: If you want your stop to be set at 2* ATR from the price, enter 2 to this input.
- Max Units - Max number of positions to have at one time. Example: If you only want to pyramid to 5 positions, enter 5 to this input. If you do not want to pyramid positions, enter 1 to this input.
- ATR between Pyramids - Multiples of ATR to use for calculating when to add the next position through pyramiding. Example: Set this to 1.5 and the next pyramid position would be added when the price reaches your entry plus ( 1.5 * ATR ) for long positions or entry minus ( 1.5 * ATR ) for short positions.
- Slippage - Amount of allowable slippage when entering position.
- Reduction Percent - Enter an amount by which to reduce your equity for the position sizing calculation. Example: If you are in a drawdown period you can enter 20 to this input and the position size will be 20% less than without the reduction. The calculation would treat your equity as 80% of what it really is to lower your risk.
MARKETS
Trade on any pair and any timeframe. Place the expert advisor on a chart and it will use the currency pair and timeframe of the chart. Choppy and sideways markets will cause more whipsaws while markets that trend will produce more profitable trades.
ENTRY
To find a Bollinger Band squeeze, this Expert Advisor calculates the lowest BandWidth of the number of bars you specify. You then specify a percentage threshold above that lowest BandWidth to create your entry criteria. Entries occur when the prior bar's BandWidth is within your threshold and the price goes outside of either the upper or lower Bollinger Band. If your threshold is 20% of the lowest BandWidth, long positions are entered when the price equals or goes above the upper Bollinger Band and the BandWidth is less than 120% of the lowest BandWidth. Short positions are entered when the price equals or goes below the lower Bollinger Band and the BandWidth is less than 120% of the lowest BandWidth.
POSITION SIZING
This expert advisor uses Percent Volatility position sizing. Verify the tick value, minimum and maximum lot sizes, size of lot increments, etc to confirm each position will not exceed your set risk percentage. Using the stop level, if the position is stopped out, the position size is calculated to only lose the amount risked through the Risk Percent variable. The calculation looks at how many dollars are at risk, how many pips are in the distance from the entry to the stop and the value of that distance.
STOP
The stop is set using multiples of the ATR. Basing the stop on the ATR allows the stop to be placed out of the normal price range and account for volatility. If you choose 2 times the 14 day ATR, the stop on long positions would happen if the price touches or goes below the entry price minus ( 2 * ATR ). The stop on short positions would occur if the price touches or goes above the entry price plus ( 2 * ATR ). The stop is set when the position is entered. The stop accounts for gaps in price and is not set as a pending order. A position is only stopped out if the price reaches or exceeds the stop level. If you use the pyramiding option, the stop will change to be in line with the latest entry price when a new position is added.
EXIT
Positions are exited when the price goes to the opposite side of the moving average in the middle of the upper and lower Bollinger Bands. For long positions, the exit occurs when the price goes below the moving average. For short positions, the exit occurs when the price goes above the moving average.
DELIVERY
After your Payment is received, the Expert Advisor will be sent by email.
The EA is based on Bollinger bands. It places orders against the trend. For example if the price touches the upper band of the band then a short position is open. The particularity of this EA is to strengthen the position if the signal persists. If the trend is reversed then all positions are closed and orders are placed in the opposite side.
A traditional management of lots, Stop and take profit is used.
Here is an example of the orders that this EA may take. The two possible cases are represented.
In 1 and 3 positions are winning.
In 2, the position could be losing. Here, the stop loss has been reached.
A traditional management of lots, Stop and take profit is used.
Here is an example of the orders that this EA may take. The two possible cases are represented.
In 1 and 3 positions are winning.
In 2, the position could be losing. Here, the stop loss has been reached. - See more at: http://www.forex-tribe.com/forum/viewtopic.php?id=18971#sthash.6VBvm9RW.dpuf
Delivery to your PayPal email address within 24 Hours of payment confirmation.
Completing units:
Forex Expert Advisors - Bollinger Band
Market Sales Price: $199,but we sell lot more lower than that to share the opportunity with you!
Serving Professional Traders Since 2008
Once purchased I will email you the files within 20 minutes and not more than 48 hours to your email, if there a delay, please be patience receiving your files
Your Review: Note: HTML is not translated!
Rating: Bad Good
Enter the code in the box below: