openmarket
Artwork for @ryanng0611/refined-gentleman-patterns

The Refined Gentleman's Patterns

0.2.1 · Indicator · published 1 month ago · by @ryanng0611

INDICATOR PACKAGE: eight structural chart patterns with developing, breakout and completed stages; hourly signals with closed 4h/day context.

The Refined Gentleman's Patterns

INDICATOR PACKAGE · version 0.2.1

Eight structural chart-pattern detectors for hourly candles, with fully closed 4h and daily context. Add this package to a chart to plot event markers, boundaries and rolling VWAP. The companion For the Refined Gentleman Gambler watch runs the same detector in OM and sends stage-labelled bulletins; the watch does not need an open chart.

Developing setup → Breakout / vulnerable → Completed pictured sequence. Each is labelled separately. A developing setup is not a confirmed trap.

Version 0.2.1 removes WSB entirely. The other eight pattern IDs, stage masks and rules are unchanged. Upgrade the companion watch to 0.2.1 too. Existing chart instances remain on their pinned version until upgraded.

Version 0.2.0 introduced structural detection and replaced the 0.1.x scalar contract: signal, pattern_id, stage and the three stage masks replace the old mask output.

Pattern rules

Closed-price swings need a reversal of 1.2 ATR, with a 0.1% price floor. That reversal threshold freezes when the extreme advances. A pivot becomes usable on its confirmation candle, not at its earlier occurrence. Setups require at least six ATRs of height and 12–192 hours of structural history. Every setup freezes its anchors and boundary equations; new candles advance its state or invalidate it.

PatternRequired structure and completion
Bullshit WedgieUpward impulse, three tightening cycles, upside break, then failure through the lower boundary.
Bullish Constipation · reversalDowntrend, higher low and higher high, continuation break, then loss of the higher-low support.
Cup My BallsLarge bowl with a distributed floor and recovery to its rim, a smaller shallower two-trough bowl, rim breakout, then failure below the smaller bowl.
Bearish Mac and Cheese WedgeDownward impulse, converging swings, downside break, then reversal above the upper boundary.
Bullish Constipation · rangeRepeated horizontal touches, upside break, reversal below the range, then reversal above it again.
Double TitsTwo similarly high tops, comparable intervening lows, smaller rebound, neckline break, then recovery above both tops.
Bullish PennantUpward impulse and four tightening cycles, upside break, then failure through the lower boundary.
Head and Shit My PantsTwo shoulders below a higher head, neckline break, then at least eight candles within 6% of the formation's height.

Stages are developing setup, breakout/vulnerable, and completed pictured sequence. Developing does not predict the ending. A breakout can coincide with the candle that first confirms the setup; both stage bits are retained. Metrics never compensate for a missing structural predicate.

The image is a schematic: tolerances and confirmation thresholds are explicit implementation choices, not measured predictive probabilities. The backward-time pennant loop and the options-expiry annotation are not literal candle events. The two similar wedge drawings are distinguished by their touch counts. A completed sequence does not imply a profitable entry.

Unbroken setups expire after 96 hours; broken setups after 72. Wedges must break before their projected apex. A breach in the wrong direction invalidates an unbroken setup. Gaps and invalid candles reset everything.

Each family holds independent state. Stage masks expose all transitions on a candle. The primary row shows the most advanced transition; ties prefer the formation with more anchors. anchor_*, formed_at, broken_at, turn_at, extreme_at and completed_at distinguish observed times from recognition. Event fields are absent on quiet rows. These are timestamped scalar outputs; the standalone viewer renders their geometry. Native chart outputs currently provide event markers, boundary values and VWAP, not the viewer's full swing annotations.

Context

  • ATR: simple mean of 14 true ranges; RSI: simple 14-period gains/losses.
  • Relative volume: current volume / prior 24-candle mean, USD normalized in the replay.
  • VWAP: rolling 24-bar typical-price/volume approximation; displacement in ATRs.
  • Compression: 24-bar high-low width / 48-bar width.
  • 4h trend: EMA 5 versus EMA 20 on fully closed UTC four-hour buckets.
  • Daily trend: EMA 5 versus EMA 10 on fully closed UTC days.

Context agreement awards 25 points each for elevated volume, aligned 4h trend, aligned daily trend and aligned RSI. Missing higher-timeframe context stays missing and earns no points. This is a heuristic count, not a win probability. geometry_pass is a binary structural result, not a similarity/confidence score. Funding and OI are not included.

Every input must be a contiguous, valid hourly candle. The host must supply closed bars for confirmed alerts; live metric reads can include a forming candle.

Validation

132 local checks cover all three stages of eight independent synthetic shapes, missing legs, unequal peaks, broad-V rejection, slow or absent spikes, missing flat endings, scale invariance, frozen anchors, causal replay, data gaps and closed higher-timeframe buckets. The former WSB examples and real BTC history explicitly check that none of its stages can return.

A frozen 28-day BTC/ETH/SOL sample (671 closed hourly candles per market) produces no qualifying events after removing WSB. The remaining families have synthetic coverage but no confirmed real positives in that sample. These checks establish implementation behavior, not measured trading accuracy or profitability.

Use an OM runtime with the scalar-feed ordering fix when running this indicator in watches. The detector requires 576 hourly warmup bars. It uses market candles only and has no order execution permissions.

Indicator

Outputs

OutputPlotPanelStyle
pattern_iddata onlylowerdefault
stagedata onlylowerdefault
geometry_passdata onlylowercolor #60a5fa
evidence_scoredata onlylowerdefault
spandata onlylowerdefault
pattern_startdata onlylowerdefault
match_enddata onlylowerdefault
upperlineoverlaycolor #ef4444
lowerlineoverlaycolor #22c55e
markershapeoverlaycolor #c084fc, where signal
signaldata onlylowerdefault
atrdata onlylowerdefault
relative_volumedata onlylowerdefault
rsidata onlylowerdefault
trend_4hdata onlylowerdefault
trend_1ddata onlylowerdefault
vwaplineoverlaycolor #f59e0b
vwap_atrdata onlylowerdefault
compressiondata onlylowerdefault
forming_maskdata onlylowerdefault
breakout_maskdata onlylowerdefault
confirmed_maskdata onlylowerdefault
context_readydata onlylowerdefault
formed_atdata onlylowerdefault
broken_atdata onlylowerdefault
turn_atdata onlylowerdefault
completed_atdata onlylowerdefault
anchor_countdata onlylowerdefault
boundary_upperdata onlylowerdefault
boundary_lowerdata onlylowerdefault
upper_slopedata onlylowerdefault
lower_slopedata onlylowerdefault
anchor_0data onlylowerdefault
anchor_1data onlylowerdefault
anchor_2data onlylowerdefault
anchor_3data onlylowerdefault
anchor_4data onlylowerdefault
anchor_5data onlylowerdefault
anchor_6data onlylowerdefault
anchor_7data onlylowerdefault
anchor_8data onlylowerdefault
anchor_9data onlylowerdefault
anchor_10data onlylowerdefault
anchor_11data onlylowerdefault
anchor_12data onlylowerdefault
anchor_13data onlylowerdefault
anchor_14data onlylowerdefault
anchor_15data onlylowerdefault
extreme_atdata onlylowerdefault

No params.

Inputs

InputSourceSelection
closeohlcvfield close, missing nan
highohlcvfield high, missing nan
lowohlcvfield low, missing nan
volumeohlcvfield volume, missing nan
timetimefield bar_open_sec

Provenance

ABIwrun-1
VersionPublishedNote
0.2.1Sep 24, 2026
0.2.0Sep 24, 2026
0.1.1Sep 23, 2026
0.1.0Sep 22, 2026
FileSize
README.md5.8 KiB
om-package.json728 B
src/geometry.ts12.8 KiB
src/indicator.ts7.2 KiB
wrun/metadata.json6.0 KiB
wrun/module.wasm9.3 KiB