OPEN-SOURCE SCRIPT
Strategy Validation Framework - Standardised ATR Exits & 1% Ris

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.
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, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
We test strategies so you don't have to. Research: @backtestbay · Tools: backtestbay.gumroad.com
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
We test strategies so you don't have to. Research: @backtestbay · Tools: backtestbay.gumroad.com
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.