Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to make indicator display simple colored status

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

    How to make indicator display simple colored status

    Hi, I just made my first indicator, which I want to display a red or green bar, according to a simple condition.

    I managed to make it display a red or green block, but I would like it to look like the example with the black background.

    How do I do it? Does anybody have an example?

    Thanks

    Christian
    Attached Files

    #2
    Hi Christian,

    Thanks for the post and welcome to the NinjaTrader forums. For a black background, this can be set through the chart's Right Click > Properties screen.

    If you want to set programatically, you can use:

    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks Ryan,

      sorry if I wasn't clear enough - the black background was not the problem. I would like to get the indicator to post these narrow horizontal color bands seen in the example with the black background.

      Comment


        #4
        It looks like it is conditionally changing background color. You can do that with the properties linked earlier.

        if (Close[0] > Open[0])
        BackColor = Color.Green;

        else
        BackColor = Color.Purple
        Attached Files
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          That makes sense, I didn't think of that.

          Thank you

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CaptainJack, 05-29-2026, 05:09 AM
          0 responses
          176 views
          0 likes
          Last Post CaptainJack  
          Started by CaptainJack, 05-29-2026, 12:02 AM
          0 responses
          93 views
          0 likes
          Last Post CaptainJack  
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          130 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          210 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          186 views
          0 likes
          Last Post CarlTrading  
          Working...
          X