Skip to content
All hypotheses

Hypotheses

je-suis-tm Heikin-Ashi Backtest port: buy a growing no-upper-wick bearish Heikin-Ashi candle after a bearish one (pyramid up to 3 units), sell everything on a no-lower-wick bullish HA candle after a bullish one (NVDA.USEQ 1-DAY, long-only, next-session-open fills)

Faithful port of "Heikin-Ashi backtest" by Administrator (je-suis-tm/quant-trading, Apache-2.0, commit 611b73f). The source runs on NVDA daily Yahoo bars; we keep NVDA, as NVDA.USEQ 1-DAY (split-adjusted daily history…

Hypothesis

Faithful port of "Heikin-Ashi backtest" by Administrator (je-suis-tm/quant-trading, Apache-2.0, commit 611b73f). The source runs on NVDA daily Yahoo bars; we keep NVDA, as NVDA.USEQ 1-DAY (split-adjusted daily history from 1999). The source's cited rule page (quantiacs.com) returned HTTP 404 and was not read; the rules below come only from the code. HEIKIN-ASHI SERIES (the source's heikin_ashi()): HA_close[n] = (Open+High+Low+Close)/4 of raw bar n. HA_open[0] = raw Open of the first bar; HA_open[n] =……Show moreShow less

Faithful port of "Heikin-Ashi backtest" by Administrator (je-suis-tm/quant-trading, Apache-2.0, commit 611b73f). The source runs on NVDA daily Yahoo bars; we keep NVDA, as NVDA.USEQ 1-DAY (split-adjusted daily history from 1999). The source's cited rule page (quantiacs.com) returned HTTP 404 and was not read; the rules below come only from the code. HEIKIN-ASHI SERIES (the source's heikin_ashi()): HA_close[n] = (Open+High+Low+Close)/4 of raw bar n. HA_open[0] = raw Open of the first bar; HA_open[n] = (HA_open[n-1] + HA_close[n-1]) / 2. HA_high[n] = max(HA_open, HA_close, raw Low, raw High). HA_low[n] = min(HA_open, HA_close, raw Low, raw High). Compute it recursively in Python floats from bar.open/high/low/close .as_double(), seeded on the first bar the strategy sees. Never round HA values to the instrument price precision. WHY THE PREVIOUS ATTEMPT GOT 0 ENTRIES, AND WHAT THIS CONTRACT CHANGES: the source tests HA_open == HA_high and HA_open == HA_low with exact float equality. Because HA_high is defined as a max that includes HA_open, the equality is the same as HA_open >= max(HA_close, raw High) (and HA_open <= min(HA_close, raw Low) for the exit). This contract writes the conditions in that inequality form, with an optional tolerance whose baseline 0 reproduces the source exactly. It does not tie them to rounded prices or Price objects. Our own count of the raw rule on NVDA.USEQ daily (1999-2026, tolerance 0) gives 822 entry triggers (about 22-46 a year, every year, including ~25 a year in 2015-2017 and 40 in 2022) and 1,895 exit triggers. So the entry fires on this instrument, and a sandbox window of about 950 sessions should show roughly 100 entry triggers. Zero entries in verification means the HA series or the comparison is implemented wrongly (e.g. HA values rounded or quantized, HA_open reseeded every bar, the bull/bear sign reversed, or raw OHLC used in place of HA). It does not mean the rule is rare. This changes no trading rule; it only states the source's equality in a float-safe form. POSITION LOGIC (the source's signal_generation(), stls=3): the source holds 0 to stls 'units'. An entry signal adds one unit only if the units held are fewer than stls. An exit signal sells ALL units held, and is ignored when flat. The entry check comes first (if/elif): a bar that met both sets of conditions would be treated as an entry, but the two cannot both hold, because entry needs a bearish HA candle and exit a bullish one. PLATFORM ADAPTATIONS: (1) Fills: the source fills at the signal bar's close. USEQ has no market-on-close order (same_close_fill unsupported), so every order decided on bar n's close fills at the next session's open (next_open_fill, the platform rule). (2) Sizing: the source buys 100 shares per unit on $10,000. On NVDA in 2015 (~$20 unadjusted) that is about 20% of capital per unit. Because split-adjusted prices make a fixed share count meaningless, each unit is 20% of current account equity (whole shares, floor) at the time of the decision, so the cap is 3 units, about 60% of equity, unlevered. (3) Fees: USEQ zero commission plus the modeled spread/impact. (4) Long-only, as in the source. The plotting, omega, sortino, calmar and mdd code is reporting only and is not ported. The source's performance claims are unverified. RISK CONTROL: route (b), signal-based exit with capped sizing (max ~60% of equity, no leverage). There is no stop-loss, because the source has none and none is invented.

Analysis

Heikin-Ashi backtest

Backtest and paper results are hypothetical. Trading involves risk of loss.