Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Possible in backtest to get an order to execute on close of same bar order is placed?

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

    Possible in backtest to get an order to execute on close of same bar order is placed?

    Hello,

    I would like to execute an order on the open (8:30 AM), or as soon as possible thereafter, if there was a gap open, using 1 minute bars.

    I am under the impression that in backtest mode, there is no way to execute an order on the open of a 1 minute bar. Is this true?

    If this is true, can I at least make the make the determination that a gap open happened in during the first minute bar and also get the order to execute on the close of the first minute bar or at least on the open of the next minute bar?

    If none of these things are possible in backtest mode, then it appears that the earliest that I could get an order to execute in backtest mode based on the determination of some criteria (like a gap open) on the open of a market at 8:30 AM is 8:32 AM (I could make the determination of place the order on the close of the 8:30-8:31 bar, and the order would then get executed on the close of the 8:31-8:32 bar).

    How can I get my backtest orders to execute before 8:32 AM for markets that open at 8:30 AM, if I am unable to make the determination to trade until the open of the market at 8:30 AM?

    Thanks in advance! I REALLY appreciate the quick, no-nonsense responses that I have gotten to ALL of my questions on the Ninja Trader forums!

    ChiTrader2000

    #2
    In backtest mode you can only make trades on the bar after your signal bar. It may be possible to enter at the open if you submit the order at the close of the prior day. You would want to have ExitOnClose = false in this case.

    To check for the close of the prior day you could do something like if (ToTime(Time[0]) == 140000) or something like that.
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    56 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    143 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    160 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    96 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    276 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X