My new EA works... but breaks down :(

 

Hi. I have been coding and testing my first EA. This is a completely automated trading system. The good news is: it works! The bad news is...

I started it last night, and eagerly jumped out of bed this morning, hoping to find millions of dollars in my account. Just kidding, it's just a demo account, for now. But I discovered that my PC rebooted during the night due to a Windows update.

So obviously I have turned off Windows update. And at some point I will put a UPS on my PC and my cable modem etc to make sure it all stays up.

Then I ran it during the day today. It opened a trade, and it was watching & waiting for it to close (or to see the right conditions to manually close it). But suddenly it quit. I am thinking maybe it lost connection to the FX server?

My "Experts" log window says:

10:38:01 autotrade1 EURUSD,H4: deinitialized
10:38:01 autotrade1 EURUSD,H4: unint reason 6

and my "Journal" log window shows:

10:37:59 850044492': login
10:30:00 850044492': login

So I guess my questions are...

  1. What happened? Did it lose connection to the server?
  2. Is this common? Is it likely to happen while trading against the Live server?
  3. Is there any special magic to avoid it? Or to recover from it?

Thank you.

 
leecallen:

Hi. I have been coding and testing my first EA. This is a completely automated trading system. The good news is: it works! The bad news is...

I started it last night, and eagerly jumped out of bed this morning, hoping to find millions of dollars in my account. Just kidding, it's just a demo account, for now. But I discovered that my PC rebooted during the night due to a Windows update.

So obviously I have turned off Windows update. And at some point I will put a UPS on my PC and my cable modem etc to make sure it all stays up.

Then I ran it during the day today. It opened a trade, and it was watching & waiting for it to close (or to see the right conditions to manually close it). But suddenly it quit. I am thinking maybe it lost connection to the FX server?

My "Experts" log window says:

10:38:01 autotrade1 EURUSD,H4: deinitialized
10:38:01 autotrade1 EURUSD,H4: unint reason 6

and my "Journal" log window shows:

10:37:59 850044492': login
10:30:00 850044492': login

So I guess my questions are...

  1. What happened? Did it lose connection to the server?
  2. Is this common? Is it likely to happen while trading against the Live server?
  3. Is there any special magic to avoid it? Or to recover from it?

Thank you.

Reason 6 is another account was activated from the same Plattform.
 
leecallen:

My "Experts" log window says:

10:38:01 autotrade1 EURUSD,H4: deinitialized
10:38:01 autotrade1 EURUSD,H4: unint reason 6


This link shows the initialize thing

https://docs.mql4.com/constants/uninit

 
dabbler:

This link shows the initialize thing

https://docs.mql4.com/constants/uninit



fraab, dabbler, thank you. I don't immediately see how that could happen but it is possible.

Reason: