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 trilliantrader, Today, 03:01 PM
            0 responses
            3 views
            0 likes
            Last Post trilliantrader  
            Started by pechtri, 06-22-2023, 02:31 AM
            9 responses
            122 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by frankthearm, 04-18-2024, 09:08 AM
            16 responses
            67 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by habeebft, Today, 01:18 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by benmarkal, Today, 12:52 PM
            2 responses
            19 views
            0 likes
            Last Post benmarkal  
            Working...
            X