Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using Multiple Timeframes with Add()

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

    Using Multiple Timeframes with Add()

    Hello all.

    I am trying to code an indicator that work on say a 1 minute timeframe but looks at the value of a specific indicator on the 5 minute chart.

    I have coded the following so far

    protectedoverridevoid Initialize()
    {
    Add(PeriodType.Minute, 5);
    CalculateOnBarClose = true;
    Overlay = true;
    PriceTypeSupported = false;
    }
    protectedoverridevoid OnBarUpdate()
    {
    if (BarsInProgress != 0)
    return;
    if (CrossAbove(DM(5).DiPlus,DM(5).DiMinus,1)&& Stochastics(3,8,5).D[0] < Stochastics(3,8,5).K[0] && DM(BarsArray[1], 5)[0].DiPlus > DM(BarsArray[1], 5)[0].DiMinus )
    DrawArrowUp(CurrentBar.ToString(), true, 0, Low[0] - 0.0005, Color.Green);
    if (CrossBelow(DM(5).DiPlus,DM(5).DiMinus,1)&& Stochastics(3,8,5).D[0] > Stochastics(3,8,5).K[0] )
    DrawArrowDown(CurrentBar.ToString(), true, 0, High[0] + 0.0005, Color.Red);
    }

    My problem is that when I call the Add() line uder Inialize, I get an error telling me that "No overload for method "Add" take 2 arguements. I'm not sure what it wants since the line is taken directly from sample code in the help file.

    What am I doing wrong if I would like to look at the adx on the 5 minute chart before drawing my indicator?

    Thanks in advance for any help.

    #2
    wcmaria,

    Multi-series indicators will be available in NT7. You currently cannot do this.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hi Josh, is what I am trying to do not similar to what was discussed in the following thread you responded to a while back -

      It is all possible. To work with multiple time frames first read http://www.ninjatrader-support.com/H...ameInstruments.

      To make the time frames variable you would simply need to code user selectable parameters. Be careful when you code though. The first time frame will always be whatever time frame the chart which you loaded the strategy onto is set at. If you want your strategy to work regardless of what time frame the chart/strategy analyzer is on and just solely based on your user inputs you should probably add two more time periods to your strategy. You would negate the first time period (the chart's time period) from all calculations in this instance.

      Does this still not work in version 6?

      Comment


        #4
        Josh's comment was about MultiInstrument / MultiTime strategies, those are possible with NinjaTrader 6.5

        NinjaTrader 7 will offer this concept for indicators as well.

        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
        330 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
        548 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        549 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X