OPEN-SOURCE SCRIPT
Cập nhật Candle Repainter - Price Direction

# 🎯 Candle Repainter - Price Direction by Mustang Algo
## Overview
A powerful and versatile indicator that repaints candles in real-time based on price direction detection. This tool helps traders quickly identify market trends by coloring candles according to bullish, bearish, or neutral momentum.
## 🌟 Key Features
### 5 Detection Methods
Choose from multiple sophisticated algorithms to detect price direction:
1. **EMA Trend** - Compares price against Exponential Moving Average with momentum confirmation
2. **Price vs SMA** - Classic crossover method using Simple Moving Average
3. **Momentum** - Pure momentum-based detection for aggressive signals
4. **Higher High/Lower Low** - Structure-based analysis identifying swing points
5. **Supertrend** - Popular ATR-based trend following system
### Visual Features
- 🟢 **Green Candles** - Bullish trend detected
- 🔴 **Red Candles** - Bearish trend detected
- ⚪ **Gray Candles** - Neutral/indecisive market
- 🔺 **Triangle Signals** - Mark trend changes (optional)
- 📊 **Background Coloring** - Subtle background highlighting
- 📈 **Overlay Indicators** - Display the chosen MA/Supertrend line
### Smart Signal System
- **Default Mode**: Shows triangles ONLY on trend changes (cleaner charts)
- **All Candles Mode**: Display signals on every bullish/bearish candle
- Customizable signal visibility
- Real-time statistics table
## ⚙️ Customizable Parameters
### Method-Specific Settings
- **EMA Length** (default: 20) - For EMA Trend method
- **SMA Length** (default: 50) - For Price vs SMA method
- **Momentum Period** (default: 14) - For Momentum method
- **HH/LL Lookback** (default: 10) - For Higher High/Lower Low method
- **ATR Period** (default: 10) - For Supertrend method
- **ATR Multiplier** (default: 3.0) - For Supertrend method
### Visual Controls
- Toggle signal display on/off
- Choose between change signals or all candles
- Background highlighting control
## 📊 Real-Time Dashboard
A compact table displays:
- Current trend direction (Bullish/Bearish/Neutral)
- Active detection method
- Creator credit (Mustang Algo)
## 🔔 Built-in Alerts
Set up automated alerts for:
- Bullish trend changes
- Bearish trend changes
## 💡 How to Use
### For Day Traders
- Use **EMA Trend** with shorter periods (10-20)
- Enable "Show all candles" for continuous feedback
- Combine with volume for confirmation
### For Swing Traders
- Use **Supertrend** or **Price vs SMA** with longer periods (50-200)
- Keep default "changes only" mode for cleaner entries
- Perfect for multi-timeframe analysis
### For Scalpers
- Use **Momentum** method for fastest signals
- Lower timeframes (1m-5m)
- Combine with support/resistance levels
## 🎨 Best Practices
1. **Multiple Timeframes**: Confirm direction on higher timeframe
2. **Combine Methods**: Test different detection methods for your asset
3. **Risk Management**: Use stop-losses, don't rely solely on color changes
4. **Backtesting**: Test parameters on historical data before live trading
## ⚠️ Important Notes
- This is a **repainting indicator** - signals may change as new data arrives
- Best used for **trend confirmation**, not as standalone entry/exit signals
- Different methods work better on different market conditions
- Always combine with proper risk management
## 📈 Recommended Settings by Market
### Crypto (High Volatility)
- Method: Supertrend
- ATR Period: 10
- ATR Multiplier: 3.0
### Forex (Trending Markets)
- Method: EMA Trend or Price vs SMA
- Period: 20-50
### Stocks (Moderate Volatility)
- Method: Higher High/Lower Low
- Lookback: 10-15
## 🏆 Credits
**Created by Mustang Algo**
Version 1.0 - November 2025
## 📞 Support
For questions, suggestions, or bug reports, please contact Mustang Algo.
---
### Tags
`trend` `candles` `repainter` `moving-average` `supertrend` `momentum` `signals` `alerts` `multi-method` `daytrading` `swingtrading`
### Category
Trend Analysis
### License
This indicator is open source. Feel free to modify and adapt to your needs.
## Overview
A powerful and versatile indicator that repaints candles in real-time based on price direction detection. This tool helps traders quickly identify market trends by coloring candles according to bullish, bearish, or neutral momentum.
## 🌟 Key Features
### 5 Detection Methods
Choose from multiple sophisticated algorithms to detect price direction:
1. **EMA Trend** - Compares price against Exponential Moving Average with momentum confirmation
2. **Price vs SMA** - Classic crossover method using Simple Moving Average
3. **Momentum** - Pure momentum-based detection for aggressive signals
4. **Higher High/Lower Low** - Structure-based analysis identifying swing points
5. **Supertrend** - Popular ATR-based trend following system
### Visual Features
- 🟢 **Green Candles** - Bullish trend detected
- 🔴 **Red Candles** - Bearish trend detected
- ⚪ **Gray Candles** - Neutral/indecisive market
- 🔺 **Triangle Signals** - Mark trend changes (optional)
- 📊 **Background Coloring** - Subtle background highlighting
- 📈 **Overlay Indicators** - Display the chosen MA/Supertrend line
### Smart Signal System
- **Default Mode**: Shows triangles ONLY on trend changes (cleaner charts)
- **All Candles Mode**: Display signals on every bullish/bearish candle
- Customizable signal visibility
- Real-time statistics table
## ⚙️ Customizable Parameters
### Method-Specific Settings
- **EMA Length** (default: 20) - For EMA Trend method
- **SMA Length** (default: 50) - For Price vs SMA method
- **Momentum Period** (default: 14) - For Momentum method
- **HH/LL Lookback** (default: 10) - For Higher High/Lower Low method
- **ATR Period** (default: 10) - For Supertrend method
- **ATR Multiplier** (default: 3.0) - For Supertrend method
### Visual Controls
- Toggle signal display on/off
- Choose between change signals or all candles
- Background highlighting control
## 📊 Real-Time Dashboard
A compact table displays:
- Current trend direction (Bullish/Bearish/Neutral)
- Active detection method
- Creator credit (Mustang Algo)
## 🔔 Built-in Alerts
Set up automated alerts for:
- Bullish trend changes
- Bearish trend changes
## 💡 How to Use
### For Day Traders
- Use **EMA Trend** with shorter periods (10-20)
- Enable "Show all candles" for continuous feedback
- Combine with volume for confirmation
### For Swing Traders
- Use **Supertrend** or **Price vs SMA** with longer periods (50-200)
- Keep default "changes only" mode for cleaner entries
- Perfect for multi-timeframe analysis
### For Scalpers
- Use **Momentum** method for fastest signals
- Lower timeframes (1m-5m)
- Combine with support/resistance levels
## 🎨 Best Practices
1. **Multiple Timeframes**: Confirm direction on higher timeframe
2. **Combine Methods**: Test different detection methods for your asset
3. **Risk Management**: Use stop-losses, don't rely solely on color changes
4. **Backtesting**: Test parameters on historical data before live trading
## ⚠️ Important Notes
- This is a **repainting indicator** - signals may change as new data arrives
- Best used for **trend confirmation**, not as standalone entry/exit signals
- Different methods work better on different market conditions
- Always combine with proper risk management
## 📈 Recommended Settings by Market
### Crypto (High Volatility)
- Method: Supertrend
- ATR Period: 10
- ATR Multiplier: 3.0
### Forex (Trending Markets)
- Method: EMA Trend or Price vs SMA
- Period: 20-50
### Stocks (Moderate Volatility)
- Method: Higher High/Lower Low
- Lookback: 10-15
## 🏆 Credits
**Created by Mustang Algo**
Version 1.0 - November 2025
## 📞 Support
For questions, suggestions, or bug reports, please contact Mustang Algo.
---
### Tags
`trend` `candles` `repainter` `moving-average` `supertrend` `momentum` `signals` `alerts` `multi-method` `daytrading` `swingtrading`
### Category
Trend Analysis
### License
This indicator is open source. Feel free to modify and adapt to your needs.
Phát hành các Ghi chú
# 🎯 Candle Repainter - Price Direction by Mustang Algo## Overview
A powerful and versatile indicator that repaints candles in real-time based on price direction detection. This tool helps traders quickly identify market trends by coloring candles according to bullish, bearish, or neutral momentum.
## 🌟 Key Features
### 5 Detection Methods
Choose from multiple sophisticated algorithms to detect price direction:
1. **EMA Trend** - Compares price against Exponential Moving Average with momentum confirmation
2. **Price vs SMA** - Classic crossover method using Simple Moving Average
3. **Momentum** - Pure momentum-based detection for aggressive signals
4. **Higher High/Lower Low** - Structure-based analysis identifying swing points
5. **Supertrend** - Popular ATR-based trend following system
### Visual Features
- 🟢 **Green Candles** - Bullish trend detected
- 🔴 **Red Candles** - Bearish trend detected
- ⚪ **Gray Candles** - Neutral/indecisive market
- 🔺 **Triangle Signals** - Mark trend changes (optional)
- 📊 **Background Coloring** - Subtle background highlighting
- 📈 **Overlay Indicators** - Display the chosen MA/Supertrend line
### Smart Signal System
- **Default Mode**: Shows triangles ONLY on trend changes (cleaner charts)
- **All Candles Mode**: Display signals on every bullish/bearish candle
- Customizable signal visibility
- Real-time statistics table
## ⚙️ Customizable Parameters
### Method-Specific Settings
- **EMA Length** (default: 20) - For EMA Trend method
- **SMA Length** (default: 50) - For Price vs SMA method
- **Momentum Period** (default: 14) - For Momentum method
- **HH/LL Lookback** (default: 10) - For Higher High/Lower Low method
- **ATR Period** (default: 10) - For Supertrend method
- **ATR Multiplier** (default: 3.0) - For Supertrend method
### Visual Controls
- Toggle signal display on/off
- Choose between change signals or all candles
- Background highlighting control
## 📊 Real-Time Dashboard
A compact table displays:
- Current trend direction (Bullish/Bearish/Neutral)
- Active detection method
- Creator credit (Mustang Algo)
## 🔔 Built-in Alerts
Set up automated alerts for:
- Bullish trend changes
- Bearish trend changes
## 💡 How to Use
### For Day Traders
- Use **EMA Trend** with shorter periods (10-20)
- Enable "Show all candles" for continuous feedback
- Combine with volume for confirmation
### For Swing Traders
- Use **Supertrend** or **Price vs SMA** with longer periods (50-200)
- Keep default "changes only" mode for cleaner entries
- Perfect for multi-timeframe analysis
### For Scalpers
- Use **Momentum** method for fastest signals
- Lower timeframes (1m-5m)
- Combine with support/resistance levels
## 🎨 Best Practices
1. **Multiple Timeframes**: Confirm direction on higher timeframe
2. **Combine Methods**: Test different detection methods for your asset
3. **Risk Management**: Use stop-losses, don't rely solely on color changes
4. **Backtesting**: Test parameters on historical data before live trading
## ⚠️ Important Notes
- This is a **repainting indicator** - signals may change as new data arrives
- Best used for **trend confirmation**, not as standalone entry/exit signals
- Different methods work better on different market conditions
- Always combine with proper risk management
## 📈 Recommended Settings by Market
### Crypto (High Volatility)
- Method: Supertrend
- ATR Period: 10
- ATR Multiplier: 3.0
### Forex (Trending Markets)
- Method: EMA Trend or Price vs SMA
- Period: 20-50
### Stocks (Moderate Volatility)
- Method: Higher High/Lower Low
- Lookback: 10-15
## 🏆 Credits
**Created by Mustang Algo**
Version 1.0 - November 2025
## 📞 Support
For questions, suggestions, or bug reports, please contact Mustang Algo.
---
### Tags
`trend` `candles` `repainter` `moving-average` `supertrend` `momentum` `signals` `alerts` `multi-method` `daytrading` `swingtrading`
### Category
Trend Analysis
### License
This indicator is open source. Feel free to modify and adapt to your needs.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.