It is really a big surprising for me to see the strange result

 

I have made an EA with a function to move "stop loss", I set two parameters for this function"extern int Move_Stop_Small=5,Move_Stop_Big=10;", when I test it many times and modified these two parameters many times, once I set "extern int Move_Stop_Small=10,Move_Stop_Big=20;". what is surprising is that now I set these two parameters whatever values,such as "extern int Move_Stop_Small=5,Move_Stop_Big=10;",extern int Move_Stop_Small=10,Move_Stop_Big=30;”, and so on; when I print these two parameters, always show"Move_Stop_Small is 10, Move_Stop_Big is 20". I don't know why?

now I delete all other codes except very few codes as below: when I copy this codes to another EA which I create newly, it run well; but always wrong in the EA which I modified. why?

extern int Move_Stop_Small=5,Move_Stop_Big=10;

int init()
  {
   return(0);
  }


int deinit()
  {
   return(0);
  }

int start()
{
  Print("move stop:",Move_Stop_Small,Move_Stop_Big);
  return(0);
}
 
vx0532: now I delete all other codes except very few codes as below: when I copy this codes to another EA which I create newly, it run well; but always wrong in the EA which I modified. why?
The answer is within the EA which you modified. Have fun de-bugging ... its good for the soul :)
 
ubzen:
The answer is within the EA which you modified. Have fun de-bugging ... its good for the soul :)


I suspect somethings wrong in my MT4 platform; so few codes can't shelter any bug I think.

above code never show value "20", but these few codes run and get the result Move_Stop_Big is 20, so strange.

 
vx0532: I suspect somethings wrong in my MT4 platform; so few codes can't shelter any bug I think. above code never show value "20", but these few codes run and get the result Move_Stop_Big is 20, so strange.
Ok... I taught you said the above codes work. But does-not work within the Original-EA. I'll test. In the main-time, how are you testing this? If you're changing the parameters within the codes and then running within the strategy-tester ... this will always be the original values unless you hit the reset_button where you enter the extern.
 
ubzen:
Ok... I taught you said the above codes work. But does-not work within the Original-EA. I'll test. In the main-time, how are you testing this? If you're changing the parameters within the codes and then running within the strategy-tester ... this will always be the original values unless you hit the reset_button where you enter the extern.


Thank you ubzen.

yes just as you said, I it" within the strategy-tester ... ".

I believe what you said is correct, but maybe not all.

Just now I copied fold "expert" from the MT4 and uninstall the MT4, then I re-install MT4 and copied the fold "expert" into the new MT4.

then I run previous EA, all is Ok.

I change these two parameters again and compile(not hit reset_button), then run the EA, these two parameters have changed from before.

For my last MT4, I think the parameters' value, 10 and 20, must have been remembered in somewhere.

 
yip, be careful that the tester is not loading the automatically saves set file lastparemeters in the tester folder.
 
vx0532: yes just as you said, I it" within the strategy-tester ... ".
The first time you run in the tester Expert properties is set from the EA externals. After that changing the externals and recompiling does nothing. Expert properties -> Reset if you want to update properties.
 
WHRoeder:
The first time you run in the tester Expert properties is set from the EA externals. After that changing the externals and recompiling does nothing. Expert properties -> Reset if you want to update properties.


thank you
 
WHRoeder:
The first time you run in the tester Expert properties is set from the EA externals. After that changing the externals and recompiling does nothing. Expert properties -> Reset if you want to update properties.


I have test again.

when I write an indicator which with some "extern" variables and then write an EA which call this indicator by iCustom(Null,0,"Indicator",n1,n2,n3,0,0), after that I test it by tester.

most time when I changed n1,n2 and n3's values, and recompiling then I test it in tester, I find n1,n2,and n3's new values have been transfered to this indicator.

but I never reset anything. so maybe

Reason: