Economic calendar event data set as an external integer

Back to topics list To post a new topic, please log in or register
avatar
3
rtf72 2016.08.23 16:15
 

How can I fetch a newly released economic calendar value and set it as an 'extern int'? Is it possible in MQL4? For example, if I needed the latest value of the UK Bank of England Interest Rate, could I fetch the latest figure the second (or near the time) it was released? 


avatar
12983
WHRoeder 2016.08.23 18:43 #
 
rtf72: How can I fetch a newly released economic calendar value and set it as an 'extern int'? could I fetch the latest figure the second (or near the time) it was released?
  1. You can't. If you just store it in the extern variable, it will be lost on a restart.
    EA's must be coded to recover. If the power fails, OS crashes, terminal or chart is accidentally closed, on the next tick, any static/global ticket variables will have been lost. You will have an open order but don't know it, so the EA will never try to close it, trail SL, etc. How are you going to recover? Use a OrderSelect loop to recover, or persistent storage (GV+flush or files) of ticket numbers required.
    Store the value in a GV
  2. You're not going to be able to poll a web server even at a 10 second interval. Forget trying to trade news.
    Back to topics list  

    To add comments, please log in or register