Cause EA to not trade if terminal is reopened?

Back to topics list  | 1 2 To post a new topic, please log in or register
avatar
Moderator
3418
GumRai 2016.03.28 07:01 #
 

I tested it and you're correct, it doesn't work.

Maybe you could put a message box in OnInit to confirm that you want to use the existing settings. This would, of course, pop up any time that you change timeframes as well.

avatar
26
bunnycat 2016.03.28 07:11 #
 

That sounds like a good idea.  How would you do it, I am only familiar with comments and alerts.  What did you have in mind?  One of those?  

 

Thanks for all the help!!  I wonder why that thing doesn't work.  Would the DEVS be interested in a heads up so they can fix it?  I don't know how it would actually work, cause it seems like terminating the program just happens and stops the REASON_CLOSE reason from ever being useful. 

avatar
Moderator
3418
GumRai 2016.03.28 07:23 #
 
I have notified the Service desk about this as I feel that it should work. As you say REASON_CLOSE seems useless.
avatar
Moderator
3418
GumRai 2016.03.28 07:26 #
 

Look up MessageBox in the reference

I haven't used it for a while, I believe that you need

#include <stdlib.mqh>

for it to work

avatar
26
bunnycat 2016.03.28 07:27 #
 

Awesome, thanks so much!!!

=) =) =) 

avatar
Moderator
3418
GumRai 2016.03.28 11:08 #
 

I got a reply from the service desk.

It seems that ExpertRemove() does not permanently remove the EA from the chart. It only removes it for the session. When the terminal is closed down and restarted, the EA will be loaded again.

avatar
26
bunnycat 2016.03.28 21:16 #
 

Ah hah, thanks!  I've implemented your message box idea.  Perfect.  Maybe I'll streamline it a bit by causing it to only show for specific DeInIt reasons.  

 

Thanks again!!! =) 

avatar
13001
WHRoeder 2016.03.28 21:28 #
 
Create a Global Variables of the Terminal - MQL4 Reference in deinit on terminal close and check for it in init.



avatar
26
bunnycat 2016.03.28 21:32 #
 

Thanks!!!

avatar
26
bunnycat 2016.03.28 22:06 #
 

So I did that, and instead of using it to pop the message box, I just run ExpertRemove(); in OnInit if the global variable returns true.


Works great, thanks guys!!  I get by with a little help from my friends...  

Back to topics list   | 1 2  

To add comments, please log in or register