Trabajo finalizado
Tarea técnica
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”.