---
id: "T:cAlgo.API.StochasticCalculationType"
kind: "enum"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Indicators/StochasticCalculationType/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# StochasticCalculationType (enum)

An enumeration of the different Stochastic Oscillator indicator calculation types.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public enum StochasticCalculationType
```

## Examples

C#:

```csharp
var lowHigh = Indicators.StochasticOscillator(9, 3, 9, MovingAverageType.Simple, StochasticCalculationType.LowHigh);
var closeClose = Indicators.StochasticOscillator(9, 3, 9, MovingAverageType.Simple, StochasticCalculationType.CloseClose);
Print("%K low/high: {0}, %K close/close: {1}", lowHigh.PercentK.LastValue, closeClose.PercentK.LastValue);
```

Python:

```python
lowHigh = api.Indicators.StochasticOscillator(9, 3, 9, MovingAverageType.Simple, StochasticCalculationType.LowHigh)
closeClose = api.Indicators.StochasticOscillator(9, 3, 9, MovingAverageType.Simple, StochasticCalculationType.CloseClose)
api.Print(f"%K low/high: {lowHigh.PercentK.LastValue}, %K close/close: {closeClose.PercentK.LastValue}")
```

## Values

- `StochasticCalculationType.LowHigh` — Uses lowest low and highest high (default).
- `StochasticCalculationType.CloseClose` — Uses lowest close and highest close.

