Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Inside Bar Calculation

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

    Inside Bar Calculation

    I have been using the the Inside bar indicator and like it but am wondering if there is an additional version with an equal to added to the greater than or less than portion of the equation.

    The current one will only paint a bar if the current high is less than the previous high and the current low is higher than the previous low. It would be nice if it also painted the inside bars where the high or the low were the same as the previous bar.

    Is that version available?

    JC

    #2
    Hello JC,

    I modified the inside bar indicator for you so that the high/low could have the same highs/lows.

    Please let us know if you need further assistance.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thank you

      That is perfect....And very fast!!!!

      Thanks for the help Alan!

      JC

      Comment


        #4
        Alan P. Thanks for this special inside bar indicator! It's better than the one I found recently. I'm looking for an outside bar indicator to plot the same way.

        If you want to put one together (Outside Bar) that would be awesome! A special type, that performs the same if the high or low is the same.


        //=============================== OUTSIDEBAR
        if (High[0] > High[1] && Low[0] < Low[1] && IsFirstTickOfBar) // outside bar


        I've been trying to script one it's just not going so great I'm not as fluent in coding.

        When outside and an inside bar happen close together or consecutive = breakout mode. Failures work pretty good too. Especially after some kind of trend, but not before, those breakouts do work.

        Comment


          #5
          Hello trdninstyle,

          Thank you for your reply.

          Actually, this is a super easy thing you can do yourself, which I'd suggest as a learning experience. All that you'd need to do is to open the specialinsidebar indicator, right click on it > Save as, and save it with a new name, maybe specialoutsidebar. From there, there's only one line to change. You'd just need to change this line:

          Code:
          if(High[0]<=High[1] && Low[0]>=Low[1])
          to:

          Code:
          if (High[0] >= High[1] && Low[0] <= Low[1])
          That should give you the outside bar functionality you're looking for.

          Please let us know if we may be of further assistance to you.

          Comment


            #6
            It was so easy I still can't get over it! I came back here to post that I figured it out and you beat me to it. Just turning around the < > to > < lol but first finding Alans special indicator right here got it started. Thank you, Kate!!

            How do I combine both functions on one indicator? So, I don't have to have two separate indicators.
            I know it's something very simple, maybe a comma or something?

            if(CurrentBar<2) return;

            if(High[0]>=High[1] && Low[0]<=Low[1])
            if(High[0]<=High[1] && Low[0]>=Low[1])
            Attached Files
            Last edited by trdninstyle; 02-25-2022, 07:30 PM.

            Comment


              #7
              I actually figured out how to make changes so an (ii) InSideBarUp will paint a darker green and red for a InSideDownBar to be a dark red, additionally also the real body to count as a variant InSideUp or Down. Also of course an OutSideUp & OutSideDown in perspective colors.


              if(Close[0]<=Open[0] && Close[0]>=Low[1] && Open[0]<=High[1])

              I like it helps a lot.
              Attached Files

              Comment


                #8
                Is there a way to modify the inside bar indicator to only paint the bar outline and maybe the wick rather than the entire bar? Thank you Alan for the indicator and Kate for the outside modification.

                Comment


                  #9
                  Hello RobEB,

                  To change the candleoutline brush:
                  CandleOutlineBrush = Brushes.Black;

                  Below is a link to the documentation.
                  Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    Hi Chelsea,

                    Thank you for the reply. I tried to amend the indicator however it continues to paint the entire bar and not just the outline. I have zero coding experience other than very simple modifications to already written code.

                    I have tried multiple variations and cannot figure this out. Is there another modification somewhere in the code?

                    As an aside is there a very simple, step by step instruction for the strategy builder? By simple I mean elementary level, possibly preschool.

                    Thank you again and have a great holiday!
                    Rob B

                    Comment


                      #11
                      Hello Rob,

                      In the Strategy Builder in the Actions window this would be Drawing > Set candle outline color.

                      Have you removed the BarBrush = BorderBrush; line of code that is setting the bar color?
                      Have you added CandleOutlineBrush = BorderBrush; in it's place?

                      A basic understanding of C# programming is prerequisite to writing NinjaScript code. Below is a link to a support article with helpful resources on getting started with C# and NinjaScript.


                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        Well I have now and it's exactly what I had in mind. I would swear I tried that.

                        In any case your help is very much appreciated.

                        I should have clarified that the Strategy Builder question was a separate ask. I'm just looking for a basic, step by step, strategy builder lesson or lessons. A Strategy Builder for Dummies if you will.

                        Thank you,
                        Rob B

                        Comment


                          #13
                          Hello Rob,

                          Be sure to make a new thread (or send a new email) for new inquiries.

                          Below is a link to a support article with helpful resources on getting started with NinjaScript.


                          From this article there is the 'Automate Your Trading with NinjaTrader's Strategy Builder' video and the help guide strategy builder tutorial examples.
                          Chelsea B.NinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                          0 responses
                          557 views
                          0 likes
                          Last Post Geovanny Suaza  
                          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                          0 responses
                          324 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by Mindset, 02-09-2026, 11:44 AM
                          0 responses
                          101 views
                          0 likes
                          Last Post Mindset
                          by Mindset
                           
                          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                          0 responses
                          545 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by RFrosty, 01-28-2026, 06:49 PM
                          0 responses
                          547 views
                          1 like
                          Last Post RFrosty
                          by RFrosty
                           
                          Working...
                          X