Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi-Time Frame & Bar Data Reference

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

    Multi-Time Frame & Bar Data Reference

    I use a multi-time frame strategy on a 1 minute chart. In Initialize() I add a 5 min bar data. CalulcateOnBarClose is true.

    From my point of view the reference to bars does not work as documented (http://www.ninjatrader-support.com/H...ameInstruments
    in Section "How Bar Data is Referenced"). I understand text and Figure 1 in this way that every yellow 1 min bar should have access to yellow 3 min bar / every 1 min bar in cyan should have access to the cyan 3 min bar.

    From my test/observation: During Historical == true the actual 1 minute bar processing at time when a 5 min bar is finished has no access to the actual finished 5 min bar data. Call sequence is
    1. OnBarUpdate for 1min bar
    2. OnBarUpdate for 5min bar

    Because of this it is not possible to plot via StrategyPlot because on the 5 min border the data in 1min bar processing is "delayed" by 1 bar.

    My test code to illustrate:

    switch (BarsInProgress) {
    case BAR1MIN:
    // *** call from 1 min bar

    // at finished 5 min bar: close value from !!prev!! 5min bar
    // all 5min indicator values from !!prev!! bar
    DrawDiamond(CurrentBar.ToString()+"5minfrom1min",0 ,
    Closes[BAR5MIN][0],Color.Blue);

    // close value from actual 1 min bar
    //DrawDot(CurrentBar.ToString()+"1minfrom1min",0,
    // Closes[BAR1MIN][0],Color.Blue);
    break;
    case BAR5MIN:
    // *** call from 1 min bar

    // close value from actual 5min bar
    // all 5min indicator values from actual bar
    DrawDiamond(CurrentBar.ToString()+"5minfrom5min",0 ,
    Closes[BAR5MIN][0],Color.Red);

    // close value from actual 1 min bar
    //DrawDot(CurrentBar.ToString()+"1minfrom5min",0,
    // Closes[BAR1MIN][0],Color.Red);
    break;

    }

    At the finished 5 min bar the diamonds are plotted on different prices.

    As a workaround my actual logic in my real strategy is:

    case BAR1MIN:
    if (!Is5minBar)
    processSignals();
    case BAR5MIN:
    processSignals();

    But after a review of code, documentation & forum I think that this does not work as documented?

    #2
    The order in which your bar series are added is important. Please take a look at the comments inside this reference sample: http://www.ninjatrader-support.com/v...ead.php?t=6652
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      The refernce sample is not what I want:

      Reference example: 5 min chart with not visible 1 min bars and no way to plot 1 min bar data

      My problem: 1 min chart with not visible 5 min bars (like described in your documentation mentioned above)

      I want to see 1 min bars on chart to be able to follow entries/exits of my strategy in detail.

      In the reference example the 1 min data is added "just for fun" - there is no access or processing of 1 min data.
      You will run into same problem in opposite direction if you want to access actual 1min data/indicators from 5 min processing.

      Comment


        #4
        What I do is backtest my strategy, then open a 1 minute chart, enable global cross hair in both the Strategy Analyzer chart and the 1 min char and scroll along. The executions will plot on the 5 min chart but you can see the 1 min chart synced on the cross hair. We have on out list visualization multiple series in a backtest on NT7.
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        599 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        345 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        558 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        558 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X