Regression Channel – a robot that trades inside a regression channel

Trading robot adapted to work on a real account. The robot trades inside a channel formed by regression dependencies. Trades are only opened with trend, near the border line of the regression. Take Profit is oriented towards the regression at the opposite side of the channel.

Trading strategy – inside a polynomial regression channel

A trend channel limited by the polynomial regression lines is calculated. The channel line gradient determines trend direction and strength. The EA enters the market when the price approaches the border regression line. Profit is taken near the regression line at 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 (it is smaller than in the basic mode, but the overall result should be positive). As the deposit grows, the money management is applied to increase the volume of trades to match returns and risk with available funds.


The default parameters are optimized to trade with the minimal risk on EURUSD H1. Testing with these parameters was carried out using the quotes of the real account with the Alpari broker, in the strategy tester the average annual profitability of 60% was obtained. There is potential for its expansion by a simple optimization of some of its parameters (see the video).

Recommendations on usage

No indicators are required for the EA operation. All necessary algorithms are contained in a single EA file. Additional i-Regr indicator might be useful for visual tracking of regression lines. Launch the indicator on the same chart with the EA. The indicator allows you to see regression lines calculated by the robot. The degree, kstd, bars indicator inputs should be identical to the appropriate robot ones (default parameters are matched). The robot is easily optimizable for other currency pairs and timeframes. Parameters recommended for optimization are marked by (*). Optimization techniques is shown in the video.


Main Parameters

  • Language – English, Russian;
  • Magic number – magic number for orders;
  • Entry criteria – the distance to the trend line (% of the channel width) to enter/exit a trade;
  • Gradient criteria – minimum gradient of the regression 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 belay purposes – distance in points.

Regression channel parameters

  • Оrder of regression (degree) – order of regression;
  • Channel width (kstd) – channel width;
  • Number of bars in the channel (bars) – amount of bars for the channel regression line calculation.

Averaging parameters

  • Step of averaging positions – step in points (*);
  • Coefficient of change of the lot – lot increase value;
  • 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.

Additional Parameters

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

Interface parameters allow to customize the display style of on-screen information and do 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   $80