OPEN-SOURCE SCRIPT

UT Bot + Supertrend Combo

408
Your script is a **combined trading indicator** for TradingView that integrates the **UT Bot** and **Supertrend** strategies to generate buy and sell signals for financial markets. Here's a detailed breakdown of its functionality:

---

### **1. Purpose**

The script aims to:

* **Detect buy and sell signals** using the UT Bot and Supertrend strategies.
* **Provide visual indicators** on the chart for easier decision-making.
* **Highlight trends** and issue alerts when significant conditions are met.

---

### **2. Components**

#### **UT Bot**

* **Key Features**:

* Based on the ATR (Average True Range) for calculating dynamic stop-loss levels.
* Option to use **Heikin Ashi candles** for smoother signals.
* Produces buy and sell signals when the price crosses above or below a trailing stop level.

* **Inputs**:

* `ut_key_value`: Sensitivity of the trailing stop (multiplier of the ATR).
* `ut_atr_period`: The period for calculating the ATR.
* `ut_use_heikin_ashi`: A toggle to use Heikin Ashi candles instead of standard candles.

* **Logic**:

* Tracks price movements using ATR and dynamically adjusts stop levels.
* Generates:

* A **buy signal** when the price crosses above the trailing stop.
* A **sell signal** when the price crosses below the trailing stop.

#### **Supertrend**

* **Key Features**:

* Tracks the trend direction based on price and ATR.
* Highlights trends with color shading (green for uptrend, red for downtrend).
* Optional buy and sell signal plotting based on trend reversals.

* **Inputs**:

* `st_atr_period`: The period for ATR calculation.
* `st_multiplier`: Multiplier to determine the distance of the stop levels.
* `st_show_signals`: Toggle to show buy/sell signals.
* `st_highlighting`: Toggle for background trend highlighting.

* **Logic**:

* Tracks upward and downward trends.
* Generates:

* A **buy signal** when the trend shifts to bullish.
* A **sell signal** when the trend shifts to bearish.

---

### **3. Visual Features**

* **Buy and Sell Labels**:

* `UT Buy` and `UT Sell`: Show buy/sell signals based on UT Bot logic.
* `ST Buy` and `ST Sell`: Show buy/sell signals based on Supertrend logic.

* **Background Highlighting**:

* **Green shading** for uptrends in Supertrend.
* **Red shading** for downtrends in Supertrend.

---

### **4. Alerts**

Custom alerts for automation or notifications:

* **UT Bot Alerts**:

* Triggered when a buy or sell signal occurs.
* **Supertrend Alerts**:

* Triggered on trend reversals.

---

### **5. Flexibility**

* Adjust sensitivity and performance through inputs.
* Combine UT Bot and Supertrend for **confirmation-based trading strategies**.
* Enable/disable highlighting or signals for customization.

---

### **Use Cases**

* Ideal for traders looking for automated trend-following signals.
* Works well in **volatile markets** due to ATR's adaptability.
* Can be used to confirm trades by aligning signals from both strategies.

---

Let me know if you need additional modifications or further clarification!

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。