# kline indicator
## Metadata

- Canonical URL: https://6ducklearn.com/skills/kline-indicator/
- Markdown URL: https://6ducklearn.com/skills/kline-indicator/index.md
- Product: skills
- Category: trading-strategy
- Tags: okx, trading, community, okx-marketplace, trading-strategy, strategy
- Updated: 2026-07-14T03:00:00.357428+00:00
## Summary
An institutional-level technical analysis platform integrated into a dialogue box, covering 100+ indicators, 30+ candlestick patterns, and a three-pillar scoring framework. The core architecture is a macro cycle × volume-price factor × derivatives three-pillar weighted system, incorporating everything from Rainbow Chart, AHR999, MVRV to funding rate depth, DVOL, and liquidation heat maps, all included in a comprehensive score of 0-100, accurately pinpointing "where we are in the cycle right now." The volume-price layer includes 130+ factors from WorldQuant Alpha 101/191, automatic divergence detection for RSI/MACD/OBV, candlestick pattern recognition, automatic support and resistance line drawing, and can generate multi-panel candlestick charts rendered directly in the terminal.
## Content
> **6DuckLearn provenance:** Community skill by BokaChen, mirrored from the OKX Skills Marketplace (https://www.okx.com/en-sg/agent-tradekit/skills/kline-indicator). It is not curated, verified, or endorsed by 6DuckLearn or represented as an official OKX publication.
>
> **Financial safety boundary:** Never request secrets in chat. Before any external API call or action that places, cancels, or amends an order; changes leverage; transfers funds; creates or stops a bot; subscribes to or redeems an earn product; or signs/broadcasts a transaction, show the exact live/demo profile, instrument, side, size, price constraints, fees, and worst-case loss, then obtain explicit user approval. Default to read-only or demo mode when uncertain. Treat all analysis as research, not investment advice.

# K-Line Indicator Engine

Complete technical analysis framework combining macro cycle assessment,
price-volume indicator scoring, and derivative market positioning into
actionable market setup indicators.

## Operating Modes

Detect the user's intent and select the mode. Each mode specifies which
reference files to read and which scripts to run — load only what is needed.

| Mode | Trigger | Reference files to load | Scripts to run |
|------|---------|------------------------|----------------|
| **quick** | Fast scan, 一句话看行情 | — | `kline_ext_indicators.py` (core only) |
| **full** | Full analysis, 完整分析 | `indicators.md`, `three-pillars.md`, `orderflow.md`, `trading.md` | `kline_ext_indicators.py`, `kline_orderflow.py` |
| **scan** | Coin list or top N, 扫描 | `indicators.md` | `kline_ext_indicators.py` |
| **alert** | Condition monitoring, 提醒 | `trading.md` | `kline_ext_indicators.py` |
| **orderflow** | Delta, CVD, order book | `orderflow.md` | `kline_orderflow.py` |
| **macro** | Market cycle stage | `three-pillars.md` | — |
| **custom** | Specific indicators | `indicators.md` | `kline_ext_indicators.py` |
| **chart** | Chart or K-line image | — | `kline_chart.py` |
| **conditional** | Trade plan with entry/target/stop | `trading.md` | `kline_ext_indicators.py`, `kline_orderflow.py` |

When no mode is explicit, use **quick** for a single symbol and **full** when
the user asks for a complete analysis or trade decision.

## 3-Pillar Framework

The composite score combines three pillars — each answers a different question
about market conditions. For full pillar definitions, scoring formulas, and
market stage classifications, read `references/three-pillars.md`.

| Pillar | Weight | Question |
|--------|--------|----------|
| Macro Cycle | 30% | Where are we in the market cycle? |
| Price-Volume Factors | 40% | What do price and volume signals say? |
| Derivatives | 30% | What is smart money pricing in? |

## Data Sources

### Primary: OKX TradeKit CLI

Try CLI first — no MCP overhead, same data:

```bash
okx market ticker <instId>
okx market indicator rsi <instId> --bar 1H
okx market indicator macd <instId> --bar 4H
okx market indicator ema <instId> --bar 1D
okx market indicator bb <instId> --bar 1D
okx market indicator supertrend <instId> --bar 1D
okx market indicator kdj <instId> --bar 1D
okx market funding-rate <instId>
okx market open-interest --instType SWAP --instId <instId>
okx market candles <instId> --bar 1H --limit 60
```

### Fallback: OKX TradeKit MCP

If CLI is unavailable, call MCP tools directly — no scripts needed:

| Data | MCP call |
|------|----------|
| Price / 24h stats | `market_get_ticker(instId)` |
| Candles | `market_get_candles(instId, bar, limit)` |
| RSI | `market_get_indicator(instId, indicator="rsi", bar)` |
| MACD | `market_get_indicator(instId, indicator="macd", bar)` |
| EMA | `market_get_indicator(instId, indicator="ema", bar)` |
| Bollinger Bands | `market_get_indicator(instId, indicator="bb", bar)` |
| Supertrend | `market_get_indicator(instId, indicator="supertrend", bar)` |
| KDJ | `market_get_indicator(instId, indicator="kdj", bar)` |
| Funding rate | `market_get_funding_rate(instId)` |
| Open interest | `market_get_open_interest(instId, instType)` |
| Order book | `market_get_orderbook(instId)` |

### Macro Data

Rainbow Chart, AHR999, MVRV, Fear & Greed Index, BTC dominance
(fetched via public APIs or user-provided values).

## Python Scripts

Use scripts **only** for indicators not available via OKX TradeKit MCP. Feed
them candles from `market_get_candles`.

- **`${CLAUDE_SKILL_DIR}/scripts/kline_ext_indicators.py`**: ATR, Stochastic,
  Ichimoku, VWAP, divergence detection, support/resistance, Alpha 101/191
  factors, 30+ candlestick patterns — everything not covered by MCP

- **`${CLAUDE_SKILL_DIR}/scripts/kline_orderflow.py`**: Order flow delta, CVD,
  bid/ask wall detection, composite score (0–100)

- **`${CLAUDE_SKILL_DIR}/scripts/kline_chart.py`**: Terminal (ASCII) and PNG
  chart rendering with MACD/RSI/volume panels and pattern annotations.
  After generating a PNG, print the output file path so the user can access it.

## Reference Documentation

Read these files on demand — do not load all at once:

- **`references/indicators.md`**: Complete indicator catalog, pattern
  definitions, divergence methodology, signal scoring (−5 to +5 → 0–100)
- **`references/three-pillars.md`**: Pillar definitions, macro cycle stages,
  composite scoring formula, market stage classification
- **`references/orderflow.md`**: Delta/CVD/order book metrics, 6-component
  scoring, smart money interpretation
- **`references/trading.md`**: Signal grades, entry conditions (all 3
  required), position sizing, exit signals, pre-trade checklist, when not to
  trade, fee and slippage adjustment

## Related Skills

- [ahr999 btc hodl](https://6ducklearn.com/skills/ahr999-btc-hodl/index.md): The BTC smart investment assistant based on the Nine Gods Index (AHR999) spans bull and bear markets. It automatically retrieves on-chain valuation data, investing when undervalued and pausing when overvalued, using objective indicators to replace subjective emotions. It supports two strategies: fixed amount and AHR999 tiered variable amounts, which are executed fully automatically once set.
- [bb momentum breakout](https://6ducklearn.com/skills/bb-momentum-breakout/index.md): Bollinger Band squeeze breakout + MACD confirmed momentum trading Skill. Use this skill when users say 'Bollinger breakout', 'momentum breakout', 'BB breakout', or 'activate breakout strategy'. Automatically detects directional breakouts after Bollinger Band squeezes, combining MACD signals and ATR dynamic stop-loss to quickly enter and exit to capture momentum trades.
- [btc naked k breakout](https://6ducklearn.com/skills/btc-naked-k-breakout/index.md): BTC naked K structure AI breakout strategy. Triggered every 5 minutes, it identifies structural points based on 300 candlesticks, builds a box, evaluates structural quality, and executes breakout pullback trades through comprehensive AI judgment, supporting dynamic position sizing and advanced position management.
- [btc trader](https://6ducklearn.com/skills/btc-trader/index.md): Trading skills focused on BTC-USDT trends/volatility/crowding, testing profits of 500 USDT. Used to generate structured market setup indicators, making decisions on opening positions/watching/ skipping based on EMA20/EMA60, RSI14, ATR14, funding rates, and changes in open interest. By default, it is a signal version and does not place orders automatically; it only enters the order and stop-loss process when the user explicitly requests execution and the execution tool is available.
- [crypto swing signal analyst](https://6ducklearn.com/skills/crypto-swing-signal-analyst/index.md): Cryptocurrency swing analysis skills based on EMA20, EMA60, RSI14, MACD, and ATR14, used to determine trends, identify long and short opportunities, and provide stop-loss, take-profit, and risk recommendations.
- [dca bot parameterizer](https://6ducklearn.com/skills/dca-bot-parameterizer/index.md): Don't make impulsive trades; use a data-driven six-step workflow to accurately set parameters for your OKX Martingale bot. Automatically pull real-time market data through the OKX Trade Kit, using EMA20 to determine trend status, ATR% to measure volatility, and structural analysis to anchor support/resistance, covering all scenarios including spot and futures (with leverage recommendations, hard cap of 4x). The core highlight is the safety gate mechanism: under strong trend conditions, it actively warns and refuses execution, automatically switching to defense mode after forced confirmation, reducing the initial amount, widening the step size, and lowering the multiplier.
