> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ninjatrader.com/_mcp/server.

# Volume Oscillator

## Description

The Volume Oscillator uses the difference between two [moving averages](/developer/desktop-sdk/references/common/system-indicator-methods/moving-average-simple-sma) of [volume](/developer/desktop-sdk/references/common/system-indicator-methods/volume) to determine if the trend is increasing or decreasing. A value above zero indicates that the shorter term volume moving average has risen above the longer term volume moving average. This indicates that the shorter term trend is higher than the longer term trend. Rising prices with with increased short term volume is bullish as is falling prices with decreased volume. Falling prices with increased volume or rising prices with decreased volume indicate market weakness.

## Syntax

`VolumeOscillator(int fast, int slow)`

`VolumeOscillator(ISeries\<double\> input, int fast, int slow)`

**Returns default value**

`VolumeOscillator(int fast, int slow)[int barsAgo]`

`VolumeOscillator(ISeries\<double\> input, int fast, int slow) [int barsAgo]`

## Return Value

**double**; Accessing this method via an index value `[int barsAgo]` returns the indicator value of the referenced bar.

## Parameters

| Parameter | Description                                                                                     |
| --------- | ----------------------------------------------------------------------------------------------- |
| fast      | The number of bars to include in the short term moving average                                  |
| input     | Indicator source data ([Series\<T>](/developer/desktop-sdk/references/common/iseriest/seriest)) |
| period    | Number of bars used in the calculation                                                          |
| slow      | The number of bars to include in the long term moving average                                   |

## Example

```csharp
// Prints the current value of a Volume Oscillator  
double value = VolumeOscillator(12, 26)[0];  
Print("The current Volume Oscillator value is " + value.ToString());
```

## Source Code

You can view this indicator method source code by selecting the menu New > NinjaScript Editor > Indicators within the NinjaTrader Control Center window.