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 samish18, Yesterday, 08:31 AM
        4 responses
        14 views
        0 likes
        Last Post elirion
        by elirion
         
        Started by funk10101, Yesterday, 09:43 PM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by TheWhiteDragon, 01-21-2019, 12:44 PM
        5 responses
        551 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by rtwave, 04-12-2024, 09:30 AM
        5 responses
        37 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by funk10101, Today, 12:02 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Working...
        X