Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SMA on virtually anything

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

    SMA on virtually anything

    Hi.
    I'm mainly trading futures. On my way to new strategies, there is one thing, that I can't solve:

    To get the general mood (not for signals!) I use SMA or KAMA (reacting faster) on the main instrument. Looking for divergences, I would like to add an MA to e.g. volume or cumulative volume on the same panel with the same scale. Is there a simple solution for that that I missed?

    Hendrik




    #2
    Hello Hendrik,

    Thanks for your post.

    To clarify, are you referring to coding a custom NinjaScript strategy?

    AddChartIndicator() could be used to plot an indicator on the chart from a NinjaScript strategy.

    See this help guide page about adding indicators to strategies: https://ninjatrader.com/support/help..._strategie.htm

    From the AddChartIndicator() help guide documentation:

    "An indicator being added via AddChartIndicator() cannot use any additional data series hosted by the calling strategy, but can only use the strategy's primary data series. If you wish to use a different data series for the indicator's input, you can add the series in the indicator itself and explicitly reference it in the indicator code (please make sure though the hosting strategy has the same AddDataSeries() call included as well)

    If a secondary or null Bars series is specified by the calling strategy (not the indicator itself), the strategy's primary series will be substituted instead."


    This means that if you want to plot the indicator on the chart calculated from a secondary series, you would need to make a copy of the SMA indicator, add a secondary series to the indicator using AddDataSeries(), and calculate the indicator values based on the added secondary series.

    AddChartIndicator(): https://ninjatrader.com/support/help...tindicator.htm
    AddDataSeries(): https://ninjatrader.com/support/help...dataseries.htm

    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Ah, sorry, no. I talk about simple charting. One chart with two panels: Instrument plus kama. Second panel e.g. Volume plus kama on volume. Or so. But thats the basic construction.

      Comment


        #4
        Hello shirokuma,

        Thanks for your notes.

        If you have a Chart window with two data series and you want to add the KAMA indicator to both data series, you could add two instances of the KAMA indicator to the chart, set the 'Input series' property to the data series you want the indicator to use, and set the 'Panel' property of each indicator instance to the same panel the data series is using.

        See this demonstration video: https://brandonh-ninjatrader.tinytak...MF8yMjg0MzI0Ng

        Here is the help guide documentation detailing working with indicators on a Chart for you to review: https://ninjatrader.com/support/help...indicators.htm
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Hi. Thank you for that information. I do however wonder how to clarify myself further: I have one "original" data series, say ES. From that I have, say, volume, in a second panel. From that I would like an MA also in the same panel. How can I achieve that?

          Comment


            #6
            Hello shirokuma,

            Thanks for your notes.

            To clarify, are you wanting to plot the KAMA indicator on the first data series panel (ES) but calculate from the second data series panel (ES Volume)?

            If so, you could add the KAMA indicator to the chart window, set the 'Input series' property to the ES Volume series, and set the 'Panel' property to Panel 1.

            If you want the KAMA indicator to plot on the second data series panel but calculate from the first data series, you could set the 'Input series' property to the first ES data series and set the 'Panel' property to Panel 2.

            If you want to plot the indicator on both panels, you could follow the steps seen in the demonstration video on post # 4.
            Brandon H.NinjaTrader Customer Service

            Comment


              #7
              Thanx Brandon, that worked ) It was a bit hidden, so thank you also for the patient explanation.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by geddyisodin, 04-25-2024, 05:20 AM
              8 responses
              60 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by jxs_xrj, 01-12-2020, 09:49 AM
              4 responses
              3,287 views
              1 like
              Last Post jgualdronc  
              Started by Option Whisperer, Today, 09:55 AM
              0 responses
              5 views
              0 likes
              Last Post Option Whisperer  
              Started by halgo_boulder, 04-20-2024, 08:44 AM
              2 responses
              22 views
              0 likes
              Last Post halgo_boulder  
              Started by mishhh, 05-25-2010, 08:54 AM
              19 responses
              6,189 views
              0 likes
              Last Post rene69851  
              Working...
              X