I have a problem whereby I am running the standard "MACD Sample" EA in the optimizer but getting different results than when I "Set input parameters" and do a back-test. Here is some of the background:
1) Environment: MT4 Build 1010, Using MACD Sample EA, Windows 10
2) Spread set to "20" (5 digit broker)
3) Optimization set to show all results (i.e. skip useless results is OFF)
4) Optimizing only 1 parameter - "trailing stop" - of the MACD Sample EA.
5) Start the back-test in optimization mode. There are 6 results with a small profit.
6) Right-click the first result and select "Set input parameters"
7) Back-test with these settings - the profit is slightly different!
This is a simple example, however there are circumstances where the results I have seen using other EAs where the optimizer and back-tester are significantly different (including # of trades, etc).
Does anyone know why this is happening?
Thanks in advance!
Not sure what you mean by "manually" introducing the input values? I am only optimizing a single parameter.
I can try logging things, but in the example I gave it was only the profit that changed. This means I would need to calculate the profit to compare (and/or compare all the individual trades)?
Before I go to such lengths, I suppose I was hoping that someone may have come across this issue before and/or know why there may be a difference?
I mean simply introducing the values in the field manually instead of
You could try to simply add a Print() at the time of sending and closing orders, printing all the information about those orders (current price, stoploss/take profit values...). Then, compare the outputs and see where you start seeing differences.Kind regards.
Thanks for the suggestion. I have tried manually setting the parameter (I have also confirmed that "Set input parameters" sets the parameters correctly in the "Expert properties").
I will wait to see if anyone else has come across this before I attempt to do an in-depth analysis - not to mention I imagine it wont solve the problem unless there is something I'm doing wrong (if I am, I can't see what ;). I figure someone else must have come across this before.
Thanks for the response, Stanislav,
The settings are: Timeframe: M5, Symbol EURUSD, IG Demo with Standard Broker data, Use date unchecked (presumably this means all data available), Non-visual mode, Spread 20, Genetic algorithm off.