I'm looking for a developer to build a custom MT5 Expert Advisor that makes the backtest of trades already happened in the past. I am giving much details don’t be afraid of the amount of details shared.
The code will read a CSV with the following columns:
Please note that some columns are optional, so the code has to work also if those are blank or NA or weird numbers. (if the above conditions are activated).
The code will also create a CSV with the following column as final report.
The first columns of the final report will match the ones of the CSV

The second part of columns of the final report will be:

This is the time of the closing, might it be normal closing, TL or SL
Closing by CSV closing time or TL or SL
Requirements for the EA:
- Basic functioning: The EA will be used for backtesting, it will open positions at the open time, with the specific lots, it will add a take profit and a stop loss and if at the closed time the position is still opened (didn’t touch the TL or SL) then it will close exactly at the closed time.
- Additional Requirements:
- Strict Opening by X pips: This option can be activated or not by the user: if, at the opening time, the price is X pips away from the Opening price in the CSV, the EA will not open the position and will write the comment in report: “Position not opened as X pips different from expected”. X is defined by the user. If this option is not activated, the EA will open the position at the specific time regardless of the price level.
- Close position activated: This option can be activated or not by the user: if, this option is activated, at the closed time, if the position is still opened (not yet touched TP or SL), it will be closed regardless of the price.
- Lots activated: This option is defined by the user: Case 1: the Lots traded are exactly the ones written in the CSV file. If there is not enough balance, it will write in the comment: “Position not opened as money not sufficient given the lots amount”. Case 2: the lots are fixed and defined by the user. If there is not enough balance, it will write in the comment: “Position not opened as money not sufficient given the lots amount”. Case 3: The lots are in % of the balance of that moment. Percentage defined by the user. Case 4: The lots are in % of the equity of that moment. Percentage defined by the user.
In any case if a position cannot be opened as there is not enough funding it needs to go in the comment.
4. SL activated: This option is defined by the user:
Case 1: the SL traded are exactly the ones written in the CSV file. If it is a weird number or zero or blank will add in the comments.
Case 2: the SL are fixed (pips) and defined by the user.
Case 3: the SL are based in % of loss and defined by the user.
Case 4: the SL traded are exactly the ones written in the CSV file. If it is a weird number or zero or blank will add in the comments. However, if the actual opening price is X pips away from the opening price defined in the CSV, also the SL will be shifted by X pips.
5. TP activated: This option is defined by the user:
Case 1: the TP traded are exactly the ones written in the CSV file. If it is a weird number or zero or blank will add in the comments.
Case 2: the TP are fixed (pips) and defined by the user.
Case 3: the TP are based in % of gain and defined by the user.
Case 4: the TP traded are exactly the ones written in the CSV file. If it is a weird number or zero or blank will add in the comments. However, if the actual opening price is X pips away from the opening price defined in the CSV, also the TP will be shifted by X pips.
6. TS (customed trailing stop) activated: This option is defined by the user:
Case 1: if the price of the underlying will reach the middle point between the actual opening price and the TP (whatever it is), it will move the SL (whatever it is) to the actual opening price + a shift in pips defined by the user (default value 0 pips of shift).
Case 2: if the price of the underlying will reach the 1/3 point between the actual opening price and the TP (whatever it is), it will move the SL (whatever it is) to the actual opening price + a shift in pips defined by the user (default value 0 pips of shift).
If it will reach 2/3 between the actual opening price and the TP it will move the SL to the 1/3 point. No need of shift here.
Case 3: Deactivated:
In any case if the price reaches 50% or 1/3 or 2/3 it has to be written in the comment.
7. GMT shift: This option is defined by the user:
As the CSV may be based on a timezone different from the one used in Metatrader everything in the CSV might be interpreted in a shifted hour. (default value 0 hours).
Hint! Please note that in case the GMT shift is wrong, the Opening Time in the CSV might happen in cases where the market is close, in this case the code should not block but just add this in the comment.
8. Symbol: This option is defined by the user:
The code is invented to deal with FX (major and minor 40+ different CCY) and GOLD.
However the user can define which one to trade, if no one is specified the EA will trade everything.
9. Max daily DD: This option is defined by the user:
Each day at a specific time, the EA will start resetting the Drawdown (see challenge). If the drawdown goes after a certain threshold e.g. 4% it will close immediately all the positions and it cannot open position again for the whole day (i.e. since the Drawdown is reset) it will be the user to define at which GMT is set the Drawdown.
10. Max position opened: This option is defined by the user:
The user defines how many positions can be opened on the same time.
E.g. if the option is set to 4, and there are already 4 positions opened, the EA cannot open a 5th position so it has to skip the potential opened positions in the CSV.
11. Max position opened same Symbol: This option is defined by the user:
The user defines how many positions can be opened on the same time of the same Symbol.
- Error handling: The code has to be robust, in the sense that if any error happen it does not need to crash, but just write in the comment the type of error and move on.
- CSV file write: The EA will write the following CSV as report. (please be careful that I guess each agent will create a different CSV in case I use multiple parameters). Find a way to call them differently à probably using the different parameters.
- The EA during backtest need to allow multiple agents (core) on the same time.
Optional requirements:
- The code might be quite easy to understand and modify.
- CSV file read: The file used in backtest are unfortunately every time automatically deleted by Metatrader 5, so the user (me) has to always copy paste the CSV into each agent files folder. Is there a way to tell Metatrader 5 to go getting the files in another folder and copy paste to the Agent/Files folder?
📦 Deliverables:
- Full source code (.mq5)
- Executable MT5 file (.ex5)
- Setup guide
💰 Conditions & Time:
- 5–15 Business days to develop.
- A testing phase of 3 CSV files is required – I will prepare the files and see if the code will be bugged.
- Please note that a code that does 95% of the things listed above is for me useless, I need something that is working properly, that is complete and consistent.
- The code will be sold to me only and not sold to the public, of course the developer can use it for his personal usage but he/she confirm that he will not sell to other parties.