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

How Do I Create a SMA Plot of Another Indicator?

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

    How Do I Create a SMA Plot of Another Indicator?

    Hi,
    I have created my own indicator (I call PN) which plots a line on any chart similar to a Simple Moving Average. This indicator works fine and plots exactly as it should. Now I want to show another indicator on my charts that is a SMA of my PN indicator.

    I have been trying to create this new indicator for about a week and haven't been able to figure out how to do this. Is this because the SMA will only work with Open, High, Low, Close and Volume data? I thought that I could use the data series from the PN indicator values to create the new SMA indicator plot. Is this not possible? I read that indicators could be used as inputs to other indicators but I must be misunderstanding something.

    If someone could help me with this or point me to where I find out more about this issue I would really appreciate your help. Thanks.
    LarryRay

    #2
    Originally posted by LarryRay View Post
    Hi,
    I have created my own indicator (I call PN) which plots a line on any chart similar to a Simple Moving Average. This indicator works fine and plots exactly as it should. Now I want to show another indicator on my charts that is a SMA of my PN indicator.

    I have been trying to create this new indicator for about a week and haven't been able to figure out how to do this. Is this because the SMA will only work with Open, High, Low, Close and Volume data? I thought that I could use the data series from the PN indicator values to create the new SMA indicator plot. Is this not possible? I read that indicators could be used as inputs to other indicators but I must be misunderstanding something.

    If someone could help me with this or point me to where I find out more about this issue I would really appreciate your help. Thanks.
    LarryRay
    Please see this video. Although its for NinjaTrader 7, the concept is the same in NinjaTrader 8.

    Download NinjaTrader FREE at http://www.ninjatrader.comThis video demonstrates how to plot an indicator based on the value of another indicator on a chart wi...
    RayNinjaTrader Customer Service

    Comment


      #3
      Thanks

      Ray,

      Thank you so much for pointing me to this video. I am using NinjaTrader 7 so it is exactly what I needed to know. From now on I will look through all of the training videos to see if they have already addressed my questions.

      LarryRay

      Comment


        #4
        Another Question

        Hi,

        I have one more question about this SMA that I created for my PN indicator. It looks good on my chart, but is there any way that I can use the values shown on this SMA line in a strategy that I am creating? If so, how do I refer to this value in a strategy?

        Thanks for your help.

        LarryRay

        Comment


          #5
          Hi LarryRay,

          Indicators are typically called with an index to access a value on a public series.

          For example:

          MyCustomIndicator(Parameter1, Parameter2)[0];

          or

          MyCustomIndicator()[0];

          or

          MyCustomIndicator().MyCustomPublicSeries[0];

          Depending on the public inputs and series created in the script.

          Below I am providing a link to a helpful forum post with information about getting started with NinjaScript.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Chelsea Chelsea The answer is not helpful, and the provided link is a general reference one.

            Why not provide a direct helpful Specific answer for a change, to that simple of a question?

            diff1 = (Math.Abs(SMA(Close, 20)[0] - SMA(ATR(), 20)[0] ));

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by AttiM, 02-14-2024, 05:20 PM
            12 responses
            213 views
            0 likes
            Last Post DrakeiJosh  
            Started by cre8able, 02-11-2023, 05:43 PM
            3 responses
            237 views
            0 likes
            Last Post rhubear
            by rhubear
             
            Started by frslvr, 04-11-2024, 07:26 AM
            8 responses
            116 views
            1 like
            Last Post NinjaTrader_BrandonH  
            Started by stafe, 04-15-2024, 08:34 PM
            10 responses
            47 views
            0 likes
            Last Post stafe
            by stafe
             
            Started by rocketman7, Today, 09:41 AM
            3 responses
            12 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X