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

Unsetting CandleOutlineBrush to default colour

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

    Unsetting CandleOutlineBrush to default colour

    Hi,
    I've coded an indicator with the following logic where I set the CandleOutlineBrush to a colour:
    CandleOutlineBrush = Brushes.Cyan;

    Am I correct in assuming that to be able to unset the colour back to the default, I just need to set it to null.
    i.e.
    CandleOutlineBrush = null;

    Thanks,
    iq

    #2
    Hi iq, thanks for posting. That is correct. It can be tested in a script by adding this to OnBarUpdate:
    Code:
    protected override void OnBarUpdate()
    {
      if(CurrentBar % 2 == 0)
      {
        CandleOutlineBrush = Brushes.Blue;
      }
      else
      {
        CandleOutlineBrush = null;
      }
    }
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chris.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Naouss, Today, 05:43 AM
      1 response
      8 views
      0 likes
      Last Post KonstantinosNT  
      Started by kainermy, Today, 05:22 AM
      0 responses
      9 views
      0 likes
      Last Post kainermy  
      Started by KlausTheMause, Yesterday, 02:57 PM
      1 response
      31 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by Jaggy, 02-04-2023, 07:24 PM
      1 response
      63 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by sjmuk1, Yesterday, 09:35 AM
      2 responses
      70 views
      0 likes
      Last Post sjmuk1
      by sjmuk1
       
      Working...
      X