OPEN-SOURCE SCRIPT
VTS Strategy [Quision]

Overview
This strategy is built on top of BackQuant's Volatility Trend Score indicator, an open-source tool that quantifies trend persistence through a volatility-adjusted trailing structure and a rolling comparison score.
The original indicator answers a critical question: "Is the market trending with conviction, or is it chopping?" - by scoring how consistently an ATR-based trailing level advances over a configurable lookback window. This strategy wraps that core logic into a fully tradeable system with proper risk management, flexible exit modes, and session filtering.
All credit for the core indicator logic goes to BackQuant. This publication adds only the strategy execution layer.
What This Strategy Adds
1. ATR-Based Stop Loss
A dedicated ATR stop loss (independent of the indicator's core ATR) protects every trade with a volatility-scaled risk level. The SL ATR period and multiplier are fully configurable, allowing you to tune risk independently from the signal generation.
2. Risk:Reward Take Profit
The take profit is calculated as a multiple of the stop loss distance.
3. Three Exit Modes
The strategy offers three distinct exit modes to match different trading styles:
- Signal Flip Only, Exits only when the VTS score flips to the opposite regime. No SL/TP. Pure trend-following.
- SL/TP Only, Exits only when the stop loss or take profit is hit. Ignores signal flips. Pure risk management.
- Signal Flip + SL/TP, Both mechanisms are active. Maximum flexibility.
4. Optional Trailing Stop
When enabled, the trailing stop progressively tightens the stop loss as the trade moves in your favor. It only activates after the position is in profit.
5. Session Filter
Restrict trading to specific hours. Configurable timezone support (Exchange, UTC, Europe/Rome, America/New_York, Europe/London, Asia/Tokyo).
Recommended Usage
This strategy works best on instruments with clear trending behavior and sufficient volatility. The VTS core logic excels at filtering out choppy conditions, making it particularly effective on:
Crypto pairs (BTC, ETH)
Gold (XAUUSD)
Major forex pairs
Index futures
Suggested starting settings:
ATR Period: 35, Factor: 1.2
Loop: 1–45 (default)
Long Threshold: 40, Short Threshold: -10 (default)
SL ATR Period: 14, SL Multiplier: 3.0
TP R:R: 6.0
Session: adjust to your instrument's active hours
Important Notes
The core indicator logic is entirely BackQuant's work. Please refer to the original publication for detailed documentation on the scoring mechanism, tuning guidelines, and theoretical foundations.
This strategy is built on top of BackQuant's Volatility Trend Score indicator, an open-source tool that quantifies trend persistence through a volatility-adjusted trailing structure and a rolling comparison score.
The original indicator answers a critical question: "Is the market trending with conviction, or is it chopping?" - by scoring how consistently an ATR-based trailing level advances over a configurable lookback window. This strategy wraps that core logic into a fully tradeable system with proper risk management, flexible exit modes, and session filtering.
All credit for the core indicator logic goes to BackQuant. This publication adds only the strategy execution layer.
What This Strategy Adds
1. ATR-Based Stop Loss
A dedicated ATR stop loss (independent of the indicator's core ATR) protects every trade with a volatility-scaled risk level. The SL ATR period and multiplier are fully configurable, allowing you to tune risk independently from the signal generation.
2. Risk:Reward Take Profit
The take profit is calculated as a multiple of the stop loss distance.
3. Three Exit Modes
The strategy offers three distinct exit modes to match different trading styles:
- Signal Flip Only, Exits only when the VTS score flips to the opposite regime. No SL/TP. Pure trend-following.
- SL/TP Only, Exits only when the stop loss or take profit is hit. Ignores signal flips. Pure risk management.
- Signal Flip + SL/TP, Both mechanisms are active. Maximum flexibility.
4. Optional Trailing Stop
When enabled, the trailing stop progressively tightens the stop loss as the trade moves in your favor. It only activates after the position is in profit.
5. Session Filter
Restrict trading to specific hours. Configurable timezone support (Exchange, UTC, Europe/Rome, America/New_York, Europe/London, Asia/Tokyo).
Recommended Usage
This strategy works best on instruments with clear trending behavior and sufficient volatility. The VTS core logic excels at filtering out choppy conditions, making it particularly effective on:
Crypto pairs (BTC, ETH)
Gold (XAUUSD)
Major forex pairs
Index futures
Suggested starting settings:
ATR Period: 35, Factor: 1.2
Loop: 1–45 (default)
Long Threshold: 40, Short Threshold: -10 (default)
SL ATR Period: 14, SL Multiplier: 3.0
TP R:R: 6.0
Session: adjust to your instrument's active hours
Important Notes
The core indicator logic is entirely BackQuant's work. Please refer to the original publication for detailed documentation on the scoring mechanism, tuning guidelines, and theoretical foundations.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.