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 Hwop38, 05-04-2026, 07:02 PM
          0 responses
          164 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          318 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          246 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          350 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          179 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Working...
          X