BodyPercent

See Also...

Related Topics

 

 

Description

This function identifies the range as a percentage of the last price.

 

 

Formula

BodyPercent(instrument, targetBar)={

  retval = -1

  if Body(instrument, targetBar)==abs(RealBodyLen(instrument, targetBar)) then retval = 100

  if Body(instrument, targetBar) != abs(RealBodyLen(instrument, targetBar)) then {

    retval = (Body(instrument, targetBar)/instrument.last) * 100

  }

  retval

}

 

 

Parameters

instrument

An instrument.

 

targetBar

The index of the bar you want to evaluate. 0 is the current bar, 1 is the first bar back, etc.

 

 

Return Value

The range as a percentage of the last price.

 

 

Examples

LongBlackForm(instrument, targetBar)={

  return = FALSE

  if BodyPercent(instrument, targetBar) > CLONG then {

    if abs(RealBody(instrument, targetBar)) > CLONGREAL then {

      if vchart(instrument.last[GetBar(targetBar)]) < vchart(instrument.open[GetBar(targetBar)]) then {

        if vchart(instrument.open[GetBar(targetBar)]) < vchart(instrument.high[GetBar(targetBar)]) then {

          if vchart(instrument.last[GetBar(targetBar)]) >= vchart(instrument.low[GetBar(targetBar)]) then return = TRUE

        }

        if vchart(instrument.last[GetBar(targetBar)]) > vchart(instrument.low[GetBar(targetBar)]) then {

          if vchart(instrument.open[GetBar(targetBar)]) <=   vchart(instrument.high[GetBar(targetBar)]) then return = TRUE

        }

      }

    }

  }

  return

}

 

 

Comments

NA

 

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