Trading Lab
Trading Lab is the current area for BTC long and short strategy research. It is separate from DCA Lab and uses Trading-specific account results, trades, positions, charts, and decision trees.
Current scope
- BTC with an explicit daily or 4h strategy timeframe.
- One long or short position at a time.
- One open action from flat, full-position close actions, and managed partial targets within one position lifecycle.
- A required initial stop loss, with optional take-profit shorthand, multiple fixed targets, and tighten-only stop changes.
- 100% equity sizing for the timed example and 2% stop-risk sizing for the Supertrend comparisons.
- The current catalog contains nine 4h long-short strategies from January 1 through July 28, 2026. Seven share the
stop-loss-suitestudy label; the Supertrend-line and timed strategies remain diagnostics outside that suite. - A starting account balance of 10,000 USDC.
- A fixed 4.5 bps fee on entry notional and 4.5 bps on exit notional, with no simulated slippage.
Strategy rules are evaluated after a completed candle closes. A selected action executes at the exact next tradable candle open for the same timeframe. Protection exits use the exact configured level unless the market opens beyond it, in which case the genuine open is used. Fees remain separate from the execution price.
The stop-loss suite holds Supertrend 10 / 3 flips, the 4h period, account, fees, and execution model constant while comparing six pure exit families: fixed 2% protection, ATR volatility protection, a previous Donchian 20 channel, RSI 14 thesis invalidation, an 8% favorable-extreme trail, and a 20-candle time exit. A seventh managed-position comparison combines a partial target, break-even stop, and ATR trail. The catalog can be filtered by authored study labels and backend-derived indicator labels.
The timed diagnostic opens one protected long and short at exact deterministic times. The Supertrend-line diagnostic exercises recurring indicator-level stop updates. The Trading language continues to accept daily and 4h strategy timeframes.
Trading charts show each position continuously from entry to exit with its entry price, exact execution points, and take-profit and stop-loss levels. Protection rails remain visible for each interval in which their level is active, including when a separate strategy close condition exits first. Open positions remain visible through the selected period end.
Indicator-based entry protection and named entry values are evaluated on the completed signal candle. The resolved distance is stored with the pending action, then converted to an absolute take-profit or stop-loss price from the actual next-open entry. The fixed-protection strategy keeps those levels unchanged. The managed comparison can close percentages of initial position quantity, move the shared stop after a confirmed target fill, and recalculate a tighten-only stop after completed candles. The shared stop always closes the current remainder.
Target executions, fees, realized PnL, remaining quantity, protection activations, and cancellations stay inside one flat-to-flat trade record. A target-driven stop change begins at the next genuine 1-minute evidence interval; a completed-candle change begins at the first genuine interval after that close. Backtests apply each intended reduction atomically and do not simulate order-book liquidity.
Only the Supertrend example opts into sizing each open so planned price loss at the frozen stop is 2% of account equity immediately before entry. Fees are separate from this target. The resulting effective leverage is recorded without a leverage cap, collateral constraint, maintenance-margin model, or liquidation simulation. The timed strategy retains its authored 100% equity position at 1x.
An open action may bind ordered named exit condition groups to the position it creates. These conditions use the same completed-candle expressions as Trading rules and can schedule a full close at the next genuine open. They do not reverse the position. Existing take-profit and stop-loss execution remains authoritative when protection is reached before that close executes.
Report metrics
Trading reports calculate and format their metrics in the backend:
- Net return and net profit or loss use final marked equity after fees.
- Maximum drawdown uses the largest marked-equity peak-to-trough decline.
- Profit factor, expectancy, realized R, win rate, trade splits, average wins and losses, and hold times use closed trades only. R divides a tradeโs net result by its planned stop-price loss at entry.
- Trades per day counts executed position openings, including a position still open at period end, divided by the complete effective backtest duration in 24-hour UTC days. Flat time, time already in a position, and days without an opening remain in the denominator.
- Average leverage time-weights absolute marked position notional divided by marked account equity while a position is open. Maximum leverage comes from the same marked series. Zero marked equity is unbounded; negative marked equity makes this metric unavailable.
- Market exposure measures elapsed open-position time as a share of the fixed backtest period.
- The buy-and-hold comparison invests the starting balance at the first genuine candle open, charges the same entry fee, and marks the holding at the final genuine candle close.
- Peak equity and longest underwater period use the marked account-equity series. An unrecovered final drawdown is reported as ongoing.
- Trading fees include every entry and exit fee. The fee ratio compares closed-trade fees with positive gross price profit.
Execution activity shows only executed open_position strategy actions,
grouped by UTC day under one Open position category. Direction and source
action details remain in backend-formatted hover content. Empty days remain
empty; closes, take profits, and stop losses stay in the visualizer and trade
details.
Trading decision trees keep each open action concise and attach one backend-owned Position lifecycle companion through a neutral relationship that is not an execution step. The companion presents supported management facts through the central expression and indicator semantics. Strategy JSON remains the raw executable reference. Chart and position labels identify whether the final exit used the original stop, a break-even stop, or a later managed stop. Closed trades remain one flat-to-flat lifecycle and group their opening, partial target fills, material protection changes, final closure, fees, and total result.
Historical prices
Trading research uses a dedicated Kraken BTC/USD spot candle database. Its canonical 1-minute history combines Kraken archive releases with a PostTrade reconstruction whose method was checked exhaustively against the official first-quarter 2026 minute release. UTC-aligned 4h and daily candles are derived from that single series and checked against available native Kraken 4h and daily files.
Kraken intervals with no trades remain absent from stored source data. The 4h backtest represents an omitted interval internally with a nontradable previous-close slot so indicators retain regular 4h timing. Strategy rules and fills skip that slot, and a pending action waits for the next genuine candle open.
When a daily or 4h candle reaches a configured take profit or stop loss, the canonical Kraken 1-minute series determines the first level reached. A genuine minute open beyond a level executes at that open. If one minute crosses both levels, the backtest selects the stop loss conservatively.
The internal Market Data page records exact coverage, source artifacts, checksums, gaps, freshness, and build status. This information is kept there instead of being repeated on every Trading result.
Current limitations
The current Trading backtest does not simulate funding, collateral constraints, maintenance margin, liquidation execution, margin modes, or live execution. It can report zero or negative marked equity. A later open is rejected unless account equity is positive immediately before entry.