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

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 pechtri, 06-22-2023, 02:31 AM
          10 responses
          124 views
          0 likes
          Last Post Leeroy_Jenkins  
          Started by judysamnt7, 03-13-2023, 09:11 AM
          4 responses
          59 views
          0 likes
          Last Post DynamicTest  
          Started by ScottWalsh, Yesterday, 06:52 PM
          4 responses
          36 views
          0 likes
          Last Post ScottWalsh  
          Started by olisav57, Yesterday, 07:39 PM
          0 responses
          7 views
          0 likes
          Last Post olisav57  
          Started by trilliantrader, Yesterday, 03:01 PM
          2 responses
          22 views
          0 likes
          Last Post helpwanted  
          Working...
          X