Silly question. Please don't laugh at me...
-
I know it will sound weird, but I promise I need it. I would like to activate/deactivate the 'Autotrading' at the top menu of the MT4 platform. I'm designing an EA that should terminate after its target is reached but I don't want to use the block 'Terminate' because then I must run it again and I have to insert more than 20 manual variables (no kidding) :).
It would be much easier if the EA is not terminated (so the variables are still active) but it cannot operate because the 'Autotrading' button is not on.
Any hint?

-
What if after you load the EA with all of your manual variables you save the .set file?
I haven't used the terminate block, but when I remove my EA and then add it to the chart again I load the .set file I have saved so that I don't have to re-input my variables. With my current EA it's only 8 (my SR levels) but it saves time in having to input them again.
-
Interesting. Where can I find that file?
-
When you drag the EA onto your chart, go to the inputs tab where you input your variables. Bottom right of mine there's a 'load' and a 'save' button.
Click on the 'save' button and you can save your settings as a .set file. When you load the EA again or on another chart you click on the 'load' button and you can use a previously saved .set file.
I have one for each pair I'm trading as it has my SR lines saved.
-
@sydneyfox I think you are talking about the constant inputs, and not precisely variables.
I have solved this variable problem with global (terminal) variables (create corresponding global variable for each fxdreema variable and keep them in sync), but that is not very elegant a solution

For your specific situation, I would just create a boolean variable terminated, set it to true when you want the virtual termination, and put this condition before everything else: terminated == false
-
I don't remember for a MQL function that can "hit" on that button. But what you can try is to start with "Pass" block on the top and then use "Turn OFF blocks" and "Turn ON blocks" to toggle it. If you are using these blocks, better give the target block (that "Pass" block) some short word instead of its number.
-
Many interesting ideas to explore. Thank you all for them. I'll try them ;).