Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time issue in the strategy

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

    Time issue in the strategy

    Hello,

    I use NT7 managed approach. I enabled a strategy on time based bars (1 hour). I use market reply to test it initially. However, within the strategy Time[0] always has the end time of the bar, and not the actual time while the bar is being built. So, even though the time is 1.05pm, Time[0] has 2pm on every tick.

    How can I retrieve the actual time?

    Thanks,
    redduke

    #2
    Hello RedDuke,

    You would need to add a 1 tick series to the script to have the times of each individual tick as the primary series will only have a bar closing each hour.

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      Thanks for a reply. Do you mean adding something like this:

      Add(PeriodType.Tick, 1);

      If yes, this would degrade the performance of the strategy as it would need to processes additional data series. Is there any other way to get the current (correct) time stamp?

      Thanks

      Comment


        #4
        Hello RedDuke,

        Yes, this would add a 1 tick series.

        The logic in the code also needs to be altered so that the code is processed on a specific BarsInProgress.

        for example:
        if (BarsInProgress == 0)
        {
        // execute entry logic
        }

        if (BarsInProgress == 1)
        {
        // print time of tick
        }

        The example linked in the post demonstrates.
        You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        571 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        331 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
        549 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        550 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X