425425425
03-13-2011, 03:56 PM
Hey guys, my VBA skills are very, very limited and i have this infinite loop in my codes right now:
If Sheets("Open Orders").Cells(1, 2) = "" Then
' The following loop submits the Buy section of bracket
Status = False
Do While Status = False
Status = api.AddOrder("ALGO", Range("Shares"), Range("MidMarket") - Range("Spread"), api.BUY, api.LMT)
Loop
At the moment I have to ctrl + break to unfreeze excel everytime i run the function, is there a quick and easy way to fix this?
The RIT software returns a string called “TRUE” or “FALSE” when I submit a trade request. If the
order is successful, it returns “TRUE”, otherwise it returns “FALSE”. By setting the “Status” variable as
false, and then running the addorder command, you can track when it properly submits the order. The
program doesn’t exit the loop (and keeps trying to submit the order) until it is successful.
a million thank-you's ..
If Sheets("Open Orders").Cells(1, 2) = "" Then
' The following loop submits the Buy section of bracket
Status = False
Do While Status = False
Status = api.AddOrder("ALGO", Range("Shares"), Range("MidMarket") - Range("Spread"), api.BUY, api.LMT)
Loop
At the moment I have to ctrl + break to unfreeze excel everytime i run the function, is there a quick and easy way to fix this?
The RIT software returns a string called “TRUE” or “FALSE” when I submit a trade request. If the
order is successful, it returns “TRUE”, otherwise it returns “FALSE”. By setting the “Status” variable as
false, and then running the addorder command, you can track when it properly submits the order. The
program doesn’t exit the loop (and keeps trying to submit the order) until it is successful.
a million thank-you's ..