Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to put a time limit on orders sent from TradeStation to NT

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

    How to put a time limit on orders sent from TradeStation to NT

    I am new to NT and apologize if this question is ridiculously obvious.

    I would like to implement a simple X minute time limit on each order received from tradestion so that if the limit order is not filled within X minutes, that order is just cancelled by NT with the broker.

    How can I do this as a simple rule within NT and not have to rely on extensive back and forth communications between the TS and NT that in this case will be residing on seperate machines?

    Thanks,

    Joe

    #2
    If you are using the Email Interface this is not possible. Its only possible to convert the limit to market after X seconds.

    Using the DLL interface this is possible since you will control the submission and cancellation of orders from within your own EL code.
    RayNinjaTrader Customer Service

    Comment


      #3
      Ray,

      Thanks for the quick reply.

      I will be using the DLL implementation with TS and NT residing on seperate machines within a local network. I am aware that I could label the individual orders, track them, and then send individual cancellation orders for each within the EL, the point of my question was how to implement a simple time limit on each order sent to NT within NT so that each order just expires after X minutes of time has elapsed.

      The intention is to use NT to handle the profit and loss stops on positions once entered, I am under the impression that is one of the purposes of this software. I just want to know how to also instruct NT to cancel any orders that it successfully transmitted to the broker but that have not been filled within let's say three minutes. I want this done by NT on the NT machine, not dependent on back and forth communications to the TS machine.

      I want the EL to be responsible simply to send out a stream of Limit Buy and Limit Sell Orders and let NT take over from there. I don't mind attaching a time stamp to each of the 8 possible signals generted by the strategy if that is necessary for NT to distinguish and track them, but I want NT to take over responsibility for the order once it initially arrives from TS until it is filled or cancelled. It seems a much more reliable methodology.

      Please let me know if NT has this capability and how would it be best implemented.

      Thanks for the help,

      Joe

      Comment


        #4
        NT does not have a concept of cancelling orders withing X minutes. You have to take care of this logic in your EL code.
        RayNinjaTrader Customer Service

        Comment


          #5
          Ray,

          I implemented a time-based cancellation order in my EL using its date.time function to record the time the initial buy or sell order is transmitted to NT and if NTOrderStatus("Order#") <> "FILLED" within X seconds after such time a cancellation of that order is transmitted to NT. I am waiting to hear from my client if it works properly in testing.

          Regardless, I still want to implement a similar time-based cancellation within NT since nothing I do in TS is effective if the TS program crashes due to hardware or software failure while orders are sitting open on NT. I see the NT documentation highlights the fact that it has access to the same date.time funtion, so is there a way to record the time of order confirmation from the broker and then if after X seconds the order is not filled, have NT send a cancellation of such order to the broker.

          Please let me know if you foresee any problems with my approach my EL, and more importantly, how can I integrate a NT-based solution with your Automated Trading Interface using Ninjascript and the date.time function. If you still believe its not possible please let me know specifically where the problem lies so that a solution to this issue can be requested and addressed in an upcoming version of the software.

          Thanks,

          Joe

          Comment


            #6
            You approach is fine.

            If you were to program a strategy in NinjaTrader natively using NinjaScript, you can then self program a function that will cancel after X seconds. This can be done in NT 6.5 due to be released shortly.
            RayNinjaTrader Customer Service

            Comment


              #7
              Thanks.

              A related question. When I create an order such as

              Success = NTBuyLimit("BUY_C2", TRADE_SIZE, AP); where AP is the limit price, can I add the name of the specific ATM strategy to use for this order like this

              Success = NTBuyLimit("BUY_C2", TRADE_SIZE, AP, ATM_2); assuming the trader has created several alternatives and wants his ATM_2 strategy in NT to apply to this order.

              If that doesn't work would I send NTCommand("BUY_C2", ATM_2) or something like that?

              Please show me how the instruction should be formatted, does the ATM_2 need quotes for example, and do I need to provide any additional information.

              Also I need to know if I send this instruction one time will all the "BUY_C2" orders be handled according to ATM_2 rules until a different instruction is sent, or do I need to resend this instruction after each order.

              Thanks,

              Joe

              Comment


                #8
                You would use the NTCommand() function. Take a look at Tools > Options > ATI > OIF Builder to get an idea how the string should look like.
                RayNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by algospoke, Today, 06:40 PM
                0 responses
                9 views
                0 likes
                Last Post algospoke  
                Started by maybeimnotrader, Today, 05:46 PM
                0 responses
                7 views
                0 likes
                Last Post maybeimnotrader  
                Started by quantismo, Today, 05:13 PM
                0 responses
                7 views
                0 likes
                Last Post quantismo  
                Started by AttiM, 02-14-2024, 05:20 PM
                8 responses
                168 views
                0 likes
                Last Post jeronymite  
                Started by cre8able, Today, 04:22 PM
                0 responses
                10 views
                0 likes
                Last Post cre8able  
                Working...
                X