---
id: "M:cAlgo.API.PriceAlerts.Add(cAlgo.API.Internals.Symbol,System.Double,cAlgo.API.PriceAlertQuoteType,cAlgo.API.PriceAlertCondition)"
kind: "method"
type: "T:cAlgo.API.PriceAlerts"
url: "https://help.ctrader.com/ctrader-algo/references/PriceAlert/PriceAlerts/Add/"
---

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

# PriceAlerts.Add

Member of [PriceAlerts](https://help.ctrader.com/ctrader-algo/references/PriceAlert/PriceAlerts/index.md).

## Add(Symbol symbol, double price, PriceAlertQuoteType quoteType, PriceAlertCondition condition)

Adds a new price alert.

Environments: Desktop supported · CLI supported · Cloud not supported.

- Cloud: Throws ArgumentException 'Price alert is not supported in current environment.' (after normal argument validation).

C#:

```csharp
PriceAlert Add(Symbol symbol, double price, PriceAlertQuoteType quoteType, PriceAlertCondition condition)
```

Python:

```python
api.PriceAlerts.Add(symbol: Symbol, price: float, quoteType: PriceAlertQuoteType, condition: PriceAlertCondition) -> PriceAlert
```

### Parameters

- `symbol` (`Symbol`, Python `Symbol`): Symbol
- `price` (`double`, Python `float`): Price
- `quoteType` (`PriceAlertQuoteType`, Python `PriceAlertQuoteType`): Quote type
- `condition` (`PriceAlertCondition`, Python `PriceAlertCondition`): Condition

### Returns

`PriceAlert` — Added PriceAlert.

Available since cAlgo.API 5.2.

### Examples

C#:

```csharp
var targetPrice = Symbol.Bid - 30 * Symbol.PipSize;
var priceAlert = PriceAlerts.Add(Symbol, targetPrice, PriceAlertQuoteType.Bid, PriceAlertCondition.LowerOrEqual);
Print("Price alert {0} added at {1}", priceAlert.Id, priceAlert.Price);
```

Python:

```python
targetPrice = api.Symbol.Bid - 30 * api.Symbol.PipSize
priceAlert = api.PriceAlerts.Add(api.Symbol, targetPrice, PriceAlertQuoteType.Bid, PriceAlertCondition.LowerOrEqual)
api.Print(f"Price alert {priceAlert.Id} added at {priceAlert.Price}")
```

