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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      64 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      35 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      59 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      62 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      51 views
      0 likes
      Last Post CarlTrading  
      Working...
      X