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.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
We test strategies so you don't have to. Research: @backtestbay · Tools: backtestbay.gumroad.com
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
We test strategies so you don't have to. Research: @backtestbay · Tools: backtestbay.gumroad.com
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.