# Bollinger Band

The Bollinger Bands (BB) were created in the early 1980s by financial analyst and trader John Bollinger. Bollinger Bands work as oscillators. It indicates whether the market has high or low volatility, as well as overbought or oversold conditions.&#x20;

{% hint style="info" %}
StockHero Bollinger Band: a buy signal is generated when the candlestick data reaches an oversold region, and a sell signal is generated when it reaches an overbought region.
{% endhint %}

![](/files/-M64Hd5Tv5Qm7ctlwfjC)

The core concept behind the BB indicator is to highlight how prices are dispersed around an average value. More specifically, it is composed of an upper band (red), a lower band (yellow), and a middle band (blue), also known as the middle moving average line. The two sidelong bands react to the market price action, expanding when the volatility is high, moving away from the middle line, and contracting when the volatility is low, moving towards the middle line.

```
Middle line = (SMA, n)
Upper band = (SMA, n) + (20-day standard deviation * y)
Lower band = (SMA, n) - (20-day standard deviation * y)

Where: 
n = Time Period
y = standard deviation multiplier
```

The standard Bollinger Bands formula sets the middle line as an X-day Simple Moving Average (SMA), while the upper and lower bands are calculated based on market volatility in relation to the SMA, which is referred to as the standard deviation.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.stockhero.ai/technical-indicators/bollinger-band.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
