작업 종료됨
명시
Dear Developers,
I would have a very simple request.
I have a ML model developed in Python for EURUSD daily trading. I would like to backtest it in Meta Trader 5 using the Strategy Tester tool. For that I would need an Expert Advisor program.
The input would be a csv file that contains two columns:
-dates (going back for a few years on a daily basis)
-trading signal (it can have only 2 values, either 1: Buy, or -1: Sell).
The idea for the EA program to do would be the following:
1) import/read the series of trading signals from the csv file.
2) initiate trade
a) based on the trading signal for the given day (historically). In case the value of the trading signal is
1: close existing short position AND open a new long position
-1: close existing long position AND open a new short position
c) Once in a position, nothing changes until the trading signal (for a subsequent day) changes sign.
b) There should be a settable parameter for the % of the available balance (on a given day) in the account to be used in the trades. This can be a single parameter applicable to all trades in a given backtest run (i.e. will be multiplied by the prevailing, available balance on a given day throughout the whole time window; a value of '100%' would mean that it uses all the prevailing, available balance for the trades).
d) A settable cost parameter in pips should be implemented as well, also as a flat number. It can also be set at the beginning of the backtest run and the value(expressed by the single number in pips) should be subtracted from the balance approximating the average cost elements associated with the trade (like commission, funding cost). It should be applied to each and every trade (both closing existing and opening new positions).
I would like to run it in the Strategy Tester selecting the backtesting time window (same as in the csv file), therefore it must be compatible with that, i.e. initiate the trades in Strategy Tester on the given day based on the trading signal from the csv file.
I'm attaching a sample of the csv file I would use.
I would appreciate your help.
Thank you!
Best regards,
Balazs