You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Yes and no.
In case of disconnection for example, case in which it'll handle it as soon as reconnected.
Then it remains possible to limit retries, add a sleep etc...
In general using such loop without a sure way to quit is bad practice. Imagine you run your code an a broker where symbol EURUSD doesn't exist, but EURUSD.x
Seems like an mql5 bug ?
Is it an EA, an indicator ?
You can always have a delay for the data to be ready. You can wait the next tick maybe ? Of if you want to have more control a timer. as suggested by WHRoeder/fxsaber you can also request/download the data your self.
All depends of your exact needs.
It's an EA. My goal is get data from all stock options to create a tool that helps me to create options structures.
I don't think a 'for' is a good option. Sometimes the data is never loaded, so I would have to add an timeout, but how long it should be? I need to know if the data is not ready yet not not available all.
Thank you all for the replies.
Yes, I mean... if there's an error retrieving the data ir should return 'false'.
It's an EA. My goal is get data from all stock options to create a tool that helps me to create options structures.
I don't think a 'for' is a good option. Sometimes the data is never loaded, so I would have to add an timeout, but how long it should be? I need to know if the data is not ready yet not not available all.
Thank you all for the replies.
Have you found a solution?
I am always getting 0.0 calling SymbolInfoDouble(DifferentSymbol,SYMBOL_LAST) when symbol is different from chart.
Eg.
I tried reading the documentation https://www.mql5.com/en/docs/series/timeseries_access
Funny thing that even though simetimes I got SymbolInfoDouble(DifferentSymbol,SYMBOL_LASTHIGH), the of SYMBOL_LASTLOW still has 0 value.
Have you found a solution?
I am always getting 0.0 calling SymbolInfoDouble(DifferentSymbol,SYMBOL_LAST) when symbol is different from chart.
Eg.
I tried reading the documentation https://www.mql5.com/en/docs/series/timeseries_access
Funny thing that even though simetimes I got SymbolInfoDouble(DifferentSymbol,SYMBOL_LASTHIGH), the of SYMBOL_LASTLOW still has 0 value.
Risk of endless loop, no ?
Oh, most definitely. It is a lazy snippet after-all, and I'd assume that whoever uses it will know what to do with it to make it safe for work.
Thank you guys. I am researching it. Apparently, it's a history data issue.
You need to make sure the symbol is selected in the market watch. Once it is selected the terminal will update the broker server which will then send back the most recent tick for that symbol. This is why I used a while loop in my example -- so it can pickup the exact moment the tick arrives back from the broker server.