help with break out of while statement

 

sometimes my trades don't always go through , so I run it in a while loop , but if I get error 134 (no enough money , it must break out the while loop , cant seem to get it right , can someone help me please.

 
buju:

sometimes my trades don't always go through , so I run it in a while loop , but if I get error 134 (no enough money , it must break out the while loop , cant seem to get it right , can someone help me please.

<CODE REMOVED>

Please edit your post . . .    please use the   SRC   button to post code: How to use the   SRC   button.
 
buju:

sometimes my trades don't always go through , so I run it in a while loop , but if I get error 134 (no enough money , it must break out the while loop , cant seem to get it right , can someone help me please.

Test the return value from your OrderSend() and find out why it failed . . .  :   What are Function return values ? How do I use them ?

Don't call GetLastError() unless there is actually an error,  otherwise you may be seeing an error from a different part of your code.

Reason: