> 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/vwap.md).

# VWAP

Understanding the VWAP Indicator

## What is VWAP?

The **Volume Weighted Average Price (VWAP)** is a technical indicator that calculates the average price of a stock over a specified trading period, weighted by its trading volume.

Unlike a simple moving average, VWAP considers both price and trading volume, giving greater weight to prices at which more shares have been traded.

VWAP is widely used by professional traders to assess market trends, identify potential entry and exit points, and determine whether a stock is trading above or below its volume-weighted average price.

### How Does VWAP Work in StockHero?

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

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

**1. Buy Signal – Price Crosses Above VWAP**

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

This indicates that the stock is gaining upward momentum and is trading above its volume-weighted average price, potentially signalling a bullish trend.

**Example:**

* Current VWAP: $100
* Previous stock price: $99
* New stock price: $101
* **Bot Action: BUY**

The bot detects that the stock price has crossed above the VWAP level of $100 and triggers a Buy signal.

**2. Sell Signal – Price Crosses Below VWAP**

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

This indicates that the stock is experiencing downward momentum and is trading below its volume-weighted average price, potentially signalling a bearish trend.

**Example:**

* Current VWAP: $100
* Previous stock price: $102
* New stock price: $99
* **Bot Action: SELL**

The bot detects that the stock price has crossed below the VWAP level of $100 and triggers a Sell signal to close the existing Long position.

### Sustained Price Condition for Buy Signals

In addition to triggering Buy signals when the price crosses above the VWAP line, StockHero provides an alternative entry condition that allows users to trigger a Buy signal (for Long strategy) based on the **sustained prevailing price remaining below the VWAP level**.

This feature is particularly useful for traders who prefer to wait for a longer period of price correction or consolidation before entering a position, rather than buying immediately when the price crosses the VWAP line.

By requiring the price to remain below the VWAP for a sustained period, users can reduce the likelihood of entering a position during rapid price fluctuations or short-lived market swings.

**How It Works:**

* **Crossover Entry:** The bot triggers a Buy signal when the price crosses above the VWAP line.
* **Sustained Price Entry:** The bot triggers a Buy signal when the prevailing price has remained below the VWAP level for the configured duration or condition.

To implement Sustained Price Entry, select **Average** from the Long Strategy drop-down list.

**Why Use This Setting?**

This alternative entry condition provides several potential advantages:

* **Avoid Rapid Price Swings:** Helps reduce premature entries caused by short-lived price movements around the VWAP line.
* **Allow Price Correction:** Gives the stock more time to undergo a price correction before the bot enters a position.
* **Capture Potential Rebound Opportunities:** Allows traders to explore entry opportunities following an extended period of price weakness and consolidation.
* **Greater Strategy Flexibility:** Enables users to design more conservative entry strategies based on prevailing price behaviour rather than relying solely on VWAP crossovers.

This feature gives StockHero users greater control over their entry conditions, allowing them to experiment with different approaches to identifying potential buying opportunities.

**Important:** A sustained price below VWAP does not necessarily indicate that a stock has completed its correction or is ready to rebound. Prices may continue declining, so users should backtest their configurations before deploying bots with real capital.

### Flexible VWAP Time Frame Configuration

One of StockHero's key advantages is the flexibility to configure the VWAP indicator using a **different time frame from the bot's configured Trading Frequency**.

This means users can independently select the time frame used to calculate VWAP without being restricted to the bot's trading frequency.

For example, a user may configure:

* **Bot Trading Frequency:** 5-minute
* **VWAP Time Frame:** 15-minute

In this configuration, the bot evaluates trading signals based on its 5-minute trading frequency while using the 15-minute VWAP indicator as its reference.

This flexibility allows users to experiment with different combinations of trading frequencies and VWAP time frames to develop strategies that better suit their trading objectives and potentially generate alpha returns.

By separating the VWAP calculation time frame from the bot's trading frequency, StockHero gives traders greater control over their strategy design and the ability to fine-tune their trading signals.

### Important Considerations

* **Crossovers, Not Price Levels:** The bot generates signals when the price crosses the VWAP line, rather than simply remaining above or below it.
* **Market Volatility:** During sideways or volatile market conditions, the price may cross the VWAP line frequently, potentially generating multiple Buy and Sell signals.
* **Trend Identification:** VWAP can help identify short-term bullish and bearish momentum, but it does not guarantee that a price trend will continue.
* **Trading Execution:** Signals are subject to the bot's configuration, trading conditions, and order execution availability.

### Summary

For a Long Strategy using the VWAP indicator:

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

The VWAP indicator enables StockHero users to automate their trading decisions based on price and volume dynamics, helping them maintain a systematic and disciplined trading approach without constantly monitoring the market.

**Risk Disclaimer:** VWAP is a technical indicator and does not guarantee profitable trades. False signals may occur, particularly during periods of low liquidity or sideways market movement. Users are encouraged to backtest their strategies and evaluate the associated risks before deploying bots with real capital. In addition, real market conditions may be substantially different from backtested results.


---

# 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/vwap.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.
