Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 StockTrader88, 03-06-2021, 08:58 AM
      45 responses
      3,991 views
      3 likes
      Last Post johntraderuser2  
      Started by TAJTrades, Today, 09:46 AM
      0 responses
      7 views
      0 likes
      Last Post TAJTrades  
      Started by rhyminkevin, Yesterday, 04:58 PM
      5 responses
      62 views
      0 likes
      Last Post dp8282
      by dp8282
       
      Started by realblubb, Today, 09:28 AM
      0 responses
      8 views
      0 likes
      Last Post realblubb  
      Started by AaronKoRn, Yesterday, 09:49 PM
      1 response
      19 views
      0 likes
      Last Post Rikazkhan007  
      Working...
      X