Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Tradestation - NT order sizes and sides incorrect

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

    Tradestation - NT order sizes and sides incorrect

    Hi -- I've been testing sending strategy signals to NT from Tradestaion using the email automation. I have a working connection from Tradestation SIM to a NT demo account (with realtime data). I am able to send signals and have them received and executed on the demo account in NT.

    However, the order size is incorrect and I can't figure out why. I am trading one contract of NQ in Tradestation. In Ninjatrader, two contracts are being traded.

    Additionally, when a long+short strategy in Tradestation reverses, say from long to short, the new side is reflected in tradestation but does not appear to be executed in NT.

    What kinds of settings can I look for, or what am I missing?

    Thank you.

    Click image for larger version

Name:	image.png
Views:	240
Size:	213.1 KB
ID:	1311784Click image for larger version

Name:	image.png
Views:	184
Size:	543.5 KB
ID:	1311785

    #2
    To add to this -- it appears that that it could be related to reversals because some TS strategies work correctly while other do not. Any insights would be helpful as I troubleshoot. Is there anything on the TS code side that needs to be accounted for on the NT side?

    Comment


      #3
      Hello asd32,

      What messages are being received on the Log tab of the Control Center?
      Is this showing multiple messages for the same order or one message with an order that has a quantity of 2?

      What version of TradeStation are you using? May I confirm this is a supported 9.X version and not a later version?


      When reversing a new order is being submitted, is this correct?
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        What version of TradeStation are you using? May I confirm this is a supported 9.X version and not a later version?
        I am not using a 9x version of tradestation. I am using the latest version of Tradestation. I don't think NT should be integrating with a legacy version of TS, but that's just my opinion.

        Order sync between TS and NT is really quite far off. I have a strategy that uses orders to reverse around key prices until a direction is found. It's trading fine in TS but not correctly at all in NT. The order quantities are wrong, as mentioned, often doubled. The reversal process doesn't work at all -- I'm looking right now at what should be an open short of 2 contracts, and instead NT has simply closed the prior long and never taken the reversal short.

        In the last case, what seems to be happening is that newly initiated longs, which in TS reverse to shorts, are never reversed in NT. They are just exited.

        Click image for larger version

Name:	image.png
Views:	157
Size:	214.8 KB
ID:	1313822

        Comment


          #5
          --deleted----
          Last edited by asd32; 08-15-2024, 10:41 AM.

          Comment


            #6
            Ok. I am now testing with a v. 9x of Tradestation to match the version used in NT docs. The problems originally described do occur still:
            1. Contract quantities are doubled. Tradestation strat trades 1 share, either long or short. NT is doubling the order size.
            2. Reverals from long/short or short/long don't work. It will go from long to closed, or from short to closed, but never correclty back to the opposite side as in the TS strat.
            • I have tested 2 different Tradedtation strats, and both exhibit the contract quantity issue and reversal issue.
            • I tested a MANUAL order entry directly from an NT chart and the order quantity is correct in Rithmic. So it appears the issue is the communication between Tradestation and NT
            What might be happening here?

            The TS entry/reversal code:

            v1:
            if Up then Buy("Buy") next bar at market ;
            if Dn then Sell short("Short") next bar at market ;

            if Marketposition = 1 and DN then Sell short("Sht2") next bar at market ;
            if Marketposition = -1 and UP then Buy("Buy2") next bar at market ;


            --------------

            v2, same errors
            if Up then Buy("Buy") next bar at market ;
            if Dn then Sell short("Short") next bar at market ;

            if Marketposition = 1 and DN then sell ("Sht2") next bar at market ;
            if Marketposition = -1 and UP then buytocover ("Buy2") next bar at market ;


            ----------
            Below is the log file for one instance of a long that is doubled and then not reversed to short.
            Time Category Message
            8/15/2024 14:15 Execution Execution='1612603|212419912|212419912' Instrument='MNQ SEP24' Account='S1Aug1560xxxxx' Exchange=Globex Price=19574.25 Quantity=1 Market position=Short Operation=Operation_Add Order='212419912' Time='8/15/2024 2:15 PM'
            8/15/2024 14:15 Order Order='212419912/S1Aug1560xxxxx' Name='' New state='Filled' Instrument='MNQ SEP24' Action='Sell' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=DAY Oco='' Filled=1 Fill price=19574.25 Error='No error' Native error=''
            8/15/2024 14:15 Order Order='212419912/S1Aug1560xxxxx' Name='' New state='Working' Instrument='MNQ SEP24' Action='Sell' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
            8/15/2024 14:15 Order Order='212419912/S1Aug1560xxxxx' Name='' New state='Accepted' Instrument='MNQ SEP24' Action='Sell' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
            8/15/2024 14:15 Position Instrument='MNQ SEP24' Account='S1Aug1560xxxxx' Average price=19578.25 Quantity=1 Market position=Flat Operation=Remove
            8/15/2024 14:15 Order Order='212419908/S1Aug1560xxxxx' Name='' New state='Filled' Instrument='MNQ SEP24' Action='Sell' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=DAY Oco='' Filled=1 Fill price=19574.25 Error='No error' Native error=''
            8/15/2024 14:15 Execution Execution='1607985|212419908|212419908' Instrument='MNQ SEP24' Account='S1Aug1560xxxxx' Exchange=Globex Price=19574.25 Quantity=1 Market position=Short Operation=Operation_Add Order='212419908' Time='8/15/2024 2:15 PM'
            8/15/2024 14:15 Position Instrument='MNQ SEP24' Account='S1Aug1560xxxxx' Average price=19578.25 Quantity=1 Market position=Long Operation=Update
            8/15/2024 14:15 Order Order='4168e1eb2d39431bb31e01db19c0f452/S1Aug1560xxxxx' Name='' New state='Submitted' Instrument='MNQ SEP24' Action='Sell' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
            8/15/2024 14:15 Order Order='212419908/S1Aug1560xxxxx' Name='' New state='Working' Instrument='MNQ SEP24' Action='Sell' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
            8/15/2024 14:15 Order Order='212419908/S1Aug1560xxxxx' Name='' New state='Accepted' Instrument='MNQ SEP24' Action='Sell' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
            8/15/2024 14:15 Order Order='342f16009c584d8399795de63572c315/S1Aug1560xxxxx' Name='' New state='Submitted' Instrument='MNQ SEP24' Action='Sell' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
            8/15/2024 14:15 ATI TradeStation - Strategy Filled Order for @MNQ: Sell 1 @MNQ @ Mar****n account(s) 'S1Aug1560xxxxx'
            8/15/2024 14:15 ATI TradeStation - Strategy Filled Order for @MNQ: Sell 1 @MNQ @ Mar****n account(s) 'S1Aug1560xxxxx'
            8/15/2024 14:15 ATI Order handling option is set to only submit market order on TS order fill notification - email ignored:TradeStation - Strategy Active Order for @MNQ: Sell 1 @MNQ @ Mar****n account(s) 'S1Aug1560xxxxx'
            reverse to short 8/15/2024 14:15 ATI Order handling option is set to only submit market order on TS order fill notification - email ignored:TradeStation - Strategy Active Order for @MNQ: Sell 1 @MNQ @ Mar****n account(s) 'S1Aug1560xxxxx'
            8/15/2024 14:13 Order Order='212419310/S1Aug1560xxxxx' Name='' New state='Filled' Instrument='MNQ SEP24' Action='Buy' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=DAY Oco='' Filled=1 Fill price=19578.25 Error='No error' Native error=''
            8/15/2024 14:13 Execution Execution='1612421|212419310|212419310' Instrument='MNQ SEP24' Account='S1Aug1560xxxxx' Exchange=Globex Price=19578.25 Quantity=1 Market position=Long Operation=Operation_Add Order='212419310' Time='8/15/2024 2:13 PM'
            8/15/2024 14:13 Order Order='212419310/S1Aug1560xxxxx' Name='' New state='Working' Instrument='MNQ SEP24' Action='Buy' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
            8/15/2024 14:13 Position Instrument='MNQ SEP24' Account='S1Aug1560xxxxx' Average price=19578.25 Quantity=2 Market position=Long Operation=Update
            8/15/2024 14:13 Order Order='212419310/S1Aug1560xxxxx' Name='' New state='Accepted' Instrument='MNQ SEP24' Action='Buy' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
            8/15/2024 14:13 Execution Execution='1607009|212419309|212419309' Instrument='MNQ SEP24' Account='S1Aug1560xxxxx' Exchange=Globex Price=19578.25 Quantity=1 Market position=Long Operation=Operation_Add Order='212419309' Time='8/15/2024 2:13 PM'
            8/15/2024 14:13 Position Instrument='MNQ SEP24' Account='S1Aug1560xxxxx' Average price=19578.25 Quantity=1 Market position=Long Operation=Operation_Add
            8/15/2024 14:13 Order Order='212419309/S1Aug1560xxxxx' Name='' New state='Filled' Instrument='MNQ SEP24' Action='Buy' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=DAY Oco='' Filled=1 Fill price=19578.25 Error='No error' Native error=''
            8/15/2024 14:13 Order Order='eb488620f91540a7aac11b28f2637680/S1Aug1560xxxxx' Name='' New state='Submitted' Instrument='MNQ SEP24' Action='Buy' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
            8/15/2024 14:13 Order Order='212419309/S1Aug1560xxxxx' Name='' New state='Working' Instrument='MNQ SEP24' Action='Buy' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
            8/15/2024 14:13 Order Order='212419309/S1Aug1560xxxxx' Name='' New state='Accepted' Instrument='MNQ SEP24' Action='Buy' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
            8/15/2024 14:13 Order Order='b61edf57ac9c46bfb135ad5614f27ec0/S1Aug1560xxxxx' Name='' New state='Submitted' Instrument='MNQ SEP24' Action='Buy' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
            8/15/2024 14:13 ATI TradeStation - Strategy Filled Order for @MNQ: Buy 1 @MNQ @ Mar****n account(s) 'S1Aug1560xxxxx'
            8/15/2024 14:13 ATI TradeStation - Strategy Filled Order for @MNQ: Buy 1 @MNQ @ Mar****n account(s) 'S1Aug1560xxxxx'
            8/15/2024 14:13 ATI Order handling option is set to only submit market order on TS order fill notification - email ignored:TradeStation - Strategy Active Order for @MNQ: Buy 1 @MNQ @ Mar****n account(s) 'S1Aug1560xxxxx'
            long 8/15/2024 14:13 ATI Order handling option is set to only submit market order on TS order fill notification - email ignored:TradeStation - Strategy Active Order for @MNQ: Buy 1 @MNQ @ Mar****n account(s) 'S1Aug1560xxxxx'
            Click image for larger version

Name:	image.png
Views:	206
Size:	151.2 KB
ID:	1314323
            Last edited by asd32; 08-15-2024, 01:26 PM.

            Comment


              #7
              Hello,
              Is there any update to this issue ?

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Today, 05:17 AM
              0 responses
              50 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              126 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              69 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              42 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              46 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X