I have always struggled with this: can anyone help? I have just placed and order and it closes(for a profit), how do I "timeout" the EA so that it waits one hour to trade. I know I can get the last order close time perhaps and then write something to wait until that time plus an hour? Can anyone show me the code that could do this forme? Thanks..... Dan
- Questions about MQL4
- EA (or script) that monitors for new / modified trades
- EA which will take only one trade at a time ?
forexman05:
I have always struggled with this: can anyone help? I have just placed and order and it closes(for a profit), how do I "timeout" the EA so that it waits one hour to trade. I know I can get the last order close time perhaps and then write something to wait until that time plus an hour? Can anyone show me the code that could do this forme? Thanks..... Dan
I have always struggled with this: can anyone help? I have just placed and order and it closes(for a profit), how do I "timeout" the EA so that it waits one hour to trade. I know I can get the last order close time perhaps and then write something to wait until that time plus an hour? Can anyone show me the code that could do this forme? Thanks..... Dan
forexman05,
First you need to select the last order to get the correct close time.
Then you may use something like this:
datetime closetime = OrderCloseTime();
if(TimeCurrent()<(closetime+3600)) { wait or do something else }
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