NearOneHourDonchianTrendFollowLongShort
Hypotheses
NEAR Donchian Channel Trend Following on 1H
Hypotheses
A trend-following strategy on NEARUSDT perpetual futures using 1-hour bars and Donchian Channels. Donchian Channels track the highest high and lowest low over a lookback period — the simplest possible breakout indicator with no lag or smoothing artifacts. When price breaks above the upper channel, enter long; when it breaks below the lower channel, enter short. Exit via an ATR-based trailing stop that locks in profits during trends while giving room for normal pullbacks. NEAR Protocol is a liquid L1 altcoin (~$2-5B market cap) that exhibits strong trending behavior driven by narrative cycles, ecosystem developments, and AI-narrative association. The 1H timeframe provides sufficient trade frequency (estimated 150-300 trades/year) while filtering out noise present in lower timeframes. This strategy explicitly avoids mean reversion (which failed on altcoins — see BNB failure) and avoids overly complex multi-indicator setups that produce frozen signals in verification. The Donchian Channel calculation is trivially simple: max(highs[-N:]) and min(lows[-N:]), ensuring calculate_signal() will always produce varying values as price evolves.
Hypotheses
Implements the simplest lag-free breakout trend follower: Donchian channels (max high / min low over the lookback) for entries and an ATR trailing stop for exits, deliberately avoiding mean reversion and multi-indicator setups that produce frozen verification signals. calculate_signal returns the continuous channel-position score so the verifier always sees varying values (as the hypothesis emphasises), while the discrete prior-channel breakout booleans gate should_enter and position_size, avoiding the gated-to-0.0 anti-pattern. The trailing stop is path-dependent state: it is re-initialised when a new position opens (detected via entry-price change) and only ratchets in the trade's favour (max for longs, min for shorts), with the initial 2x ATR stop defining the risk used for capital-relative position sizing. Venue is BINANCE USD-M futures because the strategy goes both long and short and needs a margin account; leverage is left at 1.0 (no amplification used) so the leverage_set_but_unused gate does not trigger. The 1H NEAR perp has multi-year history and ample trade frequency; trend-capture with a wide ATR trail keeps average winners well above the ~0.10% round-trip futures fee.
Hypotheses
The NEAR 1H Donchian trend-follower has NO edge and is structurally untradeable. Impact_cost_pct is 118.4% — modeled market impact exceeds the entire gross PnL — and capacity_usd is only $71,372, so at any deployable size the impact consumes the whole edge: a 1H breakout strategy churning ~1,029 trades (~180/yr, 74.5% exposure) on a mid-cap alt is far too high-frequency for NEAR's liquidity. The base is also net-losing: profit_factor 0.993 (<1), Sharpe -0.10, expectancy -$4.06/trade (negative), win_rate 35%, with the +5.3% headline illusory (end_unrealized 9.5% exceeds it, so realized is ~-4%) and negative in 4 of 7 years. The code is correct and trades as designed, so this is a no-edge premise plus a structural over-trading/liquidity problem, not a code defect — optimization cannot create an edge that isn't there or lift a $71K capacity, and reducing frequency (longer Donchian / higher timeframe) just converges toward the already-covered NEAR 4H Supertrend trend-follower (PF 1.34, ~$47M capacity). Not worth 2 hours. FAILURE PATTERN: 1H Donchian breakout trend-following on a mid-cap alt (NEAR) produces a net-losing, untradeable result — impact cost (118% of gross) exceeds the edge and capacity collapses to ~$71K because the signal over-trades a thin instrument; trend-following on alts must run on a slower timeframe (4H+) to be both profitable and liquid, and the 1H version is dominated by trading costs with no surviving edge.
Implementation
Long-short Donchian channel trend-following on NEARUSDT.BINANCE USD-M futures, 1H bars, pure OHLCV single feed. Enters LONG when price breaks above the prior 20-bar Donchian high and SHORT when it breaks below the prior 20-bar low. Manages the position with an ATR trailing stop initialised at entry +/- 2x ATR and trailed by 3x ATR, plus a 300-bar safety time stop. The signal is the continuous channel position (close - mid)/(half-range) recomputed every bar; the discrete breakout is the entry gate. Sized at 20% equity notional, capped so initial-ATR-stop risk <= 1.5% of equity. leverage 1.0.
Backtest Review
Implemented correctly and trades as specified: 1,029 Donchian breakout entries (530 long / 499 short), 0 dropped — no code bug
Backtest Review
Structurally untradeable: impact_cost_pct 118.4% (impact EXCEEDS gross PnL), capacity_usd only $71,372 — at any real size the edge is fully consumed
Backtest Review
No edge: profit_factor 0.993 (<1), Sharpe -0.10, expectancy -$4.06/trade (negative), win_rate 35%; the +5.3% headline is illusory (end_unrealized 9.5% > total_return, so realized ~-4%)
Backtest Review
Over-traded 1H on a mid-cap alt (~180 trades/yr, 74.5% exposure) drives $26.9k impact + $23.9k commissions; negative in 4 of 7 years, max_drawdown 36% (CI to 78%), max_drawdown_duration ~1926 days
Backtest Review
Redundant: the NEAR 4H Supertrend trend-follower already covers this idea with PF 1.34 and ~$47M capacity
Outcome Summary
This strategy traded NEAR 1H Donchian channel breakouts both long and short with an ATR trailing stop, and the code was confirmed correct — 1,029 entries with zero dropped. But the base had no edge (profit factor 0.993, Sharpe -0.10, negative expectancy, ~-4% realized after stripping the unrealized portion of the +5.3% headline) and was negative in four of seven years. Worse, it was structurally untradeable: modeled impact cost reached 118% of gross PnL against just $71K of capacity, so the 1H frequency simply over-traded a thin instrument into the ground. The analyst abandoned it before optimization, noting that no amount of tuning creates a missing edge and that slowing the signal down just reproduces the existing NEAR 4H Supertrend trend-follower (PF 1.34, ~$47M capacity).
Outcome Summary
1H breakout trend-following over-trades a mid-cap altcoin's liquidity — impact and commissions dominate and capacity collapses to ~$71K; trend-following on alts needs a slower timeframe (4H+) to be both profitable and liquid, where it converges on the already-covered NEAR 4H Supertrend follower.
Outcome Summary
The analyst abandoned it at backtest review as both edgeless and structurally untradeable — impact_cost_pct was 118.4% (modeled impact exceeded the entire gross PnL) and capacity_usd was only $71,372, so churning ~180 trades/year at 74.5% exposure on a thin mid-cap alt consumed any edge at deployable size.
Outcome Summary
A long-and-short Donchian channel breakout trend-follower on NEARUSDT 1H perpetual futures, entering long on a break above the upper channel and short on a break below the lower channel, managed by an ATR trailing stop with 1.5% per-trade risk sizing.
Outcome Summary
Over 1,918 days and 1,029 trades (530 long, 499 short) it had no edge: profit factor 0.993, Sharpe -0.10, expectancy -$4.06/trade, win rate 35%, and a 36% max drawdown (CI to 78%); the +5.3% headline return was illusory since end-unrealized 9.5% exceeded it, leaving realized PnL around -4%.
Backtest and paper results are hypothetical. Trading involves risk of loss.