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

Adding 2 indicators to the same panel using AddChartIndicator in Strategy

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

    Adding 2 indicators to the same panel using AddChartIndicator in Strategy

    Hi

    I'm using below code in State.DataLoaded:

    Code:
    EMA1 = EMA(emaPeriod);
                    Bollinger1 = Bollinger(bollingerNoStdDev, bollingerPeriod);
                    DoubleStochastics1 = DoubleStochastics(doubleStoPeriod);
                    Stochastics1 = Stochastics(stoPeriodD, stoPeriodK, stoSmooth);
    
                    if (showIndicators)
                    {
                        AddChartIndicator(EMA1);
                        AddChartIndicator(Bollinger1);
                        AddChartIndicator(DoubleStochastics1);
                        AddChartIndicator(Stochastics1);
                    }​
    I would like the DoubleStochastics and Stochastics indicators to be shown in the same panel. How do I do that please?

    Thanks
    Tim

    #2
    Hello Tim,

    Thank you for your post.

    You should be able to access the Panel property before calling AddChartIndicator() in order to put the DoubleStochastics and Stochastics in the same panel. Using your snippet, this could look like the following:
    Code:
    EMA1 = EMA(emaPeriod);
    Bollinger1 = Bollinger(bollingerNoStdDev, bollingerPeriod);
    DoubleStochastics1 = DoubleStochastics(doubleStoPeriod);
    Stochastics1 = Stochastics(stoPeriodD, stoPeriodK, stoSmooth);
    DoubleStochastics1.Panel = 2;
    Stochastics1.Panel = 2;
    
    if (showIndicators)
    {
    AddChartIndicator(EMA1);
    AddChartIndicator(Bollinger1);
    AddChartIndicator(DoubleStochastics1);
    AddChartIndicator(Stochastics1);
    }​
    For more information, including another sample script demonstrating this idea, please see the following post from a similar thread:
    Hi All I am trying to plot 2 CCI in the same panel IE panel 2 these 2 are part of a strategy and when I use addchartindicator they need to plot in same Panel any ideas could help as I searched everywhere and didnt find a solution Thank you in advance Richard


    Please let us know if we may be of further assistance.
    Emily C.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Jonker, Today, 01:19 PM
    0 responses
    1 view
    0 likes
    Last Post Jonker
    by Jonker
     
    Started by futtrader, Today, 01:16 PM
    0 responses
    4 views
    0 likes
    Last Post futtrader  
    Started by Segwin, 05-07-2018, 02:15 PM
    14 responses
    1,789 views
    0 likes
    Last Post aligator  
    Started by Jimmyk, 01-26-2018, 05:19 AM
    6 responses
    838 views
    0 likes
    Last Post emuns
    by emuns
     
    Started by jxs_xrj, 01-12-2020, 09:49 AM
    6 responses
    3,294 views
    1 like
    Last Post jgualdronc  
    Working...
    X