OPEN-SOURCE SCRIPT
Diupdate Trend Following $ZEC - Multi-Timeframe Structure Filter + Revers

# Trend Following
ZEC - Strategy Guide
## 📊 Strategy Overview
Trend Following
ZEC is an enhanced Turtle Trading system designed for cryptocurrency spot trading, combining Donchian Channel breakouts, multi-timeframe structure filtering, and ATR-based dynamic risk management for both long and short positions.
---
## 🎯 Core Features
1. Multi-Timeframe Structure Filtering
- Uses Swing High/Low to identify market structure
- Customizable structure timeframe (default: 1 minute)
- Only enters trades in the direction of the trend, avoiding counter-trend positions
2. Reverse Signal Exit
- No fixed stop-loss or fixed-period exits
- Exits only when a reverse entry signal triggers
- Maximizes trend profits, reduces premature exits
3. ATR Dynamic Pyramiding
- Adds positions when price moves 0.5 ATR in favorable direction
- Supports up to 2 units maximum (adjustable)
- Pyramid scaling to enhance profitability
4. Complete Risk Management
- Fixed position size (5000 USD per unit)
- Commission fee 0.06% (Binance spot rate)
- Initial capital 10,000 USD
---
## 📈 Trading Logic
Entry Conditions
✅ Long Entry:
- Close price breaks above 20-period high
- Structure trend is bullish (price breaks above Swing High)
✅ Short Entry:
- Close price breaks below 20-period low
- Structure trend is bearish (price breaks below Swing Low)
Add Position Conditions
- Long: Price rises ≥ 0.5 ATR
- Short: Price falls ≥ 0.5 ATR
- Maximum 2 units including initial entry
Exit Conditions
- Long Exit: When short entry signal triggers (price breaks 20-period low + structure turns bearish)
- Short Exit: When long entry signal triggers (price breaks 20-period high + structure turns bullish)
---
## ⚙️ Parameter Settings
Channel Settings
- Entry Channel Period: 20 (Donchian Channel breakout period)
- Exit Channel Period: 10 (reserved parameter, actually uses reverse signal exit)
ATR Settings
- ATR Period: 20
- Stop Loss ATR Multiplier: 2.0 (reserved parameter)
- Add Position ATR Multiplier: 0.5
Structure Filter
- Swing Length: 160 (Swing High/Low calculation period)
- Structure Timeframe: 1 minute (can change to 5/15/60, etc.)
Position Management
- Maximum Units: 2 (including initial entry)
- Capital Per Unit: 5000 USD
---
## 🎨 Visualization Features
Background Colors
- Light Green: Bullish structure
- Light Red: Bearish structure
- Dark Green: Long entry
- Dark Red: Short entry
Optional Display (Default: OFF)
- Entry/exit channel lines
- Structure high/low lines
- ATR stop-loss line
- Next add position indicator
- Entry/exit labels
---
## 📱 Alert Message Format
Strategy sends notifications on entry/exit with the following format:
- Entry: `1m Long EP:428.26`
- Add Position: `15m Add Long 2/2 EP:429.50`
- Exit: `1m Close Long Reverse Signal`
Where:
- `1m`/`15m` = Current chart timeframe
- `EP` = Entry Price
---
## 💰 Backtest Settings
Capital Allocation
- Initial Capital: 10,000 USD
- Per Entry: 5,000 USD (split into 2 entries)
- Leverage: 0x (spot trading)
Trading Costs
- Commission: 0.06% (Binance spot VIP0)
- Slippage: 0
---
## 🎯 Use Cases
✅ Best Scenarios
- Trending markets
- Moderate volatility assets
- 1-minute to 4-hour timeframes
⚠️ Not Suitable For
- Highly volatile choppy markets
- Low liquidity small-cap coins
- Extreme market conditions (black swan events)
---
## 📊 Usage Recommendations
Timeframe Suggestions
| Timeframe | Trading Style | Suggested Parameter Adjustment |
|-----------|--------------|-------------------------------|
| 1-5 min | Scalping | Swing Length 100-160 |
| 15-30 min | Short-term | Swing Length 50-100 |
| 1-4 hour | Swing Trading | Swing Length 20-50 |
Optimization Tips
1. Adjust swing length based on backtest results
2. Different coins may require different parameters
3. Recommend backtesting on 1-minute chart first before live trading
4. Enable labels to observe entry/exit points
---
## ⚠️ Risk Disclaimer
1. Past Performance Does Not Guarantee Future Results
- Backtest data is for reference only
- Live trading may be affected by slippage, delays, etc.
2. Market Condition Changes
- Strategy performs better in trending markets
- May experience frequent stops in ranging markets
3. Capital Management
- Do not invest more than you can afford to lose
- Recommend setting total capital stop-loss threshold
4. Commission Impact
- Frequent trading accumulates commission fees
- Recommend using exchange discounts (BNB fee reduction, etc.)
---
## 🔧 Troubleshooting
Q: No entry signals?
A: Check if structure filter is too strict, adjust swing length or timeframe
Q: Too many labels displayed?
A: Turn off "Show Labels" option in settings
Q: Poor backtest performance?
A:
1. Check if the coin is suitable for trend-following strategies
2. Adjust parameters (swing length, channel period)
3. Try different timeframes
Q: How to set alerts?
A:
1. Click "Alert" in top-right corner of chart
2. Condition: Select "Strategy - Trend Following
ZEC"
3. Choose "Order filled"
4. Set notification method (Webhook/Email/App)
---
## 📞 Contact Information
Strategy Name: Trend Following
ZEC
Version: v1.0
Pine Script Version: v6
Last Updated: December 2025
---
## 📄 Copyright Notice
This strategy is for educational and research purposes only.
All risks of using this strategy for live trading are borne by the user.
Commercial use without authorization is prohibited.
---
## 🎓 Learning Resources
To understand the strategy principles in depth, recommended reading:
- "The Complete TurtleTrader" - Curtis Faith
- "Trend Following" - Michael Covel
- TradingView Pine Script Official Documentation
---
Happy Trading! Remember to manage your risk 📈
## 📊 Strategy Overview
Trend Following
---
## 🎯 Core Features
1. Multi-Timeframe Structure Filtering
- Uses Swing High/Low to identify market structure
- Customizable structure timeframe (default: 1 minute)
- Only enters trades in the direction of the trend, avoiding counter-trend positions
2. Reverse Signal Exit
- No fixed stop-loss or fixed-period exits
- Exits only when a reverse entry signal triggers
- Maximizes trend profits, reduces premature exits
3. ATR Dynamic Pyramiding
- Adds positions when price moves 0.5 ATR in favorable direction
- Supports up to 2 units maximum (adjustable)
- Pyramid scaling to enhance profitability
4. Complete Risk Management
- Fixed position size (5000 USD per unit)
- Commission fee 0.06% (Binance spot rate)
- Initial capital 10,000 USD
---
## 📈 Trading Logic
Entry Conditions
✅ Long Entry:
- Close price breaks above 20-period high
- Structure trend is bullish (price breaks above Swing High)
✅ Short Entry:
- Close price breaks below 20-period low
- Structure trend is bearish (price breaks below Swing Low)
Add Position Conditions
- Long: Price rises ≥ 0.5 ATR
- Short: Price falls ≥ 0.5 ATR
- Maximum 2 units including initial entry
Exit Conditions
- Long Exit: When short entry signal triggers (price breaks 20-period low + structure turns bearish)
- Short Exit: When long entry signal triggers (price breaks 20-period high + structure turns bullish)
---
## ⚙️ Parameter Settings
Channel Settings
- Entry Channel Period: 20 (Donchian Channel breakout period)
- Exit Channel Period: 10 (reserved parameter, actually uses reverse signal exit)
ATR Settings
- ATR Period: 20
- Stop Loss ATR Multiplier: 2.0 (reserved parameter)
- Add Position ATR Multiplier: 0.5
Structure Filter
- Swing Length: 160 (Swing High/Low calculation period)
- Structure Timeframe: 1 minute (can change to 5/15/60, etc.)
Position Management
- Maximum Units: 2 (including initial entry)
- Capital Per Unit: 5000 USD
---
## 🎨 Visualization Features
Background Colors
- Light Green: Bullish structure
- Light Red: Bearish structure
- Dark Green: Long entry
- Dark Red: Short entry
Optional Display (Default: OFF)
- Entry/exit channel lines
- Structure high/low lines
- ATR stop-loss line
- Next add position indicator
- Entry/exit labels
---
## 📱 Alert Message Format
Strategy sends notifications on entry/exit with the following format:
- Entry: `1m Long EP:428.26`
- Add Position: `15m Add Long 2/2 EP:429.50`
- Exit: `1m Close Long Reverse Signal`
Where:
- `1m`/`15m` = Current chart timeframe
- `EP` = Entry Price
---
## 💰 Backtest Settings
Capital Allocation
- Initial Capital: 10,000 USD
- Per Entry: 5,000 USD (split into 2 entries)
- Leverage: 0x (spot trading)
Trading Costs
- Commission: 0.06% (Binance spot VIP0)
- Slippage: 0
---
## 🎯 Use Cases
✅ Best Scenarios
- Trending markets
- Moderate volatility assets
- 1-minute to 4-hour timeframes
⚠️ Not Suitable For
- Highly volatile choppy markets
- Low liquidity small-cap coins
- Extreme market conditions (black swan events)
---
## 📊 Usage Recommendations
Timeframe Suggestions
| Timeframe | Trading Style | Suggested Parameter Adjustment |
|-----------|--------------|-------------------------------|
| 1-5 min | Scalping | Swing Length 100-160 |
| 15-30 min | Short-term | Swing Length 50-100 |
| 1-4 hour | Swing Trading | Swing Length 20-50 |
Optimization Tips
1. Adjust swing length based on backtest results
2. Different coins may require different parameters
3. Recommend backtesting on 1-minute chart first before live trading
4. Enable labels to observe entry/exit points
---
## ⚠️ Risk Disclaimer
1. Past Performance Does Not Guarantee Future Results
- Backtest data is for reference only
- Live trading may be affected by slippage, delays, etc.
2. Market Condition Changes
- Strategy performs better in trending markets
- May experience frequent stops in ranging markets
3. Capital Management
- Do not invest more than you can afford to lose
- Recommend setting total capital stop-loss threshold
4. Commission Impact
- Frequent trading accumulates commission fees
- Recommend using exchange discounts (BNB fee reduction, etc.)
---
## 🔧 Troubleshooting
Q: No entry signals?
A: Check if structure filter is too strict, adjust swing length or timeframe
Q: Too many labels displayed?
A: Turn off "Show Labels" option in settings
Q: Poor backtest performance?
A:
1. Check if the coin is suitable for trend-following strategies
2. Adjust parameters (swing length, channel period)
3. Try different timeframes
Q: How to set alerts?
A:
1. Click "Alert" in top-right corner of chart
2. Condition: Select "Strategy - Trend Following
3. Choose "Order filled"
4. Set notification method (Webhook/Email/App)
---
## 📞 Contact Information
Strategy Name: Trend Following
Version: v1.0
Pine Script Version: v6
Last Updated: December 2025
---
## 📄 Copyright Notice
This strategy is for educational and research purposes only.
All risks of using this strategy for live trading are borne by the user.
Commercial use without authorization is prohibited.
---
## 🎓 Learning Resources
To understand the strategy principles in depth, recommended reading:
- "The Complete TurtleTrader" - Curtis Faith
- "Trend Following" - Michael Covel
- TradingView Pine Script Official Documentation
---
Happy Trading! Remember to manage your risk 📈
Catatan Rilis
# Trend Following ## 📊 Strategy Overview
Trend Following
---
## 🎯 Core Features
1. Multi-Timeframe Structure Filtering
- Uses Swing High/Low to identify market structure
- Customizable structure timeframe (default: 1 minute)
- Only enters trades in the direction of the trend, avoiding counter-trend positions
2. Reverse Signal Exit
- No fixed stop-loss or fixed-period exits
- Exits only when a reverse entry signal triggers
- Maximizes trend profits, reduces premature exits
3. ATR Dynamic Pyramiding
- Adds positions when price moves 0.5 ATR in favorable direction
- Supports up to 2 units maximum (adjustable)
- Pyramid scaling to enhance profitability
4. Complete Risk Management
- Fixed position size (5000 USD per unit)
- Commission fee 0.06% (Binance spot rate)
- Initial capital 10,000 USD
---
## 📈 Trading Logic
Entry Conditions
✅ Long Entry:
- Close price breaks above 20-period high
- Structure trend is bullish (price breaks above Swing High)
✅ Short Entry:
- Close price breaks below 20-period low
- Structure trend is bearish (price breaks below Swing Low)
Add Position Conditions
- Long: Price rises ≥ 0.5 ATR
- Short: Price falls ≥ 0.5 ATR
- Maximum 2 units including initial entry
Exit Conditions
- Long Exit: When short entry signal triggers (price breaks 20-period low + structure turns bearish)
- Short Exit: When long entry signal triggers (price breaks 20-period high + structure turns bullish)
---
## ⚙️ Parameter Settings
Channel Settings
- Entry Channel Period: 20 (Donchian Channel breakout period)
- Exit Channel Period: 10 (reserved parameter, actually uses reverse signal exit)
ATR Settings
- ATR Period: 20
- Stop Loss ATR Multiplier: 2.0 (reserved parameter)
- Add Position ATR Multiplier: 0.5
Structure Filter
- Swing Length: 160 (Swing High/Low calculation period)
- Structure Timeframe: 1 minute (can change to 5/15/60, etc.)
Position Management
- Maximum Units: 2 (including initial entry)
- Capital Per Unit: 5000 USD
---
## 🎨 Visualization Features
Background Colors
- Light Green: Bullish structure
- Light Red: Bearish structure
- Dark Green: Long entry
- Dark Red: Short entry
Optional Display (Default: OFF)
- Entry/exit channel lines
- Structure high/low lines
- ATR stop-loss line
- Next add position indicator
- Entry/exit labels
---
## 📱 Alert Message Format
Strategy sends notifications on entry/exit with the following format:
- Entry: `1m Long EP:428.26`
- Add Position: `15m Add Long 2/2 EP:429.50`
- Exit: `1m Close Long Reverse Signal`
Where:
- `1m`/`15m` = Current chart timeframe
- `EP` = Entry Price
---
## 💰 Backtest Settings
Capital Allocation
- Initial Capital: 10,000 USD
- Per Entry: 5,000 USD (split into 2 entries)
- Leverage: 0x (spot trading)
Trading Costs
- Commission: 0.06% (Binance spot VIP0)
- Slippage: 0
---
## 🎯 Use Cases
✅ Best Scenarios
- Trending markets
- Moderate volatility assets
- 1-minute to 4-hour timeframes
⚠️ Not Suitable For
- Highly volatile choppy markets
- Low liquidity small-cap coins
- Extreme market conditions (black swan events)
---
## 📊 Usage Recommendations
Timeframe Suggestions
| Timeframe | Trading Style | Suggested Parameter Adjustment |
|-----------|--------------|-------------------------------|
| 1-5 min | Scalping | Swing Length 100-160 |
| 15-30 min | Short-term | Swing Length 50-100 |
| 1-4 hour | Swing Trading | Swing Length 20-50 |
Optimization Tips
1. Adjust swing length based on backtest results
2. Different coins may require different parameters
3. Recommend backtesting on 1-minute chart first before live trading
4. Enable labels to observe entry/exit points
---
## ⚠️ Risk Disclaimer
1. Past Performance Does Not Guarantee Future Results
- Backtest data is for reference only
- Live trading may be affected by slippage, delays, etc.
2. Market Condition Changes
- Strategy performs better in trending markets
- May experience frequent stops in ranging markets
3. Capital Management
- Do not invest more than you can afford to lose
- Recommend setting total capital stop-loss threshold
4. Commission Impact
- Frequent trading accumulates commission fees
- Recommend using exchange discounts (BNB fee reduction, etc.)
---
## 🔧 Troubleshooting
Q: No entry signals?
A: Check if structure filter is too strict, adjust swing length or timeframe
Q: Too many labels displayed?
A: Turn off "Show Labels" option in settings
Q: Poor backtest performance?
A:
1. Check if the coin is suitable for trend-following strategies
2. Adjust parameters (swing length, channel period)
3. Try different timeframes
Q: How to set alerts?
A:
1. Click "Alert" in top-right corner of chart
2. Condition: Select "Strategy - Trend Following
3. Choose "Order filled"
4. Set notification method (Webhook/Email/App)
---
## 📞 Contact Information
Strategy Name: Trend Following
Version: v1.0
Pine Script Version: v6
Last Updated: December 2025
---
## 📄 Copyright Notice
This strategy is for educational and research purposes only.
All risks of using this strategy for live trading are borne by the user.
Commercial use without authorization is prohibited.
---
## 🎓 Learning Resources
To understand the strategy principles in depth, recommended reading:
- "The Complete TurtleTrader" - Curtis Faith
- "Trend Following" - Michael Covel
- TradingView Pine Script Official Documentation
---
Happy Trading! Remember to manage your risk 📈
Catatan Rilis
# Trend Following ## 📊 Strategy Overview
Trend Following
---
## 🎯 Core Features
### 1. Multi-Timeframe Structure Filtering
- Uses Swing High/Low to identify market structure
- Customizable structure timeframe (default: 1 minute)
- Only enters trades in the direction of the trend, avoiding counter-trend positions
### 2. Reverse Signal Exit
- No fixed stop-loss or fixed-period exits
- Exits only when a reverse entry signal triggers
- Maximizes trend profits, reduces premature exits
### 3. ATR Dynamic Pyramiding
- Adds positions when price moves 0.5 ATR in favorable direction
- Supports up to 2 units maximum (adjustable)
- Pyramid scaling to enhance profitability
### 4. Complete Risk Management
- Fixed position size (5000 USD per unit)
- Commission fee 0.06% (Binance spot rate)
- Initial capital 10,000 USD
---
## 📈 Trading Logic
### Entry Conditions
✅ Long Entry:
- Close price breaks above 20-period high
- Structure trend is bullish (price breaks above Swing High)
✅ Short Entry:
- Close price breaks below 20-period low
- Structure trend is bearish (price breaks below Swing Low)
### Add Position Conditions
- Long: Price rises ≥ 0.5 ATR
- Short: Price falls ≥ 0.5 ATR
- Maximum 2 units including initial entry
### Exit Conditions
- Long Exit: When short entry signal triggers (price breaks 20-period low + structure turns bearish)
- Short Exit: When long entry signal triggers (price breaks 20-period high + structure turns bullish)
---
## ⚙️ Parameter Settings
### Channel Settings
- Entry Channel Period: 20 (Donchian Channel breakout period)
- Exit Channel Period: 10 (reserved parameter, actually uses reverse signal exit)
### ATR Settings
- ATR Period: 20
- Stop Loss ATR Multiplier: 2.0 (reserved parameter)
- Add Position ATR Multiplier: 0.5
### Structure Filter
- Swing Length: 160 (Swing High/Low calculation period)
- Structure Timeframe: 1 minute (can change to 5/15/60, etc.)
### Position Management
- Maximum Units: 2 (including initial entry)
- Capital Per Unit: 5000 USD
---
## 🎨 Visualization Features
### Background Colors
- Light Green: Bullish structure
- Light Red: Bearish structure
- Dark Green: Long entry
- Dark Red: Short entry
### Optional Display (Default: OFF)
- Entry/exit channel lines
- Structure high/low lines
- ATR stop-loss line
- Next add position indicator
- Entry/exit labels
---
## 📱 Alert Message Format
Strategy sends notifications on entry/exit with the following format:
- Entry: `1m Long EP:428.26`
- Add Position: `15m Add Long 2/2 EP:429.50`
- Exit: `1m Close Long Reverse Signal`
Where:
- `1m`/`15m` = Current chart timeframe
- `EP` = Entry Price
---
## 💰 Backtest Settings
### Capital Allocation
- Initial Capital: 10,000 USD
- Per Entry: 5,000 USD (split into 2 entries)
- Leverage: 0x (spot trading)
### Trading Costs
- Commission: 0.06% (Binance spot VIP0)
- Slippage: 0
---
## 🎯 Use Cases
### ✅ Best Scenarios
- Trending markets
- Moderate volatility assets
- 1-minute to 4-hour timeframes
### ⚠️ Not Suitable For
- Highly volatile choppy markets
- Low liquidity small-cap coins
- Extreme market conditions (black swan events)
---
## 📊 Usage Recommendations
### Timeframe Suggestions
| Timeframe | Trading Style | Suggested Parameter Adjustment |
|-----------|--------------|-------------------------------|
| 1-5 min | Scalping | Swing Length 100-160 |
| 15-30 min | Short-term | Swing Length 50-100 |
| 1-4 hour | Swing Trading | Swing Length 20-50 |
### Optimization Tips
1. Adjust swing length based on backtest results
2. Different coins may require different parameters
3. Recommend backtesting on 1-minute chart first before live trading
4. Enable labels to observe entry/exit points
---
## ⚠️ Risk Disclaimer
1. Past Performance Does Not Guarantee Future Results
- Backtest data is for reference only
- Live trading may be affected by slippage, delays, etc.
2. Market Condition Changes
- Strategy performs better in trending markets
- May experience frequent stops in ranging markets
3. Capital Management
- Do not invest more than you can afford to lose
- Recommend setting total capital stop-loss threshold
4. Commission Impact
- Frequent trading accumulates commission fees
- Recommend using exchange discounts (BNB fee reduction, etc.)
---
## 🔧 Troubleshooting
### Q: No entry signals?
A: Check if structure filter is too strict, adjust swing length or timeframe
### Q: Too many labels displayed?
A: Turn off "Show Labels" option in settings
### Q: Poor backtest performance?
A:
1. Check if the coin is suitable for trend-following strategies
2. Adjust parameters (swing length, channel period)
3. Try different timeframes
### Q: How to set alerts?
A:
1. Click "Alert" in top-right corner of chart
2. Condition: Select "Strategy - Trend Following
3. Choose "Order filled"
4. Set notification method (Webhook/Email/App)
---
## 📞 Contact Information
- Strategy Name: Trend Following
- Version: v1.0
- Pine Script Version: v6
- Last Updated: December 2025
---
## 📄 Copyright Notice
This strategy is for educational and research purposes only.
All risks of using this strategy for live trading are borne by the user.
Commercial use without authorization is prohibited.
---
## 🎓 Learning Resources
To understand the strategy principles in depth, recommended reading:
- "The Complete TurtleTrader" - Curtis Faith
- "Trend Following" - Michael Covel
- TradingView Pine Script Official Documentation
---
Happy Trading! Remember to manage your risk 📈
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.
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.
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.