Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to add Simple Moving Average (SMA) to Indicator

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

    How to add Simple Moving Average (SMA) to Indicator

    Hi,

    I have an indicator I am working that I would like to integrate the SMA into for plotting purposes. I am currently using the plot function (Add (new Plot"""" //within the Initialize section) with a dataseries, but I realize that what I am really looking for is the SMA of this dataseries. I can add it after the fact within the chart, but I would like it to be part of the indicator. What is the best way to add this and is this added into the Initialize section or in the main code? Also, how would I graph both the plot and the SMA at the same time if I wish to do so? Do I need to have multiple dataseries to do this?

    Thanks,

    Lee

    #2
    Hello lee612801,

    It is not possible to add an indicator to another indicator for automatical plotting the way this is possible with strategies.

    If you would like to add an indicator to this indicator, you will need to add a new plot, then set the plot value to the value of the SMA.

    Below is a link to the help guide on Add() for indicators.
    http://www.ninjatrader.com/support/h...es/nt7/add.htm

    Also, below is a link that describes how to call the SMA.
    http://www.ninjatrader.com/support/h...simple_sma.htm
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by schmidtbc16, Today, 03:36 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by RT001, Today, 03:25 PM
    2 responses
    12 views
    0 likes
    Last Post RT001
    by RT001
     
    Started by mbrandau, Today, 01:58 PM
    5 responses
    35 views
    0 likes
    Last Post mbrandau  
    Started by remcovdmeulen, Today, 02:15 PM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_Jim  
    Started by gbrad, Today, 09:57 AM
    7 responses
    15 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X