• Overview
  • Reviews
  • Comments
  • What's new

Linear Regression Trader

We highly recommend you running this expert at EURUSD H1.

Linear Regression Trader employs the mathematical model of linear regression for smoothing price movements and trend recognition.

Best results can be achieved when trading at the change of the trend or when the prices form a triangle, rectangle or similar patterns.

Uses libraries for executing operations with matrices, already included into EX4 file.

The principles of work:

  1. Define the tangent coefficient of the line for the Large period N
  2. Define the tangent coefficient for the Small period n
  3. If the coefficients have different signs - wait for the soon change in the trend and open the corresponding position (in the direction of the small line)
  4. Simultaneously place Stop Loss and Take Profit.

Warning: Stop Loss is counted out from the minimum (maximum) of the preceding bar and current Bid (Ask)! Take Profit is counted from the opening price, as usual.

Positions are closed either because of stop loss or at the change of the trend, when the signal for opening the opposite position is received.

You cannot have more than 1 position open at a time.

Input parameters:

  1. Large period for regression - Large period for smoothing
  2. Small period for regression - Small period for smoothing
  3. Lot - Lot is fixed. We recommend increasing the lot size as your deposit grows
  4. Stop Loss in pips (q.v. the warning above)
  5. Take Profit in pips
  6. Tangent Line coefficient for Large period - Large tangent coeff. for position opening
  7. Tangent Line coefficient for Small period - Small tangent coeff. for position opening
  8. Magic Number - the identifier of a particular expert in a terminal. By default it is 10. If you want to run several experts in one terminal, make sure they have unique magic numbers.

Timeframes and Currencies:

We highly recommend you running this expert at EURUSD H1.

Being careful, you can also try using the expert with other currency pairs and/or timeframes, after performing backtesting.


Default Take Profit and Stop Loss parameters are supposed to work with four-digit quotes (i.e. 1.1520). If you are trading at the account with five-digit quotes, you should multiple the parameters by 10.

Should you have any questions, please feel free to contact the author directly.

No reviews
Version 1.1 2018.08.27
Disabled some useless notifications