Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

TimeInForce to Day

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

    TimeInForce to Day

    Hi,

    I need a way to modify the TIF. I've created a strategy using 'Unmanaged = true'.
    The strategy worked perfectly in SIM. However when I went to trade LIVE with it, I received reject messages from PatsSystems saying that TimeInForce.GTC is not supported with LIMIT orders for this exchange. How can I change the TIF of all my orders to Day from GTC with Unmanaged = true?

    By the way, I'm surprised NT defaults to GTC instead of Day.


    thanks-

    #2
    Would placing "TimeInForce = Cbi.TimeInForce.Day;" in the Initialize method set the TIF globally to Day?

    Comment


      #3
      Hello jonmoron,

      You can set the TimeInForce when you run the strategy. It's one of the available options you can set from the GUI. You can also hard code a value for this in the Initialize() method.



      Definition
      Sets the time in force property for all orders generated by a strategy. This property is dependant on what time in force your broker may or may not support.


      Property Value
      Cbi.TimeInForce.Day
      Cbi.TimeInForce.Gtc


      Syntax
      TimeInForce


      Examples
      protected override void Initialize()
      {
      TimeInForce = Cbi.TimeInForce.Day;
      }
      Ryan M.NinjaTrader Customer Service

      Comment


        #4
        Ryan,

        I do set the TIF in the Initialize method like this:

        TimeInForce = Cbi.TimeInForce.Day;
        Unmanaged = true;

        However when I look at my output log I see entries like this:

        Changing unmanaged order at 8/23/2010 9:44:00 AM: Order='b1844503fe4e4dca999c623093dcfbf4/Replay101' Name='side2Order2Stop' State=Accepted Instrument='ES 09-10' Action=Buy Limit price=0 Stop price=1076.25 Quantity=15 Strategy='Auto44v7' Type=Stop Tif=Gtc Oco='side2Order2Collar' Filled=0 Fill price=0 Token='b1844503fe4e4dca999c623093dcfbf4' Gtd='12/1/2099 12:00:00 AM'

        Note that the TIF is set to GTC, although I explicitly set the TIF to Day. How can I prevent order modifications from submitting GTC orders?

        regards

        Comment


          #5
          jonmoron, did you reenable your strategy fresh after those TIF code changes? I just tried on my end here and setting the TIF from the Initialize() worked for both DAY & GTC orders as expected on B20.

          Comment


            #6
            Originally posted by NinjaTrader_Bertrand View Post
            jonmoron, did you reenable your strategy fresh after those TIF code changes? I just tried on my end here and setting the TIF from the Initialize() worked for both DAY & GTC orders as expected on B20.

            Bertrand, Yes. I re-compiled after the code change. I also restart (ReAdd to chart) the strategy every day.

            Comment


              #7
              Thanks for the details, JonMoron.

              I've not able to see this. The original order and any modified orders are always submitted with TIF according to what is set.

              Can you share your strategy that shows this and we can attempt to reproduce here?
              .cs file in:
              My Documents\NinjaTrader 7\bin\custom\strategy
              Ryan M.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              657 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              373 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              109 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              574 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              579 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X