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

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.
          Kate W.NinjaTrader Customer Service

          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

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by XXtrader, Yesterday, 11:30 PM
              2 responses
              11 views
              0 likes
              Last Post XXtrader  
              Started by Waxavi, Today, 02:10 AM
              0 responses
              6 views
              0 likes
              Last Post Waxavi
              by Waxavi
               
              Started by TradeForge, Today, 02:09 AM
              0 responses
              11 views
              0 likes
              Last Post TradeForge  
              Started by Waxavi, Today, 02:00 AM
              0 responses
              2 views
              0 likes
              Last Post Waxavi
              by Waxavi
               
              Started by elirion, Today, 01:36 AM
              0 responses
              7 views
              0 likes
              Last Post elirion
              by elirion
               
              Working...
              X