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 to add indicator for different data series other than Price

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

    How to add indicator for different data series other than Price

    Hey guys,

    I have a simple question.

    I want to add an indicator to a strategy but have it point to a different series other than Price and I want that indicator and subsequent indicators to appear in Panel 2. How can I do this?

    Example for 2 indicators that I want to point to RSI instead of price and both indicators to appear in Panel 2:

    private SUM SUMInd1;
    private SUM SUMInd2;

    SUMInd1 = SUM(13);
    AddChartIndicator(SUMInd1);

    SUMInd2 = SUM(8);
    AddChartIndicator(SUMInd2);
    Last edited by PN720; 12-22-2019, 11:19 AM.

    #2
    Hello PN720,

    Thank you for your post.

    For pretty much all indicators, there will be an overload that will allow you to specify the data series for use with that instance of the indicator. For example:

    Code:
    // Prints the current value of a 20 period SUM using high price type
    double value = SUM(High, 20)[0];
    Print("The current SUM value is " + value.ToString());
    To clarify on the plotting part, you're trying to plot multiple indicators to panel 2 from within your strategy, is that correct?

    This example from our help guide goes over plotting from within a strategy: https://ninjatrader.com/support/help..._a_ninjasc.htm

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by wzgy0920, 04-20-2024, 06:09 PM
    2 responses
    26 views
    0 likes
    Last Post wzgy0920  
    Started by wzgy0920, 02-22-2024, 01:11 AM
    5 responses
    32 views
    0 likes
    Last Post wzgy0920  
    Started by wzgy0920, Yesterday, 09:53 PM
    2 responses
    49 views
    0 likes
    Last Post wzgy0920  
    Started by Kensonprib, 04-28-2021, 10:11 AM
    5 responses
    191 views
    0 likes
    Last Post Hasadafa  
    Started by GussJ, 03-04-2020, 03:11 PM
    11 responses
    3,231 views
    0 likes
    Last Post xiinteractive  
    Working...
    X