Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator for Average Range (NOT ATR)

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

    Indicator for Average Range (NOT ATR)

    Hi,

    I was wondering if anyone has an indicator that calculates the simple average range over a set number of bars. For example, for 3 bars, average range=[(bar1 high - bar1 low)+(bar2 high - bar2 low)+(bar3 high - bar3 low)] / 3.

    I don't know how to script indicators so if anyone already has one that would be perfect. Thanks so much.

    #2
    Unfortunately I'm not aware of a readymade one, but you could use the help given here as a starting point - the sample calculates an SMA of the range of the last 20 bars, you could easily change this to 3 for your case - http://www.ninjatrader-support.com/H...eV6/Range.html

    Comment


      #3
      Hi. Thanks for that. I think it is what I am looking for. Could you please give me some instruction as to how I can create an indicator for the average range using Ninjascript? The only variable I want to be able to change is the number of bars used in the calculation (so I can calculate the average range over 5,10,100 etc. bars).

      Thanks so much,

      Comment


        #4
        I would suggest you start by checking into those tutorials on indicator coding here - http://www.ninjatrader-support.com/H...verview18.html

        Then you can just use the second snippet provided in the Range link from my previous post, it calcs over the set period of 20 bars.

        To create a customizable user defined input for this setting, please check into this link here -

        Comment


          #5
          Wouldn't this just be:

          Print("Average = " + (SMA(High, period)[0] - SMA(Low, period)[0])) // <=== untested

          Set the period to 3 for your purposes.

          Dan
          eDanny
          NinjaTrader Ecosystem Vendor - Integrity Traders

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          153 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          306 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          244 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          345 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          176 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Working...
          X