Bollinger Channel – forex robot that trades inside the Bollinger channel

A robot is designed for trading on a real account. The robot trades inside a channel formed by Bollinger bands. Trades are only opened with trend, near the border line of the channel. Take Profit is set at the opposite side of the channel. Deals are always by stop losses.

Торговая стратегия – между границами канала, сформированного полосами Боллинджера

The robot calculates the channel formed by Bollinger bands. Market entries will be made near the channel borders if there is a sufficient gradient. Profit is fixed on the opposite side of the channel. Since the deals are only opened in the trend direction, the EA tries to close the majority of deals with profit. Losing positions are averaged using additional deals, which are calculated so that their aggregate sum could also be closed with profit. As the deposit grows, the money management is applied to increase the volume of trades to match returns and risk with available funds. Robot testing and use are demonstrated in the video.


The default parameters are optimized to trade with the minimal risk on EURUSD H1. The EA was tested with the specified parameters using Alpari real account quotes. Testing showed that the trading robot can start working with the minimum starting deposit of 100$, with a profit of 100% per year in testing. Use of a higher deposit and of the initial lot may proportionally increase profitability. There is potential for its expansion by a simple optimization of some of its parameters.

Usage Tips

No indicators are required for the EA operation. All necessary algorithms are contained in a single EA file. To control the EA operation, you can use the standard Bollinger Bands indicator from the MetaTrader 4 terminal. You can enable or disable placing of opposite positions when the opposite direction entry criteria are met (parameter Open counter positions). If you allow opposite positions, the total number of trading cycles will be increased, while increasing the probable profit and reducing drawdown through locking.

The robot is easily optimizable for other currency pairs and timeframes. Parameters recommended for optimization are marked by (*). I will provide the product buyers with the optimization specifics in a personal message.


Main Parameters

  • Language – English, Russian;
  • Magic number – magic number for orders;
  • Open counter positions – open opposite positions (Yes, No);
  • Period Bollinger bands – BBands period; (*)
  • Deviation Bollinger bands – deviation; (*)
  • Entry criteria – the distance to the trend line (% of the channel width) to enter/exit a trade;
  • Gradient criteria – minimum gradient of the channel, with which market entry is allowed, pts; (*)
  • Offset for determining Gradient criteria – offset of the historic bar, relative to which the gradient is determined;
  • Distance to safety levels – distance in points.

Averaging parameters

  • Use martingale – enable the martingale function (Yes, No);
  • Step of averaging positions – step in points (*);
  • Lot increase coefficient – lot increase ratio;
  • Maximum number of steps for averaging positions – the maximum number of averaging step (if exceeded, close all) (*);
  • Coefficient of stop – the proportion of the averaging step, determining the stop behind the level of the last order, 0.1 … 1) (*);
  • Specified profit with averaging – preset averaging profit, $ per 0.01 lot.

Extra parameters

  • Clearance – gap above distinctive spots (points);
  • Use money management – enable the money management system (Yes, No).
  • Initial lot – initial lot.

Interface parameters allow setting the information display style on the screen and does not require comments.

The robot can be used on 5 and 4 digit quotes. Automatically detects the number of digits in quotes. At the same time, the input parameters specified in points should always be set as for 5-digit quotes (set by default).

Download demo version. It only works in the strategy tester.

Buy a robot   $50