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.
//For the values of buy pressure
BuySellPressure(IDataSeries inSeries).BuyPressure[int barsAgo]
//For the values of sell Pressure
BuySellPressure(IDataSeries inSeries).SellPressure[int barsAgo]
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 = 50 - BuySellPressure().SellPressure = 50
inSeries Input data series for the indicator
protected override void OnInit()
BuySellPressure().CalculateOnClosedBar = false;
protected override void OnCalculate()
if (Close > DonchianChannel(20).Upper)
if (IsHistoricalMode || BuySellPressure().BuyPressure > 70)