> For the complete documentation index, see [llms.txt](https://docs.stockhero.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stockhero.ai/technical-indicators/supertrend.md).

# SuperTrend

Understanding the SuperTrend Indicator

### What is SuperTrend?

The **SuperTrend** is a popular trend-following technical indicator used to identify the direction of a stock's price trend and potential trend reversals.

It is displayed as a line on the price chart, typically appearing below the price during an uptrend and above the price during a downtrend.

The SuperTrend indicator uses two key parameters, **Period** and **Factor (Multiplier)**, to calculate its value based on market volatility, measured using the Average True Range (ATR).

When the price moves across the SuperTrend line, it may indicate a potential change in market direction, making it useful for identifying trading entry and exit opportunities.

### How Does SuperTrend Work in StockHero?

StockHero uses the SuperTrend indicator to automatically generate Buy and Sell signals based on the stock's price movement relative to the SuperTrend line.

For a **Long Strategy**, the bot follows these two trading conditions:

#### 1. Buy Signal – Price Crosses Above SuperTrend

The bot will trigger a **Buy** signal when the stock price crosses above the SuperTrend line.

This may indicate a transition from a bearish to a bullish trend, suggesting that upward momentum is developing.

**Example:**

* Current SuperTrend value: $100
* Previous stock price: $99
* New stock price: $102
* **Bot Action: BUY**

The bot detects that the stock price has crossed above the SuperTrend line and triggers a Buy signal.

#### 2. Sell Signal – Price Crosses Below SuperTrend

The bot will trigger a **Sell** signal when the stock price crosses below the SuperTrend line.

This may indicate a transition from a bullish to a bearish trend, suggesting that downward momentum is developing.

**Example:**

* Current SuperTrend value: $100
* Previous stock price: $103
* New stock price: $98
* **Bot Action: SELL**

The bot detects that the stock price has crossed below the SuperTrend line and triggers a Sell signal to close the existing Long position.

### Understanding the Period Setting

The **Period** determines the number of price candles used to calculate the Average True Range (ATR), which is a key component of the SuperTrend indicator.

The ATR measures market volatility by calculating the average range of price movements over the specified number of periods.

The Period setting influences how responsive the SuperTrend indicator is to price movements:

* **Shorter Period:** Makes the indicator more sensitive to price movements, allowing it to react more quickly to potential trend changes. However, it may generate more frequent signals and false reversals.
* **Longer Period:** Makes the indicator smoother and less sensitive to short-term price fluctuations. This may help filter out market noise but could result in delayed entry and exit signals.

Users can experiment with different Period values to find a suitable balance between responsiveness and trend confirmation.

### Understanding the Factor (Multiplier) Setting

The **Factor**, also known as the **Multiplier**, determines how far the SuperTrend line is positioned from the price based on the ATR value.

It is used as a multiplier against the ATR to establish the distance of the SuperTrend line from the underlying price.

The Factor setting plays an important role in determining how easily the price can cross the SuperTrend line and trigger a trading signal.

* **Lower Factor:** Positions the SuperTrend line closer to the price, making it more sensitive to price movements. This can generate more frequent Buy and Sell signals, allowing the bot to react faster to potential trend changes. However, it also increases the possibility of false signals during volatile or sideways markets.
* **Higher Factor:** Positions the SuperTrend line further away from the price, requiring a larger price movement before a crossover occurs. This can help filter out short-term market fluctuations and reduce frequent signal changes. However, it may also result in delayed entry and exit signals.

**Example:**

Assuming the ATR is $2:

| Factor | ATR × Factor | Effect                                  |
| ------ | ------------ | --------------------------------------- |
| 2.0    | $4           | Closer SuperTrend line; more sensitive  |
| 3.0    | $6           | Wider SuperTrend line; less sensitive   |
| 4.0    | $8           | Further SuperTrend line; less sensitive |

In general, a lower Factor produces a more responsive indicator, while a higher Factor provides a more conservative trend-following approach.

### Customizing SuperTrend Settings in StockHero

StockHero allows users to independently adjust both the **Period** and **Factor (Multiplier)** values of the SuperTrend indicator.

This provides greater flexibility in developing and fine-tuning automated trading strategies to suit different stocks, market conditions, and trading objectives.

For example:

* A shorter Period combined with a lower Factor may be suitable for strategies seeking to capture shorter-term price movements.
* A longer Period combined with a higher Factor may be more suitable for strategies seeking to identify stronger and more established trends.

There is no universally optimal combination. Users are encouraged to experiment with different configurations and backtest their strategies to identify settings that may deliver better risk-adjusted returns and potentially generate alpha.

### Summary

For a Long Strategy using the SuperTrend indicator:

| Price Movement                 | Bot Action              |
| ------------------------------ | ----------------------- |
| Price crosses above SuperTrend | **BUY**                 |
| Price crosses below SuperTrend | **SELL**                |
| Price remains above SuperTrend | No new crossover signal |
| Price remains below SuperTrend | No new crossover signal |

The SuperTrend indicator provides StockHero users with a systematic approach to identifying potential trend reversals and automating trading decisions.

By adjusting the Period and Factor settings, users can fine-tune the indicator's sensitivity and responsiveness, giving them greater flexibility to develop trading strategies that align with their investment objectives.

**Risk Disclaimer:** SuperTrend is a trend-following indicator and does not guarantee profitable trades. False signals may occur, particularly in sideways or highly volatile markets. Trend-following indicators may also generate delayed signals after significant price movements have already occurred. Users are encouraged to backtest their strategies and evaluate the associated risks before deploying bots with real capital.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stockhero.ai/technical-indicators/supertrend.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
