Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Submit MOO when TIF=Day and Historical=true

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

    Submit MOO when TIF=Day and Historical=true

    Hi, with 5 minute data, I want to have an exit which is MOO. I have COBC=false and TIF=Day. is there a way to exit a position on the firstsessionbars open?

    I assume that by using TIF=Day has made it impossible to get the order to fire on the first bar's open as I can't place the order prior to the open.

    Any suggestions?

    Happy New year.

    W2


    #2
    Hello,

    What instrument are you trading? So to recap when you submit a TIF order of Gtc it gets rejected by the exchange as they only accept this during RTH?
    BrettNinjaTrader Product Management

    Comment


      #3
      Originally posted by NinjaTrader_Brett View Post
      Hello,

      What instrument are you trading? So to recap when you submit a TIF order of Gtc it gets rejected by the exchange as they only accept this during RTH?
      Hi Brett, not I'm not live right now. I am moving my code over from TS, so everything right now are just historical tests. The instruments are stocks.

      i assume when Live, this code will fire after the first tick so I will get filled intrabar

      if (Bars.FirstBarOfSession)
      {

      ExitLong(1,"LX.MOO","LE.System1");
      }


      I can live with that in realtime,but in simulation mode it takes the open of the next bar as the fill. I am moving my systems over to NT, so I am just looking to compare/verify the Simulated TS results to NT. is there a way using 5Min data to place an order which will exit on the open of the FirstbarOfSession in historical tests and live trading?

      Thanks. W2

      Comment


        #4
        Hello,

        Ok so there are first some imporant differences versus backtesting and running live. Right now the backtester is always running with Calculate On Bar Close = True as it will always run in this mode.

        Also in backtesting orders are always submitted to the open price of the next bar after the condition is true.

        Therefor please insure you understand this link.



        Also, if you want to add further granularity to your test to execute intrabar in a backtest, would would need to use the following sample to add whats called intrabar granularity. This simply gives you more points of which to execute agianst.

        You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by


        Let me know if I can be of further assistance.
        BrettNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        648 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X