Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Tradestation + ATI + ASM + Change command to move Stop1

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

    Tradestation + ATI + ASM + Change command to move Stop1

    Hi I'm using A Tradestation strategy with the ATI to place an order with an associated ATM strategy. I would then like to move Stop1 and Target1 using the NTCommand ("Change" .....

    value91= NTCommand("PLACE", NTAccount, "Buy", NoContracts, "Market", 0, 0 , "GTC", "", "", NTStrategy, "");

    this command places the order in the correct account with the correct bracket ( the stop and target are named Stop1 and as per the log).

    value98= NTCommand("CHANGE", NTAccount, "Sell", NoContracts, "Stop", 0, 3351 , "GTC", "", "Stop1", NTStrategy, "");

    value99= NTCommand("CHANGE", NTAccount, "Sell", NoContracts, "LIMIT", 0, 3391, "GTC", "", "Target1", NTStrategy, "");

    these two commands produce the error message 'order with ID/Name'Stop1' does not exist and 'order with ID/Name'Target1' does not exist (even though I cansee in the log that orders withthesetwo names have already been created.

    Are the change commands above correct? Is there something else I need todo to change the Stop1 and Target1?

    Please advise.

    Thanks


    Kevin.
    Last edited by strad739; 08-15-2008, 09:44 AM.

    #2
    On the first PLACE, you have to pass in a unique user defined strategy id, then you must also pass this into the CHANGE call, then NT can map "STOP1" to the correct ATM strategy instance.
    RayNinjaTrader Customer Service

    Comment


      #3
      Hi Ray, I can change the STOP1 (State=Accepted) but not the TARGET1 (State=Working).

      This is how I place the order;

      once value91= NTCommand("PLACE", "PRELIVE2", "Buy", 1, "Market", 0, 0 , "GTC", "", Myorderid, "BOLL", MyStrategyID);

      This change works (when I change a switch in Excel)
      if MASTER_SWITCH_ON then once value98= NTCommand("CHANGE", "", "", NoContracts, "", 0, 3370 , "GTC", "", "STOP1", "BOLL", MyStrategyID);

      This change doesn't work (Note the Target1 order has a state of "Working")
      if MASTER_SWITCH_ON then once value99= NTCommand("CHANGE", "", "", NoContracts, "", 0, 3390 , "GTC", "", "TARGET1", "BOLL", MyStrategyID);

      The log updates as below;

      Date,Category,Message,
      18/08/2008 15:15:46,Order,Order='59493d469c84434fadaadc03f7d7 66d5/PRELIVE2' Name='Target1' New State=Cancelled Instrument='FESX 09-08' Action=Sell Limit price=3405 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
      18/08/2008 15:15:45,Strategy,Cancelling any remaining strategy orders,
      18/08/2008 15:15:45,Position,Instrument='FESX 09-08' Account='PRELIVE2' Avg price=3370 Quantity=0 Market position=Long Operation=Remove Currency=Unknown,
      18/08/2008 15:15:45,Execution,Execution='fe3c3f11d6b549bfab4f 281aae3d0d64' Instrument='FESX 09-08' Account='PRELIVE2' Exchange=Default Price=3370 Quantity=1 Market position=Short Operation=Insert Order='240346764f2546e0a8719e60cf5fdc04' Time='18/08/2008 15:15:45',
      18/08/2008 15:15:45,Order,Order='59493d469c84434fadaadc03f7d7 66d5/PRELIVE2' Name='Target1' New State=PendingCancel Instrument='FESX 09-08' Action=Sell Limit price=3405 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
      18/08/2008 15:15:45,Order,Order='240346764f2546e0a8719e60cf5f dc04/PRELIVE2' Name='Stop1' New State=Filled Instrument='FESX 09-08' Action=Sell Limit price=0 Stop price=3370 Quantity=1 Type=Stop Filled=1 Fill price=3370 Error=NoError Native error='',
      18/08/2008 15:15:45,Order,Order='240346764f2546e0a8719e60cf5f dc04/PRELIVE2' Name='Stop1' New State=Working Instrument='FESX 09-08' Action=Sell Limit price=0 Stop price=3370 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error='',
      18/08/2008 15:14:52,Order,Order='240346764f2546e0a8719e60cf5f dc04/PRELIVE2' Name='Stop1' New State=Accepted Instrument='FESX 09-08' Action=Sell Limit price=0 Stop price=3370 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error='',
      18/08/2008 15:14:51,ATI,AT, 'CHANGE;;@FESX;;1;;0;3390;GTC;;TARGET1;BOLL;SX1261 339' processing ,
      18/08/2008 15:14:51,Order,Order='240346764f2546e0a8719e60cf5f dc04/PRELIVE2' Name='Stop1' New State=PendingChange Instrument='FESX 09-08' Action=Sell Limit price=0 Stop price=3370 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error='',
      18/08/2008 15:14:51,ATI,AT, 'CHANGE;;@FESX;;1;;0;3370;GTC;;STOP1;BOLL;SX126133 9' processing ,
      18/08/2008 15:13:29,Order,Order='59493d469c84434fadaadc03f7d7 66d5/PRELIVE2' Name='Target1' New State=Working Instrument='FESX 09-08' Action=Sell Limit price=3405 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
      18/08/2008 15:13:29,Order,Order='59493d469c84434fadaadc03f7d7 66d5/PRELIVE2' Name='Target1' New State=Accepted Instrument='FESX 09-08' Action=Sell Limit price=3405 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
      18/08/2008 15:13:29,Order,Order='240346764f2546e0a8719e60cf5f dc04/PRELIVE2' Name='Stop1' New State=Accepted Instrument='FESX 09-08' Action=Sell Limit price=0 Stop price=3360 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error='',
      18/08/2008 15:13:29,Order,Order='59493d469c84434fadaadc03f7d7 66d5/PRELIVE2' Name='Target1' New State=PendingSubmit Instrument='FESX 09-08' Action=Sell Limit price=3405 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
      18/08/2008 15:13:29,Order,Order='240346764f2546e0a8719e60cf5f dc04/PRELIVE2' Name='Stop1' New State=PendingSubmit Instrument='FESX 09-08' Action=Sell Limit price=0 Stop price=3360 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=NoError Native error='',
      18/08/2008 15:13:29,Position,Instrument='FESX 09-08' Account='PRELIVE2' Avg price=3375 Quantity=1 Market position=Long Operation=Insert Currency=Unknown,
      18/08/2008 15:13:29,Execution,Execution='adeb0db6e5184bfd84c6 e59352727a91' Instrument='FESX 09-08' Account='PRELIVE2' Exchange=Default Price=3375 Quantity=1 Market position=Long Operation=Insert Order='6072514a8423448fa6acb6086f60d777' Time='18/08/2008 15:13:28',
      18/08/2008 15:13:29,Order,Order='6072514a8423448fa6acb6086f60 d777/PRELIVE2' Name='Entry' New State=Filled Instrument='FESX 09-08' Action=Buy Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=1 Fill price=3375 Error=NoError Native error='',
      18/08/2008 15:13:28,Order,Order='6072514a8423448fa6acb6086f60 d777/PRELIVE2' Name='Entry' New State=Working Instrument='FESX 09-08' Action=Buy Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error='',
      18/08/2008 15:13:28,Order,Order='6072514a8423448fa6acb6086f60 d777/PRELIVE2' Name='Entry' New State=Accepted Instrument='FESX 09-08' Action=Buy Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error='',
      18/08/2008 15:13:27,Order,Order='6072514a8423448fa6acb6086f60 d777/PRELIVE2' Name='Entry' New State=PendingSubmit Instrument='FESX 09-08' Action=Buy Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error='',
      18/08/2008 15:13:27,Order,Submitting order with strategy,
      Last edited by strad739; 08-18-2008, 08:22 AM. Reason: update with progress

      Comment


        #4
        Looks to me like you are sending sending the limit price for the target change as zero and and sending the price as in the stop price field. Please make sure you send it in the prior field.
        RayNinjaTrader Customer Service

        Comment


          #5
          YabaDabaDoo!!!!!

          Thanks Ray that worked!

          Kevin.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by jaybedreamin, Today, 05:56 PM
          0 responses
          3 views
          0 likes
          Last Post jaybedreamin  
          Started by DJ888, 04-16-2024, 06:09 PM
          6 responses
          18 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Jon17, Today, 04:33 PM
          0 responses
          1 view
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          9 views
          0 likes
          Last Post Javierw.ok  
          Started by timmbbo, Today, 08:59 AM
          2 responses
          10 views
          0 likes
          Last Post bltdavid  
          Working...
          X