Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi-Time Frame, Session Template, Exit on close, Errors

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

    Multi-Time Frame, Session Template, Exit on close, Errors

    Hello,

    I backtest a strategy, based on previous day High / Low breakthrough. I close the position at the end of the day. So it is multi-time frame strategy with 15 min bars and 1 day bars, CalculateOnBarClose is true.

    Actually I use ExitOnClose to close the position.

    As I understand, ExitOnClose should be executed at the end of session. Sometimes session is from 17:00 to 17:00 on the next day, sometimes it is from 15:30 to 15:15 on the next day. But I noticed that ExitOnClose usually is executed on the first bar on the next day (00:00:00 ?). I use instrument session template settings, but it seems that session template with backtest is different from instrument's session template. Is it true?

    Next, I noticed a trade with strange ExitOnClose, I attach screenshots. I tested another instrument with the same strategy, 473 trades. ExitOnClose was before Enter with 3,7% of trades. What could be the reason?
    Attached Files

    #2
    Hello Valyo,

    Thank you for your post.

    The Session Template should be the same in backtesting if you use the '<Use Instrument Settings>' option for the Session Template when setting up the backtest.

    On your charts and when backtesting do you always use '<Use Instrument Settings>'?

    On the ZW chart you provided, what Session Template is selected? You can check this by right clicking in your chart > select Data Series > check the Session Template setting.

    Using the ZW again for an example, if you are using '<Use Instrument Settings>' please go to the NinjaTrader Control Center > Tools > Instrument Manager > search for the ZW instrument > double click on the ZW in the search results > and please advise what Session Template is set for the ZW instrument.

    The Exit On Close occurring before an entry thus causing the Exit On Close to be the entry and the entry to be the exit should not occur in real-time trades or when backtesting.
    What conditions are used to set ExitOnClose? Or is it set in the Initialize() method?

    I look forward to your response.

    Comment


      #3
      Hello Patrick,

      I always use '<Use Instrument Settings>' when I backtest and optimize strategies.

      The session template for ZW is "CBOT Agriculturals ETH". This session template is based on Central Time GMT - 06:00 and my time is GMT + 02:00. So when a session ends at 13:15 Central Time, I see it as 21:15.

      The Exit On Close occurring before an entry thus causing the Exit On Close to be the entry and the entry to be the exit
      In my example Exit On Close is exit. It is at 774,25, the Close for 30.06.2010, 21:15. The entry is entry. It is at 770,50, the Price for 1.07.2010, 15:15.

      I set ExitOnClose = true in the Initialize() method.

      Comment


        #4
        Hello Valyo,

        Thank you for your response.

        I have backtested a simple strategy on my end with ExitOnClose and I do not see the same results.

        Can you send me your strategy to support[at]ninjatrader[dot]com with 'ATTN: Patrick - 826562' so I may test this matter on my end?

        I look forward to your response.

        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