Download MetaTrader 5

Profit after commission when backtesting strategy ECN broker

To add comments, please log in or register
Sell products via the Market and track your sales statistics
Florent
183
Florent 2013.08.20 22:47 
Hello, it looks there is no possibility in optimisation results to see the net profit of each strategy after commission are applied by the broker (unless opening the report in excel to sum total commission). It'd be great
Florent
183
Florent 2013.08.21 18:24  
nobody interested, worthless ?
Ubzen
5394
Ubzen 2013.08.23 02:46  
Florew: nobody interested, worthless ?
Sounds like a good idea.
abbaspour
5
abbaspour 2014.01.22 04:28  

Florew, 

Did you find a way to include commission into your backtesting? I am not sure if there is way to do that in mql5.  

Rogerio Figurelli
Moderator
39652
Rogerio Figurelli 2014.01.22 05:07  

Florew, I created a workaround to do this in my EAs, using TesterWithdrawal() after the trade execution, to emulate a commission value.

... OrderSend(...) ...
...
// commission emulation
TesterWithdrawal(commission);

Simple as that, and works fine, as you don't need Excel to figure out and will have a more realistic backtesting.

Also, you can check the total Withdrawal (or total Commission) at Strategy Tester results tab.

Wei Sun
699
Wei Sun 2014.01.28 16:03  
How can we get the value of "commission" in program ?
Rogerio Figurelli
Moderator
39652
Rogerio Figurelli 2014.01.28 16:30  
Documentation on MQL5: Standard Library / Trade Classes / CPositionInfo / Commission
Documentation on MQL5: Standard Library / Trade Classes / CPositionInfo / Commission
  • www.mql5.com
Standard Library / Trade Classes / CPositionInfo / Commission - Documentation on MQL5
Alain Verleyen
Moderator
30739
To add comments, please log in or register