Skip to content
Cirrus home
Sign in

Guide

Price and indicator alerts

Get told when a price, a tick field or an indicator crosses a level, on Telegram, in the app or at your webhook.

An alert trigger watches every tick and notifies you once its condition holds, then ends. It never places an order. Needs the triggers scope.

A price alert #

POST
curl -X POST "https://cirrus.pocketful.in/v2/triggers" \
  -H "Authorization: token $CIRRUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account": "P1",
    "kind": "alert",
    "legs": [
      {
        "instrument_token": "CT:TEST:RELIANCE",
        "side": "BUY",
        "quantity": 1
      }
    ],
    "spec": {
      "when": "ltp >= 2600"
    }
  }'

The answer is 202 with the new trigger_id. Read it with GET /v2/triggers/{trigger_id}: state is submitted until the engine takes it, and fired once the alert went off.

Write the condition #

Conditions are short expressions over tick fields: ltp, bid, ask, volume, oi, high, low and prev.ltp (the previous tick). Combine them with &&, || and comparisons.

You wantCondition
Price at or above 2,600ltp >= 2600
Price crosses above 2,600crosses_above(ltp, 2600)
Buyers outnumber sellersbid_qty > ask_qty * 2
After 2:30 pm onlyltp >= 2600 && now_ist >= 870
RSI(14) on 5-minute candles below 30rsi(14, '5m') < 30

Where the alert goes #

Alerts arrive on the channels in your notification preferences: Telegram, the app inbox and your webhooks (notification event). See Webhooks and notifications.

In the reference