GumRai:
You could check that the history total >0, otherwise return.
Thank you, Could you show me an example please?
You could check that the history total >0, otherwise return.
int cnt = OrdersHistoryTotal(); if(cnt<1) return; for (int i=0; i < cnt; i++) {If the history has not loaded, it will then return and wait for the next tick without doing anything
gangsta1: Any ideas how I can code my EA to check the last trades result even when the terminal is restarted? |
Are you doing it in init? wait for a tick. |

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
Hi,
My EA always needs to check the last close trade but whenever mt4 is closed and restarted it does not read the last trade. Any ideas how I can code my EA to check the last trades result even when the terminal is restarted?