Forex PirDpo Expert Advisor


Forex PirDpo Expert Advisor is a mean reversion trading robot that works only LONG. It can be used on several indexes like sp500, dow jones 30, eurostoxx 50, dax 30, etc., on a daily timeframe.

It basically applies this algorithm:

  1. Calculate detrended price with this formula detrend = (close – simple_moving_average(length))/simple_moving_average(length)
  2. if detrend <= min(detrend,length) the BUY
  3. SELL after timeExit days

Key Features

  1. Absence of dangerous algorithms.
  2. It works just when the bar is closed.
  3. Easy to use, optimization required if you want to apply it to other instruments.

Description of the Main Expert Advisor Settings

  • magicNumber: self-explicative
  • length: lookback period to calculate the detrended price.
  • timeExit: maximum number of days in position.
  • fixedlots: if this parameter is not equal to zero, the EA will open trades using this lot size.  This parameter takes precedence on maxRisk.
  • maxRisk: if this parameter is not equal to zero, the EA will open trades using a variable lot size, risking a fix percentage of the account. For instance, if maxRisk is equal to 1.0, an order will be opened for X lots, but the stop loss will be around 1.0% of the account. Due to roundings and different calculations, the maximum risk cannot be exactly 1.0%, but it will be a number really close to it (most of the times a bit bigger).
  • stp: stop loss expressed in percentage from the entry price.
  • tgt: profit target expressed in percentage from the entry price.

Suggested parameters for SP500 index

  • length = 14
  • timeExit = 9
  • stp = 3.0
  • tgt = 5.0

Time frame DAILY

Test results:

Forex PirDpo Expert Advisor


Forex PirDpo Expert Advisor For Metatrader 4


Copy and paste the file into the MQL4 Experts folder of the Metatrader 4 trading platform.

You can access this folder from the top menu as follows:

File > Open Data Folder > MQL4 > Experts (paste here)

Other forex indicators and strategies

Leave a Comment