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 bortz, 11-06-2023, 08:04 AM
            47 responses
            1,610 views
            0 likes
            Last Post aligator  
            Started by jaybedreamin, Today, 05:56 PM
            0 responses
            9 views
            0 likes
            Last Post jaybedreamin  
            Started by DJ888, 04-16-2024, 06:09 PM
            6 responses
            19 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by Jon17, Today, 04:33 PM
            0 responses
            6 views
            0 likes
            Last Post Jon17
            by Jon17
             
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            16 views
            0 likes
            Last Post Javierw.ok  
            Working...
            X