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

Swing(10).SwingLow[0].Pen.Color.Orange

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

    Swing(10).SwingLow[0].Pen.Color.Orange

    trying to change color of Swing(10)from it's default color to "orange" and include it with the following.
    Code:
    [SIZE=2][FONT=Courier New][COLOR=#0000ff]protected[/COLOR][/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] Initialize()[/SIZE][/FONT]
     
    [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]Add(Swing(littleswing));[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]Swing(10).Plots[[/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]].Pen.Color = Color.DimGray;[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]Swing(10).Plots[[/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]].Pen.DashStyle = DashStyle.Solid; [/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]Swing(10).Plots[[/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]].PlotStyle = PlotStyle.Hash;[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]Swing(10).Plots[[/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]].Pen.Width = [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2];[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]Swing(10).Plots[[/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]].Pen.Color = Color.DimGray;[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]Swing(10).Plots[[/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]].Pen.DashStyle = DashStyle.Solid; [/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]Swing(10).Plots[[/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]].PlotStyle = PlotStyle.Hash;[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]Swing(10).Plots[[/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]].Pen.Width = [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2];[/SIZE][/FONT]
    [/SIZE][/FONT]
    Code:
    [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
    [SIZE=2][FONT=Courier New]EnterShort(DefaultQuantity, [/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800000]"Green Bar short"[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]);[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]BarColor = Color.Green;[/FONT][/SIZE]
     
    [COLOR=blue][B]Swing(10).SwingLow[0].Pen.Color.Orange[/B][/COLOR]
     
    [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]

    #2
    Please set the color also from the Initialize() (instead of your Color.DimGray), as you cannot change it dynamically in the OnBarUpdate() - Thanks!
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Swing(10) color change

      so i can't have the "DimGray" change to "Orange" when conditions are met ?

      Comment


        #4
        duck_CA,

        What you are trying to do is a multi-color plot. To do this you would need to significantly modify your Swing indicator. Please take a look at this reference sample: http://www.ninjatrader-support2.com/...ead.php?t=3227
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Swing(10).SwingHighBar(0, 1, 30) >= Swing(30).SwingHighBar(0, 1, 30))

          what is this saying?
          trying to make it say: the last Swing.SwingHigh (10) (not the bar but point where the line is drawn) >= the last Swing.SwingHigh (30)

          Comment


            #6
            For this you would need to reference the previous swing values with the two methods supplied in the swing indicator - http://www.ninjatrader-support.com/H...eV6/Swing.html
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Barry Milan, Today, 10:35 PM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by WeyldFalcon, 12-10-2020, 06:48 PM
            14 responses
            1,428 views
            0 likes
            Last Post Handclap0241  
            Started by DJ888, Yesterday, 06:09 PM
            2 responses
            9 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            40 views
            0 likes
            Last Post jeronymite  
            Started by bill2023, Today, 08:51 AM
            2 responses
            16 views
            0 likes
            Last Post bill2023  
            Working...
            X