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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    54 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    72 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    44 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X