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 sjsj2732, Yesterday, 04:31 AM
        0 responses
        36 views
        0 likes
        Last Post sjsj2732  
        Started by NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        287 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        287 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        133 views
        1 like
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        95 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Working...
        X