# BuySellPressure

#### Description <a href="#description_11" id="description_11"></a>

The BuySellPressure indicator displays the buy or sell pressure for the current bar. Furthermore, these trades are classified as "buy" or “sell”. For this classification, a "buy" is assumed any time the transaction has occurred at or above the ask. Inside trades are not taken into account.

**Caution: This is a real-time indicator. It will only work on and with real-time data and cannot therefore be used for historical information.**

**When the properties dialog for the indicator is open and changes are made, then the indicator must be reloaded. Doing so will delete all previously accumulated data.**

See [*BuySellVolume*](/standard-indicators/buysellvolume.md).

#### Usage <a href="#usage_12" id="usage_12"></a>

```csharp
BuySellPressure()
BuySellPressure(IDataSeries inSeries)

//For the values of buy pressure
BuySellPressure().BuyPressure[int barsAgo]
BuySellPressure(IDataSeries inSeries).BuyPressure[int barsAgo]

//For the values of sell Pressure
BuySellPressure().SellPressure[int barsAgo]
BuySellPressure(IDataSeries inSeries).SellPressure[int barsAgo]
```

#### Return value <a href="#return-value_12" id="return-value_12"></a>

**double**

When using this method with an index (e.g. **BuySellPressure**().BuyPressure\[**int** barsAgo] ), the value of the indicator will be outputted for the referenced bar.

**Caution:** **If BuySellPressure is used with EoD data, the value 50 will always be outputted.** - BuySellPressure().SellPressure\[0] = 50 - BuySellPressure().SellPressure\[0] = 50

#### Parameters <a href="#parameters_11" id="parameters_11"></a>

inSeries Input data series for the indicator

#### Visualization <a href="#visualization_13" id="visualization_13"></a>

![BuySellPressure](https://agenatrader.github.io/AgenaIndicator-documentation/media/BuySellPressure.jpg)

#### Example <a href="#example_12" id="example_12"></a>

```csharp
protected override void OnInit()
{
  BuySellPressure().CalculateOnClosedBar = false;
}

protected override void OnCalculate()
{
  if (Close[0] > DonchianChannel(20).Upper[5])
  {
    if (IsHistoricalMode || BuySellPressure().BuyPressure[0] > 70)
    OpenLong();
  }
}
```


---

# 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://indicators.agenatrader.com/standard-indicators/buysellpressure.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.
