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

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 terofs, Yesterday, 04:18 PM
        1 response
        22 views
        0 likes
        Last Post terofs
        by terofs
         
        Started by CommonWhale, Today, 09:55 AM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by Gerik, Today, 09:40 AM
        2 responses
        7 views
        0 likes
        Last Post Gerik
        by Gerik
         
        Started by RookieTrader, Today, 09:37 AM
        2 responses
        13 views
        0 likes
        Last Post RookieTrader  
        Started by alifarahani, Today, 09:40 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X