Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        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.
            BertrandNinjaTrader Customer Service

            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.
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by usazencort, Today, 01:16 AM
                0 responses
                1 view
                0 likes
                Last Post usazencort  
                Started by kaywai, 09-01-2023, 08:44 PM
                5 responses
                603 views
                0 likes
                Last Post NinjaTrader_Jason  
                Started by xiinteractive, 04-09-2024, 08:08 AM
                6 responses
                22 views
                0 likes
                Last Post xiinteractive  
                Started by Pattontje, Yesterday, 02:10 PM
                2 responses
                21 views
                0 likes
                Last Post Pattontje  
                Started by flybuzz, 04-21-2024, 04:07 PM
                17 responses
                230 views
                0 likes
                Last Post TradingLoss  
                Working...
                X