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
Well i always first make a shadow copy of the entire thing so then i can work with it outside of the actual orderselect loop.
I can not tell what you are trying to do from that code but i guess the loops allow for errors.
I am trying to restore any pending order that gets deleted while the EA is working using the ticket of the order
If for example I have 10 orders and 1 gets deleted, the EA will loop through history, if it finds a ticket that is in its array, it will restore that order and set that ticket to 0, so that it doesn't use the ticket a second time
Okay but you can not influence the ticket as it is a response from the server and will never be the same number.
To find if the order has been closed it's OrderCloseTime() has to be analyzed.
If the value !=0 the order was closed and you can reopen it and set the ticket position (and time) to zero to make sure it will not be found again.
Note that as soon as you update the orderselect loop the old and the new ticket will again be loaded from history.
I do not understand why you want to reopen a closed position make sure it does not result in a cascade event where your robot starts to open and close orders until the account blows.
Okay but you can not influence the ticket as it is a response from the server and will never be the same number.
To find if the order has been closed it's OrderCloseTime() has to be analyzed.
If the value !=0 the order was closed and you can reopen it and set the ticket position (and time) to zero to make sure it will not be found again.
Note that as soon as you update the orderselect loop the old and the new ticket will again be loaded from history.
I do not understand why you want to reopen a closed position make sure it does not result in a cascade event where your robot starts to open and close orders until the account blows.
Ok, it won't, I will be disabling it manually when I can't monitor
Well if that ever happens it will take mere microseconds and you will never be fast enough to hit the disable button.
Then the only hope that will be left, is that all those trades turn out to be profitable.
Well if that ever happens it will take mere microseconds and you will never be fast enough to hit the disable button.
Then the only hope that will be left, is that all those trades turn out to be profitable.
i have gotten what i want, but now my only problem is array out of range error, is there a way for me to repopulate array every time an order is restored
meaning that when a buy limit or sell limit is placed, how can i make the array loop and gather its values again
i have gotten what i want, but now my only problem is array out of range error, is there a way for me to repopulate array every time an order is restored
meaning that when a buy limit or sell limit is placed, how can i make the array loop and gather its values again
It means you have to also increase size dynamically.
It means you have to also increase size dynamically.