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

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 RubenCazorla, 08-30-2022, 06:36 AM
        3 responses
        77 views
        0 likes
        Last Post PaulMohn  
        Started by f.saeidi, Yesterday, 12:14 PM
        9 responses
        23 views
        0 likes
        Last Post f.saeidi  
        Started by Tim-c, Today, 03:54 AM
        0 responses
        3 views
        0 likes
        Last Post Tim-c
        by Tim-c
         
        Started by FrancisMorro, Today, 03:24 AM
        0 responses
        5 views
        0 likes
        Last Post FrancisMorro  
        Started by Segwin, 05-07-2018, 02:15 PM
        10 responses
        1,772 views
        0 likes
        Last Post Leafcutter  
        Working...
        X