TRADERRYTraderry home

Canonical tearsheet

Perp Funding Z-Score Mean-Reversion

ETHUSDT · 4h · 19 trades

Moderate Unseen Market DecayDSR 66.9%Fee floor 5.5 bps

In-sample Sharpe

0.09

Out-of-sample Sharpe

1.28

Your Executable Strategy Deliverables

Export to TradingView PineScript v5, Python Bot, or Live Cloud Webhook

Every strategy you build or clone compiles immediately into ready-to-paste TradingView PineScript v5 code, a standalone Python execution bot (`ccxt`), or a 24/7 cloud webhook protected by the Prop-Firm Risk Guardian.

// Paste directly into TradingView -> Pine Editor -> "Add to chart" (ETHUSDT · 4h)

// This Pine Script™ v5 strategy was auto-generated by Traderry.com Quant Foundry
// Strategy: Perp Funding Z-Score Mean-Reversion
// Instrument: ETHUSDT · Timeframe: 4h · Direction: long_short
// Canonical Verification Hash: 572d738014a4d094d729e2589b4d77b1403e9acc971acc15f5c875294dada8ff
//@version=5
strategy("Perp Funding Z-Score Mean-Reversion [Traderry]", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=55, commission_type=strategy.commission.percent, commission_value=0.05)

// --- 1. Risk & Execution Inputs ---
stopAtrMult   = input.float(2.8, "Stop-Loss ATR Multiplier", minval=0.25, maxval=10.0, step=0.1)
targetAtrMult = input.float(4.5, "Take-Profit ATR Multiplier", minval=0.25, maxval=20.0, step=0.1)
cooldownBars  = input.int(1, "Cooldown Bars After Exit", minval=0, maxval=50)

// --- 2. Strictly Causal Indicator Engine ---
rsi_14 = ta.rsi(close, 14)
ema_21 = ta.ema(close, 21)
atr_14 = ta.atr(14)

// --- 3. Signal Conditions (Evaluated on Bar Close) ---
longEntryCond  = (rsi_14 < 38)
longExitCond   = (rsi_14 > 56)
shortEntryCond = (rsi_14 > 56)
shortExitCond  = (rsi_14 < 38)

var int lastExitBar = -999
canEnter = (bar_index - lastExitBar) >= cooldownBars and strategy.position_size == 0

// --- 4. Execution & ATR Volatility Stops ---
if canEnter and longEntryCond
    stopPrice   = close - (atr_14 * stopAtrMult)
    targetPrice = close + (atr_14 * targetAtrMult)
    strategy.entry("Long", strategy.long, alert_message='{"strategy_hash":"572d738014a4d094","symbol":"ETHUSDT","side":"LONG","timeframe":"4h"}')
    strategy.exit("Long SL/TP", from_entry="Long", stop=stopPrice, limit=targetPrice)

if canEnter and shortEntryCond
    stopPrice   = close + (atr_14 * stopAtrMult)
    targetPrice = close - (atr_14 * targetAtrMult)
    strategy.entry("Short", strategy.short, alert_message='{"strategy_hash":"572d738014a4d094","symbol":"ETHUSDT","side":"SHORT","timeframe":"4h"}')
    strategy.exit("Short SL/TP", from_entry="Short", stop=stopPrice, limit=targetPrice)

if strategy.position_size > 0 and longExitCond
    strategy.close("Long", comment="Signal Exit")
    lastExitBar := bar_index

if strategy.position_size < 0 and shortExitCond
    strategy.close("Short", comment="Signal Exit")
    lastExitBar := bar_index
In-sample versus Out-of-Sample Validation metrics
MetricIn-sample 75%Out-of-sample 25%Delta
Net return-0.15%+8.98%+9.13%
CAGR-0.89%+350.83%+351.72%
Sharpe0.0921.2771.185
Sortino0.1151.4701.355
Calmar-0.09145.90045.990
Max drawdown-9.81%-7.64%+2.17%
Win rate+53.85%+66.67%+12.82%
Profit factor1.1101.8490.739
Trades136-7
Avg trade+0.26%+1.24%+0.98%
Exposure+90.93%+64.80%-26.13%

Normalized equity ($10,000 base)

Real mark-to-market strategy equity versus buy-and-hold benchmark.

250 pts · 75/25 IS/OOS

25% Out-of-Sample Validation$14499$92232026-11-09DRAWDOWN-9.8%2026-08-182026-11-09● Equity ┄ Benchmark

Monte Carlo fan

p5 / p50 / p95 terminal paths. Historical resampling, not a forecast.

1,000 paths

69.1%-26.2%step 0step 24

p95 max DD

-8.68%

Prop-Firm Pass Probability

Ruin risk 98.40%

p5
-25.9%
p50
+11.8%
p95
+69.1%

Regime

Bull Trend

-10.40%

Sharpe
-1.81
Win rate
+25.0%
Bar share
+13.6%

Regime

Bear Market

+22.89%

Sharpe
3.78
Win rate
+60.0%
Bar share
+23.6%

Regime

Macro Volatility

-5.45%

Sharpe
-0.46
Win rate
+75.0%
Bar share
+28.2%

Regime

Range / Chop

+4.21%

Sharpe
0.50
Win rate
+50.0%
Bar share
+34.6%

Rules in plain structure

Long entry · rsi_14 LT 38
Long exit · rsi_14 GT 56
Short entry · rsi_14 GT 56
Short exit · rsi_14 LT 38

572d738014a4d094d729e2589b4d77b1403e9acc971acc15f5c875294dada8ff

Mathematical critique

Traderry Quant Audit Engine

Statistical edge shows decay; tune risk filters.

Statistical weaknesses

  • Low trade count reduces statistical confidence

Regime vulnerabilities

  • HIGH_VOL_MACRO whipsaw
  • BEAR_DRAWDOWN drift

Parameter notes

  • Tighten stop_loss_atr_mult by 0.25
  • Increase cooldown_bars by 1
Clone & Customize in Foundry
Autonomous Desk Intelligence Briefing

Get the Daily Out-of-Sample Ledger & Macro Lockout Alerts.

Receive automated post-mortems when House Agents close high-conviction positions, weekly newly verified Out-of-Sample tearsheets, and 15-minute pre-release CPI/FOMC risk lockout warnings via email or instant Discord/Telegram webhook.

Zero spam. Instant 1-click unsubscribe. Non-custodial quantitative research only.