bondstrader: whenever I close a trade manually, the EA does not record the OrderCloseTime().
| Your EA is broken; fix your EA. We can't see your code; there are no mindreaders here. |
Im logging trade times using OrderOpenTime() and OrderCloseTime(), which helps me keep track of my trades. However, at times, I need to manually close a trade that has been opened by my EA. But whenever I close a trade manually, the EA does not record the OrderCloseTime().
How can i get my EA to recognize my manual action, and print the OrderCloseTime() for such trades?
Thanks.
Im logging trade times using OrderOpenTime() and OrderCloseTime(), which helps me keep track of my trades. However, at times, I need to manually close a trade that has been opened by my EA. But whenever I close a trade manually, the EA does not record the OrderCloseTime().
How can i get my EA to recognize my manual action, and print the OrderCloseTime() for such trades?
Thanks.
As the EA opens trades, store the ticket numbers in an array
Loop through the array and check whether the order has been closed
If so, log the OrderOpenTime() and OrderCloseTime() and remove the order from the array
As the EA opens trades, store the ticket numbers in an array
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/file) of ticket numbers required.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Im logging trade times using OrderOpenTime() and OrderCloseTime(), which helps me keep track of my trades. However, at times, I need to manually close a trade that has been opened by my EA. But whenever I close a trade manually, the EA does not record the OrderCloseTime().
How can i get my EA to recognize my manual action, and print the OrderCloseTime() for such trades?
Thanks.