← Back to all toolsNison Candles

Indicators · Pine Script v6

Pattern recognition · with a built-in control

Nison Candles — Unified

All 14 candlestick patterns to Nison's own definitions — including the confirmation rules most scripts quietly skip — plus a random-entry mode that tells you whether the patterns are adding anything on your symbol.

  • random-control mode
  • Pine Script v6
  • strategy
  • 14 patterns
  • 4 presets
  • any timeframe
  • alert-ready JSON
2×ATR stop hammer bearish engulfing ENTRY SOURCE Patterns Random control flip it · same exits · same trade count

Markers fire only on confirmed bars. The stop is frozen at entry so it cannot drift with ATR.

Four presets, one script

Each preset is a configuration that was separately measured. The edge figure is against a random entry using identical exits.

+0.04%All patterns · 12 patterns, no filters · 635 trades
+0.21%Premium only · 8 patterns + quality gates · 409 trades · default
−1.12%Premium + momentum · regime filter · 46 trades
Custom · every switch exposed

What it does differently

  • A control is built in. Switch Entry source to "Random control" and the strategy takes the same number of trades on randomly chosen bars with identical exits. If your pattern settings cannot beat that in the Strategy Tester, the patterns are not doing the work.
  • The legend names what fired. Every signal carries a colour-coded label with the pattern code, and the legend lists only the patterns your preset enables — with a live hit count for each on the current chart. That count is the fastest way to see whether you have enough of a given pattern to read anything into it. Usually you do not.
  • Confirmation rules are enforced. Hanging man and shooting star need a confirming close beneath the prior real body — Nison is explicit about this and most scripts ignore it. This one will not fire without it.
  • Trend context is required. Every reversal pattern is gated on the prior trend, so a hammer shape in an uptrend is correctly read as a hanging man rather than a buy.
  • Sizing that survives contact with every asset class. Quantity comes from your risk percentage and the ATR stop distance, and falls back to percent-of-equity where that would produce a sub-unit order. The active mode is printed in the legend, so it cannot fail silently.
  • No repainting. Signals are gated on barstate.isconfirmed and orders fill on the next bar's open.

Read this before you trade it. We tested these patterns across 2,022 trades, ten symbols and ten years. None of the fourteen showed a statistically significant edge over a random entry, and bullish patterns performed slightly worse than buying on a random day.

This script is published as a measuring instrument, not a signal service. The random-control mode exists so you can reproduce that finding on your own symbol rather than taking our word for it. The full study →

2,022trades in the validation study
0/14patterns with a significant edge
14patterns detected
v6Pine Script

Settings worth knowing

  • Position sizing — defaults to Auto: risk-based ATR sizing where the order is at least one unit, falling back to percent-of-equity where it would go sub-unit. This matters on high-priced instruments. Risk sizing divides your risk budget by the ATR stop to get a quantity in units, and on BTC that lands at roughly 0.1 of a coin where silver returns 70 units. A sub-unit order can round toward zero, and a zero-quantity order is a runtime error that halts the entire script — no labels, no tables, nothing drawn. If your broker supports fractional size, drop the minimum-units input to 0.001 to keep true risk sizing.
  • Shadow : body ratio — default 2.0, per Nison. Raise it for stricter hammers.
  • Trend context SMA / lookback — how "prior trend" is defined. Default 20 / 5. Keep this short: a trend filter on the same lookback as the pattern's own context cancels the pattern outright, since a bullish reversal requires a prior downtrend.
  • Stop, target, time stop — 2×ATR, 2R, 20 bars. These match the study, so results are directly comparable.
  • Trade side — long only, short only, or both. Worth isolating: the short side lost money in every configuration we tested.

Supersedes four earlier drafts. Between them they contained a position-sizing conflict, a trend filter inverted against the patterns it gated, an oscillator plotted on the price overlay, and a sizing rule that silently killed the script on high-priced instruments. All are documented in the study's errata rather than quietly removed.

For educational purposes only. Backtested and simulated results are not indicative of future performance. Nothing here is investment advice.