AddQty = tPos
Act = "BUY"
LngAdd = command("PLACE", "Sim101", NJSymb, Act, AddQty, "MARKET", 0, 0, "", "", OrIDNow, "", StIDNow)
tPos = MarketPosition(NJSymb, "Sim101")
pXitQty = (tPos + AddQty)
ChngXit = command("CHANGE", "Sim101", NJSymb, "SELL", pXitQty, "LIMIT", pXit2, 0, "", "", "Target2", "", StIDNow)
ChngStp = command("CHANGE", "Sim101", NJSymb, "SELL", pXitQty, "STOPLIMIT", 0, pStp2, "", "", "Stop2", "", StIDNow)
' REM ChngXit = command("CHANGE", "Sim101", NJSymb, "SELL", pXitQty, "LIMIT", pXit2, pStp2, "", "", "", "", StIDNow)
TrdSel = 0
Exit Function
End Select
Reference the above . . .
Why is it required to send two change orders as shown above (works fine) in order to accomplish the task of changing the limit side (profit) and stop side (loss) of a strategy? The command function holds a place for both values. It would seem that it would be possible to accomplish this in a single command, but the requirement to send "Target2" or "Stop2" seems to require two changes. IS THIS CORRECT? . . . or does someone know how to do this in one command. The commented ('REM) line above does not work and gives error:
OIF, ' is missing order ID/Name parameter.
When I add the original Order Name it gives error:
OIF, ' invalid order ID/Name 'ES 03-11.T2S1.2'
Simple question . . . and simple answer desired . . . either:
Yes . . . do this . . . or No . . . two lines of code required.
Best,
Dox
Comment