Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Same indicators, different PlotStyle

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

    Same indicators, different PlotStyle

    Hi,

    I am trying to add one indicator twice with different PlotStyle:
    1. CCI(50) with PlotStyle=Line
    2. CCI(50) with PlotStyle=Bar

    I would like to have them both in my strategy in same panel but I can't manage that...my code for the first CCI(50) is:

    Code:
    protected override void Initialize() {
        CCI(50).Panel = 1;
        CCI(50).Plots[0].Pen.Color = Color.Black;
        CCI(50).Lines[0].Pen.Color = Color.Red;
        CCI(50).Lines[0].Value = 190;
        CCI(50).Lines[1].Pen.Color = Color.Blue;
        CCI(50).Lines[2].Pen.Color = Color.Black;
        CCI(50).Lines[3].Pen.Color = Color.Blue;
        CCI(50).Lines[4].Pen.Color = Color.Red;
        CCI(50).Lines[4].Value = -190;
        Add(CCI(50));
    ...
    }
    Please advise, thank you.

    #2
    Hello antonek,
    You can only assign one plot style to any particular indicator.

    You can however create a copy of the CCI indicator (say name it CCI1) and can reference it in your strategy.
    • In Control Center menu bar goto Tools>Edit NinjaScirpt>Indicaor
    • Open the CCI indicator, right click on it
    • In the context menu click on Save as, and save it as CCI1


    Now you can reference it as

    Code:
    CCI(50).Plots[0].PlotStyle = PlotStyle.Bar;
    CCI1(50).Plots[0].PlotStyle = PlotStyle.Line;
    Add(CCI(50));
    Add(CCI1(50);
    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      That could be the workaround I am looking for. Thanks.

      Comment


        #4
        Hello antonek,
        Thanks for your note.
        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        47 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        15 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        21 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X