Announcement

Collapse
No announcement yet.

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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    91 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    137 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    121 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    72 views
    0 likes
    Last Post PaulMohn  
    Working...
    X