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 SalmaTrader, 07-07-2026, 10:26 PM
          0 responses
          35 views
          0 likes
          Last Post SalmaTrader  
          Started by CarlTrading, 07-05-2026, 01:16 PM
          0 responses
          20 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 06-17-2026, 10:32 AM
          0 responses
          12 views
          0 likes
          Last Post CaptainJack  
          Started by kinfxhk, 06-17-2026, 04:15 AM
          0 responses
          18 views
          0 likes
          Last Post kinfxhk
          by kinfxhk
           
          Started by kinfxhk, 06-17-2026, 04:06 AM
          0 responses
          20 views
          0 likes
          Last Post kinfxhk
          by kinfxhk
           
          Working...
          X