OPEN-SOURCE SCRIPT
PSOL 01 Donchian Channels

PSOL 01 DC is a Trend Following strategy designed for VN30F1M (Vietnamese Stock Index Futures), built with Pine Script v5.
📌 Indicators used: Donchian Channel (20 periods) + SMA(200) trend filter (optional)
📐 Entry Rules:
- Long: Close breaks above the upper band of Donchian Channel (20) → entry at next bar open
- Short: Close breaks below the lower band of Donchian Channel (20) → entry at next bar open
🚪 Exit Rules:
- Stop Loss: configurable points from entry (default 10 pts)
- Take Profit: configurable points from entry (default 20 pts) — optional, can be disabled
- Reverse: position flips automatically when the opposite breakout signal fires
- End of Session: all positions closed at the first bar outside the session window
⏰ Time Filter:
Built-in session filter to avoid ATO (8:45–9:00) and ATC (14:30–15:00) periods.
Default session: 9:00 – 14:30. Start and end time are fully configurable via inputs.
🔧 Trend Filter (optional):
SMA(200) slope filter — Long only when SMA is rising (Bull), Short only when SMA is falling (Bear).
When disabled, the system runs as a continuous reversal engine: every Donchian breakout flips the position, with no time out of the market.
📍 Recommended for: VN30F1M intraday traders
🔗 Community: zalo.me/g/jvaykb078
📌 Indicators used: Donchian Channel (20 periods) + SMA(200) trend filter (optional)
📐 Entry Rules:
- Long: Close breaks above the upper band of Donchian Channel (20) → entry at next bar open
- Short: Close breaks below the lower band of Donchian Channel (20) → entry at next bar open
🚪 Exit Rules:
- Stop Loss: configurable points from entry (default 10 pts)
- Take Profit: configurable points from entry (default 20 pts) — optional, can be disabled
- Reverse: position flips automatically when the opposite breakout signal fires
- End of Session: all positions closed at the first bar outside the session window
⏰ Time Filter:
Built-in session filter to avoid ATO (8:45–9:00) and ATC (14:30–15:00) periods.
Default session: 9:00 – 14:30. Start and end time are fully configurable via inputs.
🔧 Trend Filter (optional):
SMA(200) slope filter — Long only when SMA is rising (Bull), Short only when SMA is falling (Bear).
When disabled, the system runs as a continuous reversal engine: every Donchian breakout flips the position, with no time out of the market.
📍 Recommended for: VN30F1M intraday traders
🔗 Community: zalo.me/g/jvaykb078
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.