# Smart Signals

### Key Concepts

Before going into the settings, it's essential to understand the two fundamental choices you'll make when configuring the core engine: the **Signal Mode** and the **Algorithm Mode**.

#### 1. Signal Mode: Trend vs. Reversal

This setting defines the *type* of trading strategy the signals will follow.

* **Trend Mode (Default):** This is a trend-following strategy. The goal is to identify the direction of the primary market momentum and generate signals to trade *with* that trend. A bullish signal (▲) will only appear when the underlying trend is bullish, and a bearish signal (▼) will only appear when the trend is bearish. This mode is designed to capture profits from sustained market moves.

<figure><img src="https://736441233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRLWEm8uShUvrMtRy93wD%2Fuploads%2FXMKVtMp3aYaEfzHNW738%2Fimage.png?alt=media&#x26;token=305fc245-b1fd-4a88-a8fd-766d4d9bd9ee" alt=""><figcaption></figcaption></figure>

* **Reversal Mode:** This is a counter-trend or "mean reversion" strategy. The system looks for points of potential exhaustion within an established trend, aiming to catch a pullback or a turning point. For example, it might generate a bullish signal (▲) during a temporary dip in a larger uptrend, or a bearish signal (▼) during a short-lived rally in a larger downtrend. This mode is for traders looking to enter at more favorable prices during temporary pullbacks.

> **Important:** Reversal Mode does not generate Strong signals (+▲ / +▼) or Exit signals (x). These features are exclusive to Trend Mode.

<figure><img src="https://736441233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRLWEm8uShUvrMtRy93wD%2Fuploads%2FoIvU124PipXF9oJEGmdY%2Fimage.png?alt=media&#x26;token=815b2b31-d33d-461c-9529-7c4a84a02e8d" alt=""><figcaption></figcaption></figure>

#### 2. Algorithm Mode: Swing vs. Scalping

This setting determines the underlying mathematical model used to analyze the market and generate signals. Each is optimized for different timeframes and trading paces.

* **Swing Mode (Default):** This algorithm is designed for stability and is ideal for **higher timeframes (15-minute and above)**. It uses a robust method based on price data and volatility to identify major trends while filtering out minor market noise. It is the preferred mode for swing traders looking to capture larger, more significant price movements.
* **Scalping Mode:** This is a highly adaptive and responsive algorithm built for **lower timeframes (5-minute and under)**. It uses a machine-learning model to dynamically analyze market volatility. By adapting its sensitivity in real-time, it can generate faster signals suitable for scalping and very short-term day trading.

### The Signals Explained

The Smart Signals module generates four distinct visual signals on your chart.

| Signal | Name           | Appears In       | Description                                                                                                                                                                   |
| ------ | -------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ▲      | Bullish Signal | Trend & Reversal | A standard signal to enter a long position. In Trend Mode, it confirms a continuation of the uptrend. In Reversal Mode, it suggests a potential bottom or a bullish pullback. |
| ▼      | Bearish Signal | Trend & Reversal | A standard signal to enter a short position. In Trend Mode, it confirms a continuation of the downtrend. In Reversal Mode, it suggests a potential top or a bearish pullback. |
| +▲     | Strong Bullish | Trend Mode Only  | A higher-confidence bullish signal. See "Understanding Strong Signals" below for how this differs between Swing and Scalping modes.                                           |
| +▼     | Strong Bearish | Trend Mode Only  | A higher-confidence bearish signal. See "Understanding Strong Signals" below for how this differs between Swing and Scalping modes.                                           |

#### Understanding Strong Signals

<figure><img src="https://736441233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRLWEm8uShUvrMtRy93wD%2Fuploads%2FLO2C8HoRd8SBwspyvYS9%2Fimage.png?alt=media&#x26;token=938e59e8-c2e9-4669-ba5b-fe11d4e48ab0" alt="" width="563"><figcaption></figcaption></figure>

Strong signals (+▲ / +▼) appear only in **Trend Mode** and indicate higher conviction, but their underlying logic differs between the two algorithm modes:

* **In Swing Mode:** A strong signal fires when the trend is **accelerating** — meaning price range is expanding and the market is making larger moves in the trend direction. A normal signal fires when the market is trending but not yet accelerating. In other words, strong signals in Swing mode mean the trend has real momentum behind it.
* **In Scalping Mode:** A strong signal fires when the algorithm detects early-stage trend acceleration with higher-than-normal conviction. A normal signal fires when the trend is confirmed but without the same level of urgency.

### Candle Coloring

The indicator colors the chart's candles to provide an at-a-glance view of the market state. You can choose from four different coloring modes via the **Candle Coloring Mode** setting in the Appearance group:

* **Trend Gradient (Default):** Candles are colored on a gradient from gray to green (bullish) or gray to red (bearish) based on momentum intensity. Brighter colors indicate stronger momentum, while faded candles indicate weaker momentum within the trend.

<figure><img src="https://736441233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRLWEm8uShUvrMtRy93wD%2Fuploads%2FQFNHI5DNlGW5Mf69tyWT%2Fimage.png?alt=media&#x26;token=8f668e9f-c687-4ea8-be27-6bcd5b01c5d7" alt="" width="563"><figcaption></figcaption></figure>

* **Trend Static:** Candles are colored with solid green (bullish trend) or solid red (bearish trend) without any gradient effect. This provides the simplest, clearest view of trend direction.

<figure><img src="https://736441233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRLWEm8uShUvrMtRy93wD%2Fuploads%2FEDpG7E1VN9yZ0rN5lLrw%2Fimage.png?alt=media&#x26;token=47def55c-0c0c-4407-8fef-a41a1a8348be" alt="" width="563"><figcaption></figcaption></figure>

* **Volume Gradient:** Candles are colored from gray to orange based on relative trading volume. Brighter orange indicates higher-than-average volume, while gray indicates lower volume. This mode is useful for identifying bars with significant participation regardless of trend direction.

<figure><img src="https://736441233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRLWEm8uShUvrMtRy93wD%2Fuploads%2FZqbA7hQAHFnCM7olPeoN%2Fimage.png?alt=media&#x26;token=48ff2480-daf0-4af9-8a72-445933781095" alt="" width="563"><figcaption></figcaption></figure>

* **None:** Disables all candle coloring, leaving the chart's default colors untouched.

#### Gray Candles (Ranging Detection)

Across all coloring modes (except Volume Gradient and None), the indicator can highlight **gray candles** during periods of consolidation or ranging price action. When gray candles appear within an established trend, it signals that momentum is weakening. This can serve as a warning to be cautious with new entries or to consider taking partial profits, as the trend may be about to pause or reverse.

This feature is controlled by the **Detect Ranging Candles (Gray)** toggle.

* **In Trend Mode (Swing):** Candles turn gray when price drops below the entry price during a bullish trend, or rises above the entry price during a bearish trend — indicating the trend is struggling to make progress.
* **In Trend Mode (Scalping):** Candles turn gray when the machine learning algorithm notices that trend across multiple timeframes are conflicting, suggesting an uncertain environment.

### 🤖 Find Best Length (Auto-Optimization)

The **Find Best Length** toggle enables an automatic optimization engine that tests all available length values (1 through 12) and selects the one with the best combined performance based on **win rate** and **net profit**.

#### How It Works

When enabled, the optimizer:

1. Runs the Smart Signals algorithm across all 12 length settings simultaneously on your chart's historical data.
2. For each length, it tracks the recent trade signals, calculating the win rate (percentage of profitable trades) and net profit (cumulative percentage return).
3. It ranks all 12 lengths by both metrics, then selects the length with the best **average rank** (combined win rate + net profit ranking).
4. The selected "best" length is automatically applied to the Smart Signals engine — overriding whatever manual value you have set.

#### Optimization Metrics Table

When Find Best Length is enabled, an **Optimization Metrics** table appears on the right side of your chart. This table shows all 12 lengths with their corresponding win rate and net profit values. The currently selected best length is highlighted. Use this table to understand the performance landscape and verify that the auto-selected length makes sense for your market and timeframe.

<figure><img src="https://736441233-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRLWEm8uShUvrMtRy93wD%2Fuploads%2FLB9fIdUwe8pAwnfZF2nS%2Fimage.png?alt=media&#x26;token=f430a547-a686-4a58-b764-f94484fc63a5" alt="" width="246"><figcaption></figcaption></figure>

> **Note:** The numeric input next to the Find Best Length toggle (default: 3) is only used as the manual Time Horizon when optimization is **disabled**. When optimization is **on**, this value is ignored and the best-performing length is used instead.

### Settings Reference: Smart Signals Group

Here is a detailed breakdown of each setting within the "Smart Signals" group in the indicator's input menu.

#### Enable Smart Signals

* **Default:** On
* **Description:** This is the master switch for the entire Smart Signals module. Turning this off will disable the core signals (▲/▼), candle coloring, and related logic. Keep it on to use the primary features of the indicator.

#### Signal Mode

* **Default:** Trend
* **Options:** Trend, Reversal
* **Description:** Selects the core trading strategy. Choose **Trend** to trade with the prevailing market direction or **Reversal** to identify and trade pullbacks against the short-term trend. Note that Reversal mode does not produce Strong signals (+▲/+▼) or Exit signals (x).

#### Smart Signals Mode

* **Default:** Swing
* **Options:** Scalping, Swing
* **Description:** Switches between the two underlying algorithms. Use **Swing** for stable, long-term trend analysis on higher timeframes. Use **Scalping** for a fast, adaptive model better suited for lower timeframes.

#### 🤖 Find Best Length

* **Default:** Off
* **Description:** When enabled, automatically tests all 12 length values and selects the one with the best combined win rate and net profit. Overrides the manual Time Horizon value. An Optimization Metrics table is displayed on the chart showing performance for all lengths.

#### Time Horizon

* **Default:** 3
* **Range:** 1 to 12
* **Description:** This setting controls the sensitivity and lookback period of the trend detection algorithm. Only used when "Find Best Length" is disabled.
  * **Higher values (e.g., 8–12):** Create a less sensitive, "smoother" trend analysis. This results in fewer signals but focuses on longer, more established market moves. Ideal for higher timeframes.
  * **Lower values (e.g., 1–3):** Create a more sensitive, responsive analysis. This results in faster signals that react quickly to price changes. Ideal for lower timeframes and scalping.

#### Detect Ranging Candles (Gray)

* **Default:** On
* **Description:** Enables or disables the gray candle feature. It is highly recommended to keep this enabled, as it provides valuable insight into weakening momentum and potential range-bound conditions.
