# Ichimoku Kinko Hyo

A well-known Japanese charting system providing support/resistance, trend
direction, and momentum signals from a single chart overlay.

## Versions

| Version | File    | Notes                                                               |
|---------|---------|---------------------------------------------------------------------|
| v1      | v1.json | Core TK cross + price above Kijun                                   |
| v2      | v2.json | Adds Chikou Span check + cloud-colour filter (Span A > Span B)      |

## Components

| Component         | Formula                                            |
|-------------------|----------------------------------------------------|
| **Tenkan-sen**    | `(highest(high,9) + lowest(low,9)) / 2`            |
| **Kijun-sen**     | `(highest(high,26) + lowest(low,26)) / 2`          |
| **Senkou Span A** | `(Tenkan + Kijun) / 2` (current bar, not projected)|
| **Senkou Span B** | `(highest(high,52) + lowest(low,52)) / 2`          |
| **Chikou Span**   | Current close vs close 26 bars ago                 |

## Logic

**Entry** (v1): Tenkan crosses above Kijun AND close > Kijun.
**Entry** (v2): same PLUS close > close[26] (Chikou above past price) AND Span A > Span B (bullish cloud).
**Exit**: Tenkan crosses below Kijun.

## Data requirements

- 1h candles recommended.
- Minimum warmup: 52 candles for Span B + 26 candles offset for Chikou.

## Known limitations

- The cloud is normally plotted 26 bars *ahead*, giving a forward view of
  support/resistance. This is not possible in the DSL; Span A and B are computed
  at the current bar as a proxy for current cloud position.
- Chikou cross-check against Kumo (cloud) upper bound is omitted.
- No stop-loss; relies entirely on the Tenkan/Kijun exit crossover.
