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.
    JimNinjaTrader Customer Service

    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
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by trilliantrader, 04-18-2024, 08:16 AM
        5 responses
        22 views
        0 likes
        Last Post trilliantrader  
        Started by Davidtowleii, Today, 12:15 AM
        0 responses
        3 views
        0 likes
        Last Post Davidtowleii  
        Started by guillembm, Yesterday, 11:25 AM
        2 responses
        9 views
        0 likes
        Last Post guillembm  
        Started by junkone, 04-21-2024, 07:17 AM
        9 responses
        68 views
        0 likes
        Last Post jeronymite  
        Started by mgco4you, Yesterday, 09:46 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X