Hello Grant,

Something along the lines of?

Periods = x;
AveBarRange = Sum(H-L,x)/x;

You can standardise (or normalise) by converting to %:

BarRangePercent = (H-L)/L * 100;
Periods = x;
AveBarRange = Sum(BarRangePercent,x)/x;

I always normalise in situations like that.
********************************************************************
SUM
- sum data over specified number of bars Moving averages, summation

 

SYNTAX  sum( ARRAY, periods )  
RETURNS ARRAY  
FUNCTION  Calculates a cumulative sum of the ARRAY for the specified 
number of lookback periods (including today).  
EXAMPLE The formula "sum( CLOSE, 14 )" returns the sum of the 
preceding 14 closing prices. A 14-period simple moving average could 
be written "sum(C,14) / 14." 
*********************************************************************

You can use the Param function for periods if you want to change the 
periods from with the context menu on a chart.

PARAM
- add user user-definable numeric parameter Exploration / Indicators
(AFL 2.3)
 

SYNTAX  Param( ''name'', defaultval, min, max, step, sincr = 0 )  
RETURNS NUMBER  
FUNCTION  Adds a new user-definable parameter, which will be 
accessible via Parameters dialog :
right click over chart pane and select "Parameters" or press Ctrl+R 
allows to change chart parameters - changes are reflected 
immediatelly. 

"name" - defines parameter name that will be displayed in the 
parameters dialog 
defaultval - defines default value of the parameter 
min, max - define minimum and maximum values of the parameter 
step - defines minimum increase of the parameter via slider in the 
Parameters dialog 
sincr - automatic section increment value (used by drag-drop 
interface to increase default values for parameters) 
WARNING: default/min/max/step parameters have to be CONSTANT numbers. 
This is because these values are cached and are not re-read during 
subsequent formula evaluations.


brian_z
 


--- In [email protected], "longarm61" <[EMAIL PROTECTED]> wrote:
>
> I would simply like an indicator that shows the average range, from 
> high to low, of x number of bars.  Just the bars only.  ATR takes 
> into account the previous close, which I don't want.
> 
> Anyone have or can point me to a formula for this?
> 
> Thanks in advance,
> 
> Grant
>


Reply via email to