Spécifications
I am seeking a coder to write an EA to use in the strategy tester that will read my historic trades, and closely match my actual entries this year, with adaptive SL and TP based on pips or time to test if I can trade better by altering my exit plan.
Dot Points on requirements:
- MQL5 EA (open to suggestions if there are alternative ways to test)
- To be used in strategy tester only
- Reading a CSV file for exact time/date (or VERY close to), the market (UK100 and GER40 are used) and the entry price.
- Entering the market in line with my trading history at the specified market time (i.e. if my history traded on the 2nd Feb at 10:00:04 at price 13095 I want to see this in the tester).
- Exiting in line with the stops from my history (as a phase 1 comparison test only to ensure results will be accurate)
- Alternate exit options to allow me to test how long I should hold trades for in time and/or points
Basic purpose: To test my trading history and compare alternate exits to maximize my strategy in the future.
Motivation
I have some live trade history files saved in csv, I would like to use MT5 to get the backtest result. Additionally, I sometimes need to modifies the SL/PT level of the trades, to see if its better than the original trades.
Provided csv file description
Read the provided csv trades history, which has the following files
ID : position id
Symbol : traded symbol
Volume : traded lotsize, >0 for buy, <0 for short.
En_Time : enter time of the position
SL : stop loss price level placed when enter the trade, can be emtpy.
PT : profit take price level placed when enter the trade, can be emtpy.
Ex_Time : exit time
Rows are sorted by “En_Time” file, the time format is “YYYY-MM-DD HH:MM:SS”.
What should the EA do
1. Parse the csv file.
2. In “OnTick” block, Place market order on time of “En_Time”, for “Symbol” with lotsize “abs(Volume)”, with direction of “sign(Volume)”. If “SL” and “PT” if not empty, place SL/PT according to the prices. The comment of the trade is set to “ID”
3. If SL/PT is not hit, or there wasnt, exit the trade on time of “Ex_Time”.
Please note, I had someone attempt this already but it just places a series of orders that do not reflect my trading in the slightest.
Considerations: Perhaps setting an order number or signifier to each trade will help to run through the orders correctly? I am open to suggestions. I do have some coding experience however I do not know the best way to make this work.