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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    67 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    60 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X