OPEN-SOURCE SCRIPT

Strategy Validation Framework - Standardised ATR Exits & 1% Ris

801
A reusable backtesting template that applies consistent exit conditions to
any entry signal, allowing fair comparison between strategies.

HOW IT WORKS
Exits are driven entirely by ATR (Average True Range). Stop loss is placed
at a configurable multiple of ATR from entry (default: 3x ATR-14). Take
profit is set at a fixed multiple (default: 6x ATR, giving 2:1 R). Position
size is calculated so that the maximum loss on any trade equals a fixed
percentage of current equity (default: 1%), normalising risk across
instruments and account sizes.

WHY THIS EXISTS
Most strategy comparisons produce misleading results because each script
uses different stop distances, lot sizes, and commission assumptions. When
exits are standardised, you isolate the entry signal's actual edge rather
than comparing risk management decisions.

HOW TO USE
1. Paste your indicator logic below the INDICATOR comment line
2. Set longCondition / shortCondition to your entry signals
3. Open Strategy Tester — the framework handles exits, sizing, and costs
The placeholder entry (9/21 EMA cross) is an example only. Replace it.

DEFAULT PROPERTIES
ATR Length: 14 | Stop Loss: 3x ATR | Take Profit: 6x ATR (2:1 R)
Risk per trade: 1% | Commission: 0.01% per side | Slippage: 1 tick

LIMITATIONS
Results depend entirely on the entry logic substituted. The EMA cross
placeholder is for illustration only and does not represent a recommended
strategy. Backtesting results do not guarantee future performance.

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。