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 aussugardefender, Today, 01:07 AM
    0 responses
    1 view
    0 likes
    Last Post aussugardefender  
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    238 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Started by TraderG23, 12-08-2023, 07:56 AM
    9 responses
    383 views
    1 like
    Last Post Gavini
    by Gavini
     
    Started by oviejo, Today, 12:28 AM
    0 responses
    1 view
    0 likes
    Last Post oviejo
    by oviejo
     
    Started by pechtri, 06-22-2023, 02:31 AM
    10 responses
    125 views
    0 likes
    Last Post Leeroy_Jenkins  
    Working...
    X