Is this possible.
Thanks for the fast response. I updated my question....trying to clear my express.
I know how to use globalvariableset/get/check, but I'm afraid it's not fit for this situation.
Thanks for the fast response. I updated my question....trying to clear my express.
I know how to use globalvariableset/get/check, but I'm afraid it's not fit for this situation.
Hi,
Is there any way I could keep the change of an extern parameter, WITHOUT changing its source code?
Say, if original value is 10, then if some day I change it to 20 (NOT in source code), 20 will be remembered. And importantly: still give me chance to change it again.---- I just wrote a code, turned out to be permanently nail to 20, LOL.
I'm considering globalvariable, but don't know how.
Hi joshatt,
There's similar question the other day https://www.mql5.com/en/forum/140195, over there Arkenis was using file operation though later he experimented with GV and something else.
:D
Thanks, RaptorUK and onewithzachy.
I finally get it done, in a slightly different way,though.
I reconsidered the logic process, made it much clear, then decided to discard "default value" function ---- I set the extern parameter an impossible value(very small), say 0.001, the logic is: everytime I run this script, if I do NOT change parameter, which is still 0.001, previous value(remembered in GV) will be used; if I change parameter, new value will be used and updated to GV.
You got what I mean? there's no default function anymore, I have to run this code at least once, to let it learn a "default".
BTW, I know GV can be kept 4 weeks there. If I update the value, will it reset the clock?
Thanks, RaptorUK and onewithzachy.
I finally get it done, in a slightly different way,though.
I reconsidered the logic process, made it much clear, then decided to discard "default value" function ---- I set the extern parameter an impossible value(very small), say 0.001, the logic is: everytime I run this script, if I do NOT change parameter, which is still 0.001, previous value(remembered in GV) will be used; if I change parameter, new value will be used and updated to GV.
You got what I mean? there's no default function anymore, I have to run this code at least once, to let it learn a "default".
BTW, I know GV can be kept 4 weeks there. If I update the value, will it reset the clock?
Hi joshatt,
Congrats, but what clock it reset ?, there's nothing change except the GV value we're update and GV latest updated time - which is not accessible by any GV function.
:D
Hi joshatt,
I think the explanation about GV is pretty clear "Global variables are kept in the client terminal within 4 weeks since the last access". When updated, the GV has new life time for the next 4 weeks.
:D
OK. thank you.
Have a good day.
Is there any way I could keep the change of an extern parameter, WITHOUT changing its source code?
Say, if original value is 10, then if some day I change it to 20 (NOT in source code), 20 will be remembered. And importantly: still give me chance to change it again.
I'm considering globalvariable, but don't know how.
- Globalvariable is irrelevant.
- Just right click -> expert properties. Change what you want. The EA will go through a deinit()/init() cycle and will be using the new values.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
Is there any way I could keep the change of an extern parameter, WITHOUT changing its source code?
Say, if original value is 10, then if some day I change it to 20 (NOT in source code), 20 will be remembered. And importantly: still give me chance to change it again.---- I just wrote a code, turned out to be permanently nail to 20, LOL.
I'm considering globalvariable, but don't know how.