Hello,
I have decided to start learning MQL4 and I have created my first Expert Advisor. I just wonder if you can give me any feedback, comments if my approach is reasonable or if there are no unnoticed glitches in the code I have created. Anyway, I would appreciate comments :).
I have decided to try the following approach - I create several different ways of opening positions and several ways of closing those. Currently I do not care about stop loss or take profit. I check every combination of opening and closing conditions, e.g. 1st method of opening vs 1st method of closing, then 1st open vs 2nd close, 1st open vs 3rd close, 2nd open vs 1st close, 2nd open vs 2nd close and so on. (Currently I have only one opening and one closing condition). I use the same date range, i.e. 1.1.2001 - 1.1.2013, the same pair EURUSD, the same timeframe M15, the same slippage (18 with disconnected MT4), always Open Prices Only mode.
At the beginning I would like to check opening and closing logics as described in "Technical Traders Guide to Computer Analysis of the Futures Market" by Charles LeBeau & David W. Lucas. Then I will move to more complex things but first of all I need to master basics.
Best regards!
Check your OrderSelect() has worked, if it hasn't your other trading function calls in your OrderClose() will be garbage.
If CloseAllBuy and CloseAllSell are both false why bother running the for loop ? you can use OrderClosePrice() ( after a successful OrderSelect() ) for the close price of an OP_BUY or OP_SELL then you don't need to distinguish between them . . .
Slippage is not simulated in the Strategy Tester.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I have decided to start learning MQL4 and I have created my first Expert Advisor. I just wonder if you can give me any feedback, comments if my approach is reasonable or if there are no unnoticed glitches in the code I have created. Anyway, I would appreciate comments :).
I have decided to try the following approach - I create several different ways of opening positions and several ways of closing those. Currently I do not care about stop loss or take profit. I check every combination of opening and closing conditions, e.g. 1st method of opening vs 1st method of closing, then 1st open vs 2nd close, 1st open vs 3rd close, 2nd open vs 1st close, 2nd open vs 2nd close and so on. (Currently I have only one opening and one closing condition). I use the same date range, i.e. 1.1.2001 - 1.1.2013, the same pair EURUSD, the same timeframe M15, the same slippage (18 with disconnected MT4), always Open Prices Only mode.
At the beginning I would like to check opening and closing logics as described in "Technical Traders Guide to Computer Analysis of the Futures Market" by Charles LeBeau & David W. Lucas. Then I will move to more complex things but first of all I need to master basics.
Best regards!