StratReceipt

← Back

Documentation

StratReceipt analyzes Pine Script strategies for common issues that cause unrealistic backtests or trading losses.

Detection Rules

We currently check for 11 different issues across three categories: Stability, Risk Management, and Backtest Realism.

🛑
Missing Stop Loss
RISK_NO_STOP
Detects strategy.entry() calls without corresponding strategy.exit() or stop-loss orders. Trading without stops exposes you to unlimited downside.
👁️
Lookahead Bias
STABILITY_LOOKAHEAD
Catches request.security()[0] which accesses unconfirmed bar data, and barmerge.lookahead_on which explicitly enables future data access.
🔄
MTF Repaint Risk
STABILITY_MTF_LOOKAHEAD
Flags multi-timeframe security() calls that may repaint. Higher timeframe data can change until the bar closes.
📈
Martingale Pattern
RISK_MARTINGALE
Detects position sizing based on strategy.losstrades or patterns that double down after losses. Martingale strategies eventually blow up.
🎯
Overfitting Risk
RISK_OVERFIT
Warns when strategies have excessive parameters that may be curve-fitted to historical data.
Calc On Every Tick
STABILITY_CALC_ON_TICK
calc_on_every_tick=true causes strategies to recalculate on every price update, producing unreproducible backtest results.
📊
Pyramiding Risk
RISK_PYRAMIDING
High pyramiding values allow multiple concurrent positions, amplifying both gains and losses.
🎲
Unrealistic Fill
BACKTEST_UNREALISTIC_FILL
Limit orders at close price guarantee fills in backtests but rarely execute in live trading.
💰
No Commission
BACKTEST_NO_COMMISSION
Strategies without commission_type/commission_value overestimate profits by ignoring trading costs.
📏
Fixed Quantity
RISK_FIXED_QTY
Using fixed position sizes instead of strategy.percent_of_equity leads to inconsistent risk per trade.
⚠️
High Leverage
RISK_HIGH_LEVERAGE
Margin settings implying 20x+ leverage significantly amplify losses and increase liquidation risk.

Rating System

Each strategy receives a score from 0-100 and a letter grade. Scores are calculated by deducting points for each detected issue, weighted by severity and confidence.

A
90-100
Verified Safe
B
70-89
Low Risk
C
50-69
Moderate Risk
D
30-49
High Risk
F
0-29
Critical Issues

Category Scores

🔒 Stability
Measures how consistently the strategy behaves. Lookahead bias and repainting issues lower this score.
⚖️ Risk Management
Evaluates position sizing and risk controls. Missing stops, martingale, and high leverage reduce this score.
📈 Backtest Realism
How likely backtests reflect live performance. No commission and unrealistic fills hurt this score.