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

Background Color

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

    Background Color

    I put together a little indicator that changes the background color (backcolor=) for bars that occur during a specified period of the day, based on parameters. What I would like to do is allow someone to choose their own background color from the Indicators panel, like a normal plotted indicator, but I'm not really doing a plot here. Any suggestions?

    #2
    imported post

    Please try setting up an indicator with one plot and just don't set any value for the plot series. You then should be fine.

    Comment


      #3
      imported post


      Take a look at the source code for VolumeProfile indicator.

      Pay attention to the following:

      Color variables under the Variables section Color properties under the properties section

      - You need to include a property that exposes the color variable

      - You need to include a property that serializes the color
      RayNinjaTrader Customer Service

      Comment


        #4
        Some what of a follow up question. I am using BackColorAll and this paints the entire chart. Is there a way of limiting the painting of the background to just the panel that the indicator is running in? If my indicator is running in panel 2, I just want the background area of panel 2 painted. Right now I get panel 1 and 2 painted.

        Comment


          #5
          Have you tried the property BackColor ?

          See this link - http://www.ninjatrader-support.com/H...BackColor.html
          RayNinjaTrader Customer Service

          Comment


            #6
            Thanks, That did the trick.

            A suggestion: IN the documentation maybe you could cross link property(s) that are similar in nature, like BackColor and BackColorAll.

            Comment


              #7
              Thanks for your suggestion.
              RayNinjaTrader Customer Service

              Comment


                #8
                Does BackColor and BackColorAll only work for indicators? I can't quite seem to get it to paint its colors in my strategy.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Yes it should.

                  In case it does not:
                  - please post simple-as-possible indicator and startegy to demonstrate the problem
                  - which instrument and time frame did you try?

                  Thanks

                  Comment


                    #10
                    From what you are saying it seems like I need an indicator that utilizes BackColor on my charts for when I run a strategy for it to paint anything. What I was hoping for was to be able to call the BackColor() from within my strategy without having to go to an indicator. I just wanted to paint the bars where my strategy entered and where it exited to make it stand out more.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      Sorry, misunderstanding. Yes BackColor(All) works for strategies as well.

                      Comment


                        #12
                        Hallo, I'm resolving this:

                        My main chart for manual trading is NQ. I want to change background of this chart in depence of NYSE TICK, e.g. Tick is > 900, I want to change backcolor to green, TICK is < -900, backcolor has to be red. I have read here that it's not possible to create indicator depending on two different instruments. So I tried to create strategy, but it doesn't work. How to join strategy to chart?
                        Thanks
                        maitreja

                        if(BarsInProgress == 1){
                        if(Close[0] < -900 ){
                        BackColorAll = Color.Red;
                        }
                        else if(Close[0] > 900){
                        BackColorAll = Color.Green;
                        }
                        }

                        Comment


                          #13
                          Hi maitreja,

                          To add a strategy to a chart you need to first be connected to a data feed.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #14
                            Hi Josh, I'm connected

                            Comment


                              #15
                              Press Ctrl+S from your chart to bring up the Strategy selection window. You will then need to add your strategy to the chart.
                              Josh P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by traderqz, Yesterday, 09:06 AM
                              3 responses
                              20 views
                              0 likes
                              Last Post NinjaTrader_ThomasC  
                              Started by f.saeidi, Today, 10:19 AM
                              1 response
                              4 views
                              0 likes
                              Last Post NinjaTrader_BrandonH  
                              Started by kujista, Today, 06:23 AM
                              5 responses
                              15 views
                              0 likes
                              Last Post kujista
                              by kujista
                               
                              Started by traderqz, Today, 12:06 AM
                              3 responses
                              6 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by RideMe, 04-07-2024, 04:54 PM
                              5 responses
                              28 views
                              0 likes
                              Last Post NinjaTrader_BrandonH  
                              Working...
                              X