PROTECTED SOURCE SCRIPT
已更新

TrendBox AI)

105
📈 Multi Trend Boxes – Signals on Breakouts!
When the time is right, the trend speaks... and this tool listens for you.

Multi Trend Boxes (Signal on Breakout) is a premium indicator designed for professional traders. It dynamically analyzes price action across multiple lookback periods and generates clear signals only when meaningful breakouts occur.

🚀 Key Features:
Comprehensive trend analysis across 4 distinct periods

Automatically generated support and resistance boxes

Signals based on real-time interaction with key price zones

Filters out noise – triggers only on significant breakouts

Clean, minimal, and informative on-chart labeling

💡 Why This Indicator?
Markets constantly talk — but most of it is noise. This tool cuts through the chaos and highlights only the crucial breakout moments you truly need to see.

With its sleek visual design, algorithmic precision, and flexible visibility settings, it's an excellent companion for both intraday and swing traders.

📍If you're looking for a focused and smart signal tool on TradingView, Multi Trend Boxes is built for you.

📬 Contact: grltrkn.mi@gmail.com
發行說明
Below is a line-by-line walkthrough of the Pine Script you posted, entirely in English.

---

### 1. User-defined inputs

```pinescript
almaLen = input.int(20, title = "ALMA Length")
almaOffset = input.float(0.85, title = "Offset", minval = 0, maxval = 1)
almaSigma = input.float(6.0, title = "Sigma", minval = 0.1)
```

| Variable | Purpose | Default | Notes |
| -------------- | --------------------------------------------------- | ------- | -------------------------------------------------------------------- |
| **almaLen** | Window length for the ALMA calculation | 20 bars | Larger values smooth the curve more. |
| **almaOffset** | Shifts the Gaussian weight center left/right | 0.85 | 0 = perfectly symmetric; 1 = heaviest weight on the most recent bar. |
| **almaSigma** | Controls the spread (width) of the Gaussian weights | 6.0 | Smaller sigma → narrower, sharper weighting. |

> **ALMA recap**
> The *Arnaud Legoux Moving Average* applies a Gaussian weighting scheme across a rolling window. Offset and Sigma let you tune lag vs. smoothness.

---

### 2. Calculating the ALMA line

```pinescript
alma = ta.alma(close, almaLen, almaOffset, almaSigma)
```

* `ta.alma()` is TradingView’s built-in ALMA function.
* It filters the **close** price series using the chosen parameters and returns the resulting smooth average.

---

### 3. Buy / Sell signal logic

```pinescript
buySignal = close > alma and close[1] < alma[1]
sellSignal = close < alma and close[1] > alma[1]
```

| Signal | Condition | Meaning |
| -------- | ------------------------------------------------------------------ | ----------------------------------------------------------- |
| **BUY** | Current close **above** ALMA **and** previous close **below** ALMA | Price has crossed the average upward (bullish crossover). |
| **SELL** | Current close **below** ALMA **and** previous close **above** ALMA | Price has crossed the average downward (bearish crossover). |

---

### 4. Plotting on the chart

```pinescript
plot(alma, title = "ALMA", color = color.blue, linewidth = 2)

plotshape(buySignal, title = "BUY", location = location.belowbar,
color = color.green, style = shape.labelup, text = "BUY")

plotshape(sellSignal, title = "SELL", location = location.abovebar,
color = color.red, style = shape.labeldown, text = "SELL")
```

* **`plot()`** draws the ALMA curve in blue, 2 pixels wide.
* **`plotshape()`** adds labels at the bars where signals occur:

* Green “BUY” label below the candle on upward crosses.
* Red “SELL” label above the candle on downward crosses.

---

### 5. Optional bar coloring

```pinescript
barcolor(
buySignal ? color.new(color.green, 30) :
sellSignal ? color.new(color.red, 30) :
na)
```

* The bar that generates a **BUY** signal is tinted semi-transparent green.
* A **SELL** bar is tinted semi-transparent red.
* All other bars keep their default color.

---

## Workflow in a nutshell

1. **Input parameters** are set by the trader.
2. The script computes the **ALMA** curve from closing prices.
3. **Crossovers** between price and ALMA trigger simple entry signals.
4. The indicator **draws** the average, paints bars, and places BUY/SELL labels.

> **How to extend it**
>
> * Add filters (e.g., higher-timeframe trend MA, ATR volatility) to cut down whipsaws.
> * Wrap the code in a `strategy()` block and include stop-loss / take-profit logic to back-test the crossover rules.

免責聲明

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