Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Changing Order

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Changing Order

    tPos = MarketPosition(NJSymb, "Sim101")
    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

    #2
    Hi Dox,

    No, changing two orders requires two lines.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thank you very much!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by George21, Today, 10:07 AM
      0 responses
      5 views
      0 likes
      Last Post George21  
      Started by Stanfillirenfro, Today, 07:23 AM
      8 responses
      23 views
      0 likes
      Last Post Stanfillirenfro  
      Started by DayTradingDEMON, Today, 09:28 AM
      2 responses
      16 views
      0 likes
      Last Post DayTradingDEMON  
      Started by navyguy06, Today, 09:28 AM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by cmtjoancolmenero, Yesterday, 03:58 PM
      8 responses
      32 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X