Skip to content
All strategies

Strategies

vn.py KingKeltnerStrategy by 用Python的交易员: Default 5-Minute OCO Breakout on AVAX Bybit

Outcome: Backtesting

AvaxBybitKingKeltner

vn.py KingKeltnerStrategy by 用Python的交易员: Default 5-Minute OCO Breakout on AVAX Bybit

Hypothesis

Faithful research port of the supplied MIT-licensed KingKeltnerStrategy, credited to 用Python的交易员. Preserve source defaults exactly: kk_length=11, kk_dev=1.6, trailing_percent=0.8 and fixed_size=1. Trade AVAXUSDT.BYBIT perpetuals, long or short, with 5-minute signal updates and 1-minute execution bars. The source aggregates minute bars into clock-aligned 5-minute bars, requests 10 days of initialization history, and uses a default 100-element ArrayManager. Preserve its rolling-array indicator calculations and initialization gate. The only deliberate strategy adaptation is capital-relative sizing: fixed_size=1 represents one platform allocation unit rather than one AVAX. No extra trend filter, profit target, funding filter, cooldown or holding-time exit is authorized. This is an unverified reproduction experiment, not an assertion that the source is profitable.

The explicit reproduction request takes precedence over introducing a different mechanism to fill quotas. Bybit is underrepresented at 2.5% versus its 5% target, and long-short exposure addresses the 82.8% long-only concentration. AVAX avoids another BTC or ETH experiment, although the supplied corpus_concentration is empty and its individual usage share cannot be established. Hyperliquid's short-history limit makes it unsuitable for this unchanged 5-minute design. Single-symbol scope is retained because adding a hedge or basket would change the source. The experiment differs from the supplied SMA, Supertrend, grid and cross-venue spread failures, but its generic breakout mechanism remains a low-priority fee-risk candidate. All source signal parameters are frozen to prevent optimization from turning reproduction into a different strategy.

Implementation

Faithful port of vn.py KingKeltnerStrategy on AVAXUSDT.BYBIT: 1-minute bars aggregated into clock-aligned 5-minute bars; once the 100-bar array is full, each 5-minute close cancels resting orders and places an OCO pair of stop-market entries at the Keltner bands (SMA(11) +/- 1.6*ATR(11)) when flat, or a 0.8% trailing reduce-only stop when in position.

Iteration 2 fixes Layer 1.5: parameters now carry every optimization_plan fixed value with the exact types, including leverage=1.0 (float), which was missing before. The parameter mirrors config.leverage and is used in sizing. The 5-minute signal timeframe is declared as an extra bar type (AVAXUSDT.BYBIT-5-MINUTE) so the config matches the hypothesis. It is a slower timeframe, so it does not gate the 1-minute primary, and on_extra_bar remains a no-op. Signals still come from the source-faithful 1-minute to 5-minute aggregation, and execution stays on 1-minute bars. Signal, order and exit logic are unchanged from iteration 1.

Verification Results

The truncated sandbox reports 39 losing closed positions and average net return of -0.947% of notional. Full-history review should examine breakout whipsaws and modeled impact costs; these results do not establish a correctness defect.

Iteration History

Verification failed (Layer 1.5 — hypothesis/config consistency) [class=hypothesis_mismatch]: - optimization_plan fixes leverage at 1.0 Also note: - hypothesis states 5-minute bars but config.bar_type is AVAXUSDT.BYBIT-1-MINUTE-LAST-EXTERNAL (1-MINUTE) — QA rejects a timeframe that contradicts the hypothesis; align bar_type or revise the text.

Analysis

KingKeltnerStrategy

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