Could anyone help me here.....I have an EA on the 4hr timeframe. I have built in a globalvariable so once I set my orders and they are finally closed, no more orders can be placed. What I would like to do is to modify my code so that it waits one bar (four hours) and then deletes the global variable which is preventing further orders from being placed. I can only figure it has to do with orderopentime and currenttime. Any help would be greatly appreciated!! thanks........
- disallowing trade after orders are opened
- Searching for a missing order!
- My EA only seems to place buy orders. I need a helping hand so it can place both buy and sell orders!
forexman05:
Could anyone help me here.....I have an EA on the 4hr timeframe. I have built in a globalvariable so once I set my orders and they are finally closed, no more orders can be placed. What I would like to do is to modify my code so that it waits one bar (four hours) and then deletes the global variable which is preventing further orders from being placed. I can only figure it has to do with orderopentime and currenttime. Any help would be greatly appreciated!! thanks........
Could anyone help me here.....I have an EA on the 4hr timeframe. I have built in a globalvariable so once I set my orders and they are finally closed, no more orders can be placed. What I would like to do is to modify my code so that it waits one bar (four hours) and then deletes the global variable which is preventing further orders from being placed. I can only figure it has to do with orderopentime and currenttime. Any help would be greatly appreciated!! thanks........
Option 1: Sleep(14400000)
Option 2: Get current time, add four hours, and check for new time to arrive
cloudbreaker wrote >>
Option 1: Sleep(14400000)
Option 2: Get current time, add four hours, and check for new time to arrive
Sleep....never had any success with that-not for that long. Current time...would I set something in the nested portion where the order send function is located to get currenttime and set it to some arbitrary variable like "CT" or something, then later look for currentime to be greater than "CT" + 4hrs? Just not sure on the logistics of what it would look like. Thank you for the ideas! Dan

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