CounterAttack

See Also...

Related Topics

 

 

Description

The Counter Attack pattern occurs when two opposite colored candlesticks share the same close.

 

A Counter Attack line can be bullish or bearish. A bullish counter attack occurs in a down trend. A long black body is followed by a white bodied candlestick that opens sharply lower and closes unchanged.

 

A bearish counter attack occurs in an up trend. A long white body is followed by a black body that opens sharply higher and closes unchanged.

 

 

Formula

CounterAttack(INPUT, Stringency=3)=begin

  retval = NONUM

  targetBar = 0

  cClose = GetPrice($1, BATE_CLOSE, targetBar, 0)

  pClose = GetPrice($1, BATE_CLOSE, (targetBar + 1), 0)

  cRange = Range($1, targetBar)

  pRange = Range($1, (targetBar + 1))

 

  if BlackBody($1, targetBar) AND WhiteBody($1, (targetBar + 1)) then begin

    if cClose == pClose then begin

      if Stringency >= 3 then retval = '3'|clr_red|arrow|vertical|ftiny|above

      if cRange > pRange then begin

        if Stringency >= 2 then retval = '2'|clr_red|arrow|vertical|ftiny|above

        if LongForm($1, targetBar) then begin

          retval = 'Counter Attack'|clr_black|arrow|vertical|ftiny|above

        end

      end

    end

  end

 

  if WhiteBody($1, targetBar) AND BlackBody($1, (targetBar + 1)) then begin

    if cClose == pClose then begin

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

      if cRange > pRange then begin

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

        if LongForm($1, targetBar) then begin

          retval = 'Counter Attack'|clr_black|arrow|vertical|ftiny|below

        end

      end

    end

  end

  retval

end

 

 

Parameters

INPUT

The INPUT directive makes this formula available as a Formula Overlay. INPUT refers to the instrument in the chart.

 

Stringency

The Stringency argument is used by nearly all candlestick overlays. It controls how many tests must pass in the evaluation of Counter Attack lines. The lower the number, the more strict the interpretation.

 

The Stringency argument is an overlay parameter. You can adjust it using the Parameters dialog. The default is 3.

 

 

Return Value

The return value is a string plot and varies depending on the value of the Stringency parameter.  The lower the number, the stronger the pattern.

 

Bearish indicators are rendered in red above the candlestick. Bullish indicators are rendered in green below the candlestick.

 

The string plot for a fully qualified Counter Attack is "Counter Attack" rendered in black above (bearish) or below (bullish) the candlestick.

 

 

Examples

 

 

Comments

NA

 

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