whoowl: So I ran the EA again but this time I replaced the variables directly in the code with their respective new values (9 and 15) in the code, ignoring the "input" lines, i.e. I hard-coded the values.
- You didn't compile it.
- Or you didn't reset the tester to use them. (MT4: tester → Expert Properties → Reset.)
William Roeder #:
- You didn't compile it.
- Or you didn't reset the tester to use them. (MT4: tester → Exspert Propertie → Reset.)
1. I'm pretty sure I compiled it because it's become such a hard habit, but if I didn't, then how come it didn't plunge like a bungee jumper in the previous run, only plunging after I amended the input variables?
2. I'm using MT5 this week, but I checked MT4 and there is no Reset option in Expert Properties.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have this code:
plus some other code that uses the X and Y variables.
I ran it through Strategy Tester and the result was not good.
So I ran it again but this time with optimization and a bunch of values for each variable. Strategy Tester tested all the possible combinations and three of them actually came out positive.
I picked the best pair and amended the code:
Then I ran it without optimization. I just wanted to test the EA with that pair as fixed values.
To my astonishment, the result was disastrous. The profit line plunged and kept going down until it crashed the account.
What in the world?
So I ran the EA again but this time I replaced the variables directly in the code with their respective new values (9 and 15) in the code, ignoring the "input" lines, i.e. I hard-coded the values.
So the result was positive again, the exact same one it had scored in Strategy Tester with optimization.
Does that make sense? Why were the input values applied in the optimized test but apparently ignored in the single run test?