Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting-Timeframe-Session Begins/Ends

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

    Backtesting-Timeframe-Session Begins/Ends

    I started off using Strategy Analyzer to backtest trading during the busier times of the day. I set Timeframe - Session Begins to 9:30 AM and Session Ends to 10:30 AM, and EnterLong, follow with a dynamic stopLoss.

    When I try to code (ToTime(Time[0]) >= 93000 && ToTime(Time[0]) <= 103000) and EnterLong, the behavior is quite different.

    How exactly is Session Begins/Ends calculated? Is it in OnBarUpdate, or is it using the Advanced Programming framework?

    Thanks.

    #2
    maxsys,

    Not sure I quite follow you. The session begin/end times as defined by the UI is literally which bars time frames to allow the strategy to run on. If you wanted to code an additional time filter within a session definition you would then use those ToTime() checks, otherwise you don't need to if this is already done by your session begin/end times.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks Josh.

      Based on that input, I double checked the Strategy Analyzer Chart and Trade Entry times. I am using Range bars and the Strategy Analyzer data does not match up precisely with the real data. For instance, SA goes Long ZB 12-09 8/14 @ 6:18 @ 116"065. On my chart, the closest bar is 6:25 with a high of 117'030 and a low of 117'000. This test was using 6 Range bars. My older range bar data looks suspicious too.

      Comment


        #4
        maxsys, are you evaluating the same days back setting / chart history in both the SA and the regular charts? This could produce different signals if those are not aligned.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, Yesterday, 09:41 PM
        1 response
        21 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, Today, 02:41 AM
        0 responses
        8 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, Yesterday, 11:44 PM
        0 responses
        20 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        36 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        34 views
        0 likes
        Last Post CarlTrading  
        Working...
        X