Range

See Also...

Related Topics

 

 

Description

This formula identifies the range of a bar by calculating the difference between the high and low.

 

 

Formula

Range(instrument, index)=begin

  retval = NONUM

  pHigh = GetPrice(instrument, BATE_HIGH, index, 0)

  pLow = GetPrice(instrument, BATE_LOW, index, 0)

  if pHigh != NONUM then begin

    retval = pHigh - pLow

  end

  retval

end

 

 

Parameters

instrument

An instrument.

 

index

The bar, as oriented with the current bar, you want to evaluate.

 

 

Return Value

A range

 

 

Examples

DojiForm(instrument, targetBar, RealBodyPercentage)=begin

  return = FALSE

  cOpen = GetPrice(instrument, BATE_OPEN, targetBar, 0)

  cClose = GetPrice(instrument, BATE_CLOSE, targetBar, 0)

  thisRange = Range($1, targetBar)

  thisDiff = abs(Diff(cOpen, cClose))

  thisPercentage = Percentage(thisDiff, thisRange)

  if thisPercentage < RealBodyPercentage then return = TRUE

  return

end

 

 

Comments

NA

 

©2008 Aspen Research Group, Ltd. All rights reserved. Terms of Use.