Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

nBar Back

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

    nBar Back

    Hi,
    Lately I have been asking a lot of questions, so I do appreacite all the fast answers very much from the NT team.

    I have found a indicator that I want to change slightly. I draws a rectangle on the current bar based on the last bar's range. I'll like to draw the rectangle base on the range of the last 3 already form bars.

    if publicint NBar = 1;// Default is PriorBar

    and a 3 give me only the 3 bar back, how can I set this up to be

    NBar = range of last three bars.?

    thanks again for all your help. you guys rock!!!

    #2
    Hello Ccowl1,

    Thank you for the feedback and kind words. We appreciate it.

    It depends here how the indicator is written and what you would like to do with 3 day range.

    You can use built in indicator ATR() to get an average of true range and specify 3 bars.

    You can use built in method SUM() to add up the range for the last 3 bars. If you can share more of the code that makes the calculations we can advise further.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      I think I explained it wrong.

      The indicator is a high/low indicator. It draws around the current bar a rectangle with the high and low of the previous candle. I'd like it to draw a rectangle around the the last 3 and the current candle( so there will be 4 bars total in the rectangle) and showing the highest high and lowest low of those 3 fully formed candles.

      here is the code,

      Thank you very much.
      Attached Files

      Comment


        #4
        Hi CCowl,

        Unfortunatley we can't assist with the changes needed here. The author overrides the plot method to draw rectangles, which is not supported. I suggest contacting the author of the indicator to see if they're able to change for you.

        If you just wanted to draw a rectange around the highest high and lowest low of the last 4 bars, this can be expressed with:

        DrawRectangle("myRectangle", 4, MAX(High,4)[0], 0,MIN(Low, 4)[0], Color.Blue);
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        576 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 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
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X