Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order entry based on open condition in EOD backtest

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

    Order entry based on open condition in EOD backtest

    I'm looking for a way to implement a rather simple (pattern based) EOD strategy for backtesting. The strategy should EnterShort ONLY IF the open is above the previous day's high,
    if (Open[0]>High[1])
    EnterShort(..)
    If implemented like this, the order can obviously only be fulfilled the next day but not on the very day when the condition is fulfilled.
    If I understand correctly, an order is always submitted before OnBarUpdate/after the end of the previous bar. So how can an order be linked with an open condition?

    I did a cursory search in the forum but didn't find anything suitable. Any help would be highly appreciated.

    #2
    Hi whipsaw,

    Thank you for your post, I will have someone respond on this query later today.
    TimNinjaTrader Customer Service

    Comment


      #3
      whipsaw,

      You would have to use CalculateOnBarClose = false and it would only work in real-time. In backtesting, it will behave as you have experienced in that it can only submit to the next day since your granularity is only EOD snap shots that provide you OHLC all at once and not Open then High then Low then Close.
      Josh P.NinjaTrader Customer Service

      Comment


        #4
        Josh

        Hoped there would be a smart workaround. Anyhow, thanks a lot for clarification.

        Comment


          #5
          You can work on 1 minute bars and calculate previos day high.

          Baruch

          Comment

          Latest Posts

          Collapse

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