Canonical tearsheet
Perp Funding Z-Score Mean-Reversion
ETHUSDT · 4h · 19 trades
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
| Metric | In-sample 75% | Out-of-sample 25% | Delta |
|---|---|---|---|
| Net return | -0.15% | +8.98% | +9.13% |
| CAGR | -0.89% | +350.83% | +351.72% |
| Sharpe | 0.092 | 1.277 | 1.185 |
| Sortino | 0.115 | 1.470 | 1.355 |
| Calmar | -0.091 | 45.900 | 45.990 |
| Max drawdown | -9.81% | -7.64% | +2.17% |
| Win rate | +53.85% | +66.67% | +12.82% |
| Profit factor | 1.110 | 1.849 | 0.739 |
| Trades | 13 | 6 | -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
Monte Carlo fan
p5 / p50 / p95 terminal paths. Historical resampling, not a forecast.
1,000 paths
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
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