Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bar Color script using Else condition since Brushes.Empty is n/a

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

    Bar Color script using Else condition since Brushes.Empty is n/a

    Hello,
    With a simple script in NT7 to color bars but allow default colors to remain
    Code:
    if (ColorBars) BarColor = (_signal[0] == 1 ? Color.White : _signal[0] == -1 ? Color.Black : Color.Empty);
    What is the new method in NT8 to allow default color to remain for the else condition since Color.Empty (ie Brushes.Empty) is not available?

    kz
    Last edited by zeller4; 08-19-2018, 05:14 AM.

    #2
    Hello zeller4,

    Thank you for your note.

    Would Brushes.Transparent work for what you're trying to do?

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hello zeller4,

      Thank you for your note.

      Would Brushes.Transparent work for what you're trying to do?

      I look forward to your reply.



      Not if I'm still trying to see the unaffected bar up/down color and outline...

      Comment


        #4
        Hello zeller4,

        If you want the original bar color to remain unchanged, don't set it. For example the code below will only set the BarBrush to yellow if the close on this bar is greater than the last, otherwise the color will remain unchanged.

        Code:
        if(Close[0]>Close[1])
        BarBrush = Brushes.Yellow;
        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        571 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        330 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        548 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        549 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X