Profit after commission when backtesting strategy ECN broker
- Features of the mql4 language, subtleties and techniques
- How to determine the spreads?
- include order commission on close of last order
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.
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.
How can we get the value of "commission" in program ?
Try this: Commission() - https://www.mql5.com/en/docs/standardlibrary/tradeclasses/cpositioninfo/cpositioninfocommission
- www.mql5.com