Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add indicator to main price chart vs panel below it?

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

    Add indicator to main price chart vs panel below it?

    I have several indicators in panels below the main pricing chart. This is accomplished successfully with this code:

    AddChartIndicator(Stochastics(stochPeriodD, stochPeriodK, stochSmooth));
    AddChartIndicator(SMA(emaLongLen));
    Panel = 1;
    AddChartIndicator(SMA(emaShortLen));
    Panel = 1;
    AddChartIndicator(ADXR(x,y));
    Panel = 2;
    ClearOutputWindow();

    This gives me 3 subpanels which is perfect. But now I want to add another SMA to the MAIN price chart (above these 3 subpanels). How do I do that? Thanks for helping!

    #2
    Hello jamesmjones00123,

    Thanks for opening the thread.

    The SMA indicator uses IsOverlay = true, so by default it will be plotted on the main price panel without having to specify which panel it should be plotted on.

    Please let us know if we can be of further help.

    Comment


      #3
      I added a new line at the top, but the new SMA is showing up in the panel below the main pricing panel. Please advise.

      AddChartIndicator(SMA(200));
      AddChartIndicator(Stochastics(stochPeriodD, stochPeriodK, stochSmooth));
      AddChartIndicator(SMA(emaLongLen));
      Panel = 1;
      AddChartIndicator(SMA(emaShortLen));
      Panel = 1;
      AddChartIndicator(ADXR(x,y));
      Panel = 2;
      ClearOutputWindow();

      Comment


        #4
        Hello jamesmjones00123,

        A small detail I overlooked in your code: You are changing the panel of the strategy instead of the Panel property of the indicator.

        I would recommend adding your indicators to your strategy as instances of those indicators, and then to change the Panel property of that indicator. I've attached a demonstration showing how this can be done.

        If there is anything else we can do to assist, please don't hesitate to reach back.
        Attached Files

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        61 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        40 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        21 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        23 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        51 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X