• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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, 08: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, 07: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 mestril, Today, 06:00 AM
          0 responses
          3 views
          0 likes
          Last Post mestril
          by mestril
           
          Started by Goolden, Today, 05:47 AM
          0 responses
          4 views
          0 likes
          Last Post Goolden
          by Goolden
           
          Started by kujista, Today, 12:59 AM
          0 responses
          6 views
          0 likes
          Last Post kujista
          by kujista
           
          Started by Gerik, Today, 12:14 AM
          0 responses
          5 views
          0 likes
          Last Post Gerik
          by Gerik
           
          Started by Bionian, Yesterday, 11:47 PM
          0 responses
          6 views
          0 likes
          Last Post Bionian
          by Bionian
           
          Working...
          X