HA

Blueprint

HA Pulse · full spec

Claude spec← Desk

00

Paste to Claude

Full math, frozen backtest, hazard tables, live DIP BUY gates, ETH+LINK SMA, and Holdouts RS — one document so another model can re-backtest or improve without guessing.

Open + copy the spec

01

What it is

HA Pulse is a Heikin Ashi reversal desk for USDT perps. It started as a TradingView Pine v6 table (19 names, 40-request cap). This web app scans ~50 liquid perps, daily / weekly / monthly HA, funding, account long/short, and open-interest change — then ranks names by a locked rule: N = 4 strong months.

It is a filter and a watch, not a proven money-printer. The backtest’s only robust result is what not to do.

Timeframe

Monthly HA

Confirm

Weekly green

N

4 strong

Venue live

OKX swap

02

The rule

  1. Count strong HA months only (shaved wick). Weak candles and dojis do not add to the run.
  2. A-long: first strong green after ≥4 strong red, and weekly HA is already green at the month close.
  3. Fill is the next month’s open. Exit the first opposite-color monthly HA close.
  4. A forming (still-open) month is a watch, never a fill.
  5. No first-red short. No month-4 fade. No buying a still-red month as “the squeeze.”

One-liner

Wait for a closed shaved-green month after a long strong-red run, weekly already up. Size as if the typical trade is −10%.

03

How to use the desk

  • General — full scanner. Mine — your list. Star any ticker to favorite it. Paste several names on Mine: ENA PYTH ARB.
  • Columns: months down/up → this month → this week → fund → L/S → OI Δ day → idea.
  • Click a row. Daily / weekly / monthly HA (50+ bars). The hollow ghost candle is the reversal you need: empty body, colored outline. Green ghost = wait for shaved green. Red ghost = wait for shaved red. Off if color already flipped.
  • Forming in the idea = this month is not closed. Do not treat it as the backtested event.
  • Fund / L/S / OI are live OKX positioning, not in the backtest. Use them as a veto (don’t buy a “squeeze” when L/S is 2.5 long and funding is positive).
  • Pine export is the TV table (19 names). The web desk is the real scanner.

04

Candle language

Strong bull

Green, no lower wick (shaved bottom). Starts / continues a long trigger.

Weak bull

Green with a lower wick. Color only — does not start a trigger.

Strong bear

Red, no upper wick (shaved top). Starts / continues a short trigger.

Weak bear

Red with an upper wick. Color only.

Two counters: color streak (any same-color HA, including weak) vs trigger (strong-run only). The A-filter uses trigger. Doji resets color streak and does not increment trigger.

05

Math

HA close = (O + H + L + C) / 4

HA open = (prev HA open + prev HA close) / 2 · first bar (O+C)/2

HA high = max(H, HA open, HA close) · HA low = min(L, HA open, HA close)

Strong bull ⇔ HA close > HA open and |HA open − HA low| ≈ 0

A-long ⇔ trigger = +1 and prevTrigger ≤ −4 and weekly trigger > 0 and month closed

Canonical Heikin-Ashi. Recursive, causal on closed bars. The live desk paints the forming bar — that is a different random variable than the backtest.

06

Backtest

39 names, closed monthly HA, 8 bps, 2017–2026. Signal on a closed month, fill next open, exit first opposite HA color. 8 bps round-trip. Weekly = last week already closed by month end. Forming last candle dropped. 39 names. IS before 2023 / OOS 2023+. Data verified: HA engine vs hand formula diff 0, BTC checkpoint months pass, reconstructed A-longs 0 return mismatches. Live desk is OKX swap; this book is Binance spot (swap can differ ~0–4% on a month).

IdeanWinAvgMedianPFCall
A-long N=4, weekly green3435%+5.2%-9.9%1.41Retired. BTC beta.
A-long, weekly not green1127%-14.7%-12.2%0.10Loser. Do not take.
First strong red after 4 green3529%-0.6%-17.7%0.97Fail.
Short 4th green month5147%+0.6%-2.7%1.05Dead after costs.
Buy still-red 4th month11547%+2.7%-0.5%1.36Not the reversal.
Early first-green (<4 red)11443%+98.0%-7.6%9.20Lottery / listing tail.

The A-filter does not survive. Alpha vs BTC is −17.6% (t=−1.76). Block-bootstrap mean 5th percentile is −13%. 14 of 34 prints sit in Feb 2023. Levered BTC beta with extra steps.

Distinct months

14

Feb 2023 cluster

14 / 34

Alpha vs BTC

-17.6%

Beta / R²

0.72 / 0.27

OLS: trade return on BTC return over the same hold. Alpha -17.6% (SE +10.0%, t=-1.76). 31 of 34 fired while BTC monthly was already green. Independent n is the 14 months, not 34 names.

Block bootstrap (14 months, 10k)5th50th95th
Mean-13.1%+3.8%+34.0%
Median-20.4%-9.9%+20.1%
Win rate18%35%56%
PF0.201.304.54

This interval replaces every prior CI. Per-trade bootstrap is not shown. Funding join and OKX swap re-book were not run — the gate failed first.

06b

Streaks — continue vs flip

Closed monthly HA color across 39 names. At N months red (or green), this is how often the next month stayed the same color. This is not a squeeze signal. An 11-month red still continued 80% of the time (n=30).

N redSeenContinueFlip
1m31785%15%
2m26779%21%
3m20485%15%
4m17382%18%
5m14281%19%
6m11578%22%
7m8973%27%
8m6585%15%
9m5589%11%
10m4973%27%
11m3080%20%
12m2282%18%
N greenSeenContinueFlip
1m31075%25%
2m22970%30%
3m16173%27%
4m11871%29%
5m8462%38%
6m5263%37%
7m3342%58%
8m1457%43%

Completed red runs — length of the streak the month it flipped to green:

Length before flipCountShare of flips
1m red4816%
2m red5619%
3m red3111%
4m red3111%
5m red279%
6m red258%
7m red248%
8m red103%
9m red62%
10m red134%
11m red62%
12m red41%

Most flips happen at 1–4 months red (56% of completed runs). 11m red is rare (6 flips, 2% of runs) and still had an 80% chance of one more red month.

07

Data on the desk

FieldSourceIn backtest?
OHLC / HAOKX USDT swap (Bitget kline fallback)No — test used Binance spot
FundingOKX funding-rate; Bitget if missingNo
L/SOKX account long/short ratio (count of accounts)No
OI + ΔD/W/MOKX OI + daily OI history vs 1/7/30dNo
Ghost candleSynthesized next HA open + median body, shavedVisual only

Not in this sandbox: CoinGlass, Binance (blocked on the live desk), liquidation heatmaps. “11 months down” is not the same as “heavily shorted.”

08

Build log

  1. Pine v6 table: fill the pane, weekly in front of monthly, countdowns, stronger trend-change copy.
  2. Turned into this web desk (unlimited names vs TV’s 40-request cap).
  3. Compact blotter. Column order: months down/up → month → week.
  4. Square-ish 50+ HA history, playbook, then D/W/M strips (dropped the annotated before/now chart).
  5. Audit + first backtest. Demoted unconfirmed longs and first-red shorts.
  6. Custom Mine list (multi-add). Funding, L/S, OI, then OI Δ D/W/M. Positioning in the call.
  7. Hard re-audit: doji/weak no longer inflate trigger. N locked at 4. Forming months cannot print a BUY/SELL fill. Closed-bar re-run with 8 bps + OOS. Data verified against BTC checkpoints and a second HA implementation.
  8. Star favorites. Hollow ghost candle = the reversal we are waiting for.
  9. This blueprint page.
  10. Regime split + block bootstrap by signal month. A-filter retired for live size. Streak continue/flip table added.

09

What is true

  • True. First green without weekly confirm is a loser (PF 0.1, OOS avg −22%).
  • True. Don’t buy a still-red month as the reversal. Don’t short the first red after a marathon (median -17.7%).
  • False. The A-filter is +EV. The A-filter does not survive. Alpha vs BTC is −17.6% (t=−1.76). Block-bootstrap mean 5th percentile is −13%. 14 of 34 prints sit in Feb 2023. Levered BTC beta with extra steps.
  • False. Month-4 tactical short (old PF 3.2) is flat after 8 bps (PF 1.05).
  • Unproven. The n=34 A-long sample is not 34 independent observations. 14 sit in Feb 2023. Every prior CI assumed independence and was too narrow.
  • Unproven. No funding cost is in the book. The strategy holds perps for months. Skipped after the gate failed.
  • Unproven. The book is Binance spot; the desk is OKX swap. Venue divergence is the same order as the old +5% mean.
  • Unproven. Squeeze from “N months down.” An 11m red still continued 80% of the time.

10

Operating plan

  1. Scan General. Star names you actually trade into Mine.
  2. Ignore forming months. Watch the hollow ghost — that’s the print you want.
  3. Only when a month closes strong green after ≥4 strong red, and weekly is already green: log it. Paper only. The A-filter is retired for live size. No live size from this desk.
  4. If L/S is crowded long and funding is positive, do not dress it as a squeeze.
  5. No shorts from this desk until a new closed-bar book says otherwise.

Gate stopped the queue. Funding join, OKX swap book, and survivorship rebuild were not run. N stays 4. The rule is retired, not re-tuned.

Back to desk