---
id: "M:cAlgo.API.Functions.IsRising(cAlgo.API.DataSeries)"
kind: "method"
type: "T:cAlgo.API.Functions"
url: "https://help.ctrader.com/ctrader-algo/references/Collections/DataSeries/Functions/IsRising/"
---

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

# Functions.IsRising

Member of [Functions](https://help.ctrader.com/ctrader-algo/references/Collections/DataSeries/Functions/index.md).

## IsRising(DataSeries series)

Checks if the last value in a data series is greater than the previous.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public static bool IsRising(DataSeries series)
```

Python:

```python
Functions.IsRising(series: DataSeries) -> bool
```

### Parameters

- `series` (`DataSeries`, Python `DataSeries`): Input data series

### Returns

`bool` — True if the last value of a data series is greater than the previous, false otherwise

### Examples

C#:

```csharp
var sma = Indicators.SimpleMovingAverage(Bars.ClosePrices, 14);
if (sma.Result.IsRising())
    Print("SMA is rising, last value: {0}", sma.Result.LastValue);
```

Python:

```python
sma = api.Indicators.SimpleMovingAverage(api.Bars.ClosePrices, 14)
if Functions.IsRising(sma.Result):
    api.Print(f"SMA is rising, last value: {sma.Result.LastValue}")
```

