i want my function to send an order and if the order is not successful, the order should be sent repeatedly till it is
i know how to check if the send was successful
how do i tell it to repeat the ordersend?
You could use
do OrderSend() while Ticket<0
but its not recommended because if the sl or tp or any value is wrong it will result the robot to be stuck in an endless loop.
just a check
if(ticket>0) { //Ok } else if(ticket<0) { Print("OrderSend Error!"); }
You could use
but its not recommended.
just a check
You could use
but its not recommended.
just a check
how do i count the order to increment ticket value
do i say?
do ticket=OrderSend(); while (ticket<0)
do { ticket=OrderSend(.......) } while(ticket<0);
But its not recommended it can result in an endless loop and disconnection from the server due to choking requests if your values are not correct.
In stead you can check the return value in most cases it will try to order another time on the next tick if the condition is still valid.
But its not recommended it can result in an endless loop and disconnection from the server due to choking requests if your values are not correct.
In stead you can check the return value in most cases it will try to order another time on the next tick if the condition is still valid.
But its not recommended it can result in an endless loop and disconnection from the server due to choking requests if your values are not correct.
In stead you can check the return value in most cases it will try to order another time on the next tick if the condition is still valid.
ushort try=0; do { ticket=OrderSend(.......) try++; } while(ticket<0 && try<200);
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
i want my function to send an order and if the order is not successful, the order should be sent repeatedly till it is
i know how to check if the send was successful
how do i tell it to repeat the ordersend?