EA "off quotes" Error

Franzel Botha
949
Franzel Botha  

Hi. I have this EA mend a Family member have been working on for a while now.
It works great but once in a while I get an error "order failed [Off quotes]
We have been trying to fix it with no luck.
Can someone please assist to sort out this small issue.
I have added the EA in mq4 script if anyone can assist with the small error.

Regards Franzel


1

Files:
nicholish en
2764
nicholish en  
Franzel Botha:

Hi. I have this EA mend a Family member have been working on for a while now.
It works great but once in a while I get an error "order failed [Off quotes]
We have been trying to fix it with no luck.
Can someone please assist to sort out this small issue.
I have added the EA in mq4 script if anyone can assist with the small error.

Regards Franzel



You cannot perform any trade logic from OnInit.

William Roeder
25331
William Roeder  
Don't try to use any price or server related functions in OnInit (or on load,) as there may be no connection/chart yet:
  1. Terminal starts.
  2. Indicators/EAs are loaded. Static and globally declared variables are initialized. (Do not depend on a specific order.)
  3. OnInit is called.
  4. For indicators OnCalculate is called with any existing history.
  5. Human may have to enter password, connection to server begins.
  6. New history is received, OnCalculate called again.
  7. New tick is received, OnCalculate/OnTick is called. Now TickValue, TimeCurrent and prices are valid.