CDLCOUNTERATTACK
CDLCOUNTERATTACK
Summary
A two-candle pattern of two long, opposite-colored real bodies whose closing prices are (nearly) equal. Emits a bullish signal when the second candle is white and a bearish signal when it is black (a reversal signal, though its trend context is not checked). A hit signals a reversal: +100 (white 2nd candle) bullish, -100 (black 2nd candle) bearish; significance depends on a prior trend the code does not check.
Notes
- Does not verify the prior trend the reversal signal classically assumes.
Inputs
inOpen— Open price of each barinHigh— High price of each barinLow— Low price of each barinClose— Close price of each bar
Outputs
outInteger— +100 when the second candle is white (bullish), -100 when it is black (bearish), 0 when no pattern
Properties
Numerical Stability: Start-Independent
| Display Flags |
|---|
| ☐ Overlap Input |
| ✅ Independent Y-Axis i |
| ✅ Candlestick i |
Implementation
TA-Lib Definition: cdlcounterattack.c · cdlcounterattack.yaml
| Native | File |
|---|---|
| C | ta_CDLCOUNTERATTACK.c |
| Rust | cdlcounterattack.rs |
| Java | Core_CDLCOUNTERATTACK.java |
TA-Lib is also available for Python, R and more using a wrapper.
Aliases
Counterattack, Counterattack Lines, Meeting Lines