Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plot Bollinger.Upper in stratey

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

    Plot Bollinger.Upper in stratey

    Hi,
    in my strategy I don't be able to plot only Bolliner Upper band.

    If i try to compile this :
    (Bollinger(2,20)).Plots[0].Pen.Color = Color.Blue;
    Add(Bollinger(2,20));
    It works properly, but if I compile this :

    (Bollinger(2,20).Upper).Plots[0].Pen.Color = Color.Blue;
    Add(Bollinger(2,20).Upper);

    It give me an error... what is the correct syntax?
    And if I'd like to have the Dots instead of continuos-line ?

    Thanks so much for your help
    Luca

    #2
    Hello Luca,

    That is because "Plots" is on object of Indicator. When your are referencing the "Upper" it would just be a plot. You may want to change the Plots[x] value to the Plot that you would like to change, for example:

    Code:
    (Bollinger(2,20)).Plots[0].Pen.Color = Color.Blue;         // Upper band
    (Bollinger(2,20)).Plots[1].Pen.Color = Color.Red;          // Middle band
    (Bollinger(2,20)).Plots[2].Pen.Color = Color.Green;       // Lower band
    
    (Bollinger(2,20)).Plots[0].Pen.DashStyle = DashStyle.Dot;     // Upper band DashStyle
    Let us know if we can be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Great .. very good !

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      64 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      149 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      99 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      286 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X