Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator - SMA of other timeframes

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

    Indicator - SMA of other timeframes

    Hi Guys

    Currently I'm developing a reversal indicator - let's say for the 5 min timeframe

    This indicator returns a signal, when the reversal occurs at a location point like the SMA(20) PrevDayHigh, PrevDayLow ....

    now I also would like to get a Signal when the reversal occures at the SMA(20) of a higher timeframe (15min, 30min,..)

    is it possible to implement a SMA of a higher timeframe into a 5min - or whatever - indicator

    many thanks for your help

    #2
    Hi TheChingachgook, yes this is possible in a MultiTimeFrame strategy - http://www.ninjatrader-support.com/H...struments.html

    For sample code you can review the 'SampleMultiTimeFrame' installed per default.

    Comment


      #3
      Indicator - SMA of other timeframes

      Thank you for your quick reply

      In my strategy I'm already using the multitimeframe feature - but I would need it in an indicator.

      I would like to add this signal to the MarketAnalyzer and this tool only accepts indicators.

      The Add-Method doesn't work within an indicator....

      So... is it possible somehow else

      regards

      Comment


        #4
        Unfortunately not, however multiple time frame indicators will be possible in our upcoming NinjaTrader 7, scheduled for the second quarter of this year.

        Comment


          #5
          Hi!
          I'd like to plot a SMA 150 from the Daily chart on a 1-Minute-chart. What I have so far:
          Code:
          protected override void Initialize()
                  {
                      Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));            
                      Add(PeriodType.Minute,240);
                      Add(PeriodType.Day,1);
                      
                      CalculateOnBarClose = true;
                  }
          
                  /// <summary>
                  /// Called on each bar update event (incoming tick)
                  /// </summary>
                  protected override void OnBarUpdate()
                  {
                      if (BarsInProgress != 0) 
                          return;
                      
                      // Checks to ensure all Bars objects contain enough bars before beginning
                      if (CurrentBars[0] <= BarsRequired || CurrentBars[1] <= BarsRequired || CurrentBars[2] <= BarsRequired)
                          return;
                      
                      Plot0.Set(SMA(Closes[1], 14)[0]);
                      
                      doExitSignals();
                      
                      doEntrySignals();            
                  }
          What I get:

          Die beste Übereinstimmung für die überladene NinjaTrader.Strategy.StrategyBase.Add(NinjaTrader. Indicator.IndicatorBase)-Methode hat einige ungültige Argumente.;CS1502 - click for info;35;13;

          1-Argument: kann nicht von "NinjaTrader.Gui.Chart.Plot" in "NinjaTrader.Indicator.IndicatorBase" konvertiert werden.;CS1503 - click for info;35;17;

          Der Name "Plot0" ist im aktuellen Kontext nicht vorhanden.;CS0103 - click for info;55;4;

          Comment


            #6
            Welcome to our forums, are you attempting to do this in a strategy script? Those could unfortunately not plot per default, only indicators could.

            Comment


              #7
              Thank you. Yes, I'm trying to do this within a strategy script.

              Comment


                #8
                Ok, then please try do plot the higher timeframe MA from an indicator, this is now possible as well in NT7.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by CarlTrading, 03-31-2026, 09:41 PM
                1 response
                152 views
                1 like
                Last Post NinjaTrader_ChelseaB  
                Started by CarlTrading, 04-01-2026, 02:41 AM
                0 responses
                89 views
                1 like
                Last Post CarlTrading  
                Started by CaptainJack, 03-31-2026, 11:44 PM
                0 responses
                133 views
                2 likes
                Last Post CaptainJack  
                Started by CarlTrading, 03-30-2026, 11:51 AM
                0 responses
                127 views
                1 like
                Last Post CarlTrading  
                Started by CarlTrading, 03-30-2026, 11:48 AM
                0 responses
                107 views
                0 likes
                Last Post CarlTrading  
                Working...
                X