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

Colour regions

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

    Colour regions

    I wish to color a timed region on the chart extending from the highs to the lows of the period.Can you aplease ssist with an example of how I might go about this.

    #2
    cptrader,

    Here is an example : http://www.ninjatrader.com/support/f...ead.php?t=3227

    Please let me know if I may assist further.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      I have attached a snap of what I am looking for. I want to program a box from two different times from the highs and lows of that period. I can code the whole area just not sure how to limit the coloring between highs and lows.
      Attached Files

      Comment


        #4
        cptrader,

        Is this kind of what you are looking for? : http://www.ninjatrader.com/support/f...ad.php?t=49802
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          Hi Adam This link brings me back to you last post.

          Comment


            #6
            cptrader,

            Apologies, here is the link : http://www.ninjatrader.com/support/f...d=4&linkid=350
            Adam P.NinjaTrader Customer Service

            Comment


              #7
              Hi Adam
              The link you sent me is about bollinger bands which I am not sure how it applies to what I want.
              The following code is what I currently use to high light an area.

              if(ToTime(Time[0]) >= 83000 && ToTime(Time[0]) <= 83500)
              {BackColor = Color.PaleTurquoise;
              DrawText("my tag3", "Warning", 0, High[0]+TickSize*10, Color.Black) ;
              }
              Instead of doing the whole area, I want the colored area to be between the high and lows of the prescribed period. Thanks

              Comment


                #8
                cptrader,

                Do you want your chart to be similar to that indicator that I sent? In other words, have a colored area between two plots? Or are you OK with plotting rectangles to color in an area.
                Adam P.NinjaTrader Customer Service

                Comment


                  #9
                  I was hoping to use another piece of code that used something instead of BackColor that plotted a background color from the times indicated in the code but only stretched from the highs to the lows of the period. An example is the snap I posted earlier.(Which was done using a manual box.)

                  Comment


                    #10
                    Can you also recheck the link you sent as I am not sure how it relates to what I am talking about?

                    Comment


                      #11
                      cptrader,

                      Apologies, I believe we are having a misunderstanding here.

                      This image : http://www.ninjatrader.com/support/f...kid=350&size=0 has colors between the upper and lower bollinger band. You mentioned coloring only between the highs and lows, as such I am wondering if you wanted to color similar to these bollinger bands, but between your high and low. I.e. instead of using squares, have the chart change color between two plots for example.
                      Adam P.NinjaTrader Customer Service

                      Comment


                        #12
                        Sorry.When I say highs and lows I mean a coloured box between the two times indicated and stretching from the highest high to the lowest low for the period.

                        Comment


                          #13
                          cptrader,

                          Here is how you can get the highest high and lowest low over a period set to PeriodValue.

                          Code:
                          int highesthigh_index = HighestBar(High,PeriodValue);
                          int lowestlow_index = LowestBar(Low,PeriodValue);
                          		
                          double highesthigh = High[highesthigh_index];
                          double lowestlow = Low[lowestlow_index];
                          From here, you can draw them using either DrawRectangle command :

                          DrawRectangle(string tag, bool autoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, Color color, Color areaColor, int areaOpacity)

                          DrawRectangle(string tag, bool autoScale, DateTime startTime, double startY, DateTime endTime, double endY, Color color, Color areaColor, int areaOpacity)

                          If you are trying to do this between 8:30 and 8:35, I would suggest translating the "PeriodValue" to reflect this time range, and have your indicator calculate at 8:35.

                          What sort of chart are you wanting to use this indicator on?
                          Adam P.NinjaTrader Customer Service

                          Comment


                            #14
                            Thank you. I was initially looking at using it on 5 min, range and renko charts.

                            Comment


                              #15
                              cptrader,

                              It should work just fine on these charts, however please note that with time independent charts such as renko or range charts they wont have the same amount of time per bar, so it may be a little difficult to sync it exactly to a time. Anyway, please let me know if I may assist further.
                              Adam P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by stafe, 04-15-2024, 08:34 PM
                              7 responses
                              31 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by adeelshahzad, Today, 03:54 AM
                              4 responses
                              29 views
                              0 likes
                              Last Post adeelshahzad  
                              Started by merzo, 06-25-2023, 02:19 AM
                              10 responses
                              823 views
                              1 like
                              Last Post NinjaTrader_ChristopherJ  
                              Started by frankthearm, Today, 09:08 AM
                              5 responses
                              17 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by jeronymite, 04-12-2024, 04:26 PM
                              3 responses
                              43 views
                              0 likes
                              Last Post jeronymite  
                              Working...
                              X