DojiForm

See Also...

Related Topics

 

 

Description

A Doji is a day on which the open and close are virtually identical:

 

 

DojiForm() determines whether a bar is a Doji. The realBodyPercentage argument enables you include candlesticks that are not literal Dojis.

 

 

Formula

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

 

 

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.

 

realBodyPercentage

A number, expressed as a percentage, between 0 and 100 that determines how large a real body may be. 0 is no real body (see also StarForm()). 10 is a real body that is 10 percent of the range.

 

 

Return Value

TRUE or FALSE

 

 

Examples

Doji(INPUT, RealBodyPercentage=10)=begin

  retval = NONUM

  targetBar = 0

  if DojiForm($1, targetBar, RealBodyPercentage) == TRUE
then retval = 'D'|clr_gray|arrow|above|vertical|ftiny

  retval

end

 

 

Comments

See also StarForm()

 

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