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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    559 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    546 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X