BodyTopQuarter

See Also...

Related Topics

 

 

Description

This function returns the price level that indicates the bottom of the top quarter of a bar's range (the red line in the image below):

 

 

 

Formula

BodyTopQuarter(instrument, targetBar)=begin

  pHigh = GetPrice($1, BATE_HIGH, targetBar, 0)

  pLow = GetPrice($1, BATE_LOW, targetBar, 0)

  nvSub = Abs(Diff(pHigh, pLow)) / 4

  retval = pHigh - nvSub

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.

 

 

Return Value

A price that represents the top quarter of a bar's range.

 

 

Examples

SpinningTop(INPUT, Stringency=3, DojiPercentage=10)=begin

  retval = NONUM

  targetBar = 0

  tQtr = BodyTopQuarter($1, targetBar)

  rbLow = RealBodyLow($1, targetBar)

  pHigh = GetPrice($1, BATE_HIGH, targetBar, 0)
 

  if DojiForm($1, targetBar, DojiPercentage) then begin

    if rbLow > tQtr then begin

      if Stringency >= 3 then retval =   
'3'|clr_gray|below|vertical|ftiny|arrow

      if StarForm($1, targetBar) then begin

        if Stringency >= 2 then retval =
  '2'|clr_gray|below|vertical|ftiny|arrow

        if rbLow == pHigh then retval = 'SPINNING
  TOP'|clr_gray|below|vertical|ftiny|arrow

      end

    end

  end

  retval

end

 

 

Comments

NA

 

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