Skip to content

New trade bucket (OHLC candle)

SEND Server to Client on wss://api.valr.com/ws/trade

Sent when a new 60-second OHLC trade bucket (candle) is available. Contains open, high, low, close prices and volume for the period.

Subscription

This event requires an explicit subscription. Send a SUBSCRIBE message after connecting:

json
{
    "type": "SUBSCRIBE",
    "subscriptions": [
        {
            "event": "NEW_TRADE_BUCKET"
        }
    ]
}

Message

Event type: NEW_TRADE_BUCKET

Payload Schema

PropertyTypeRequiredDescription
currencyPairSymbolstringYes-
bucketPeriodInSecondsinteger (int32)Yes-
startTimestringYes-
openstringYes-
highstringYes-
lowstringYes-
closestringYes-
volumestringYes-

Example

json
"{\n    \"type\": \"NEW_TRADE_BUCKET\",\n    \"currencyPairSymbol\": \"BTCUSDT\",\n    \"data\": {\n        \"currencyPairSymbol\": \"BTCUSDT\",\n        \"bucketPeriodInSeconds\": 60,\n        \"startTime\": \"2019-04-25T19:41:00Z\",\n        \"open\": \"9500\",\n        \"high\": \"9500\",\n        \"low\": \"9500\",\n        \"close\": \"9500\",\n        \"volume\": \"0\"\n    }\n}"

Channel

Channel: trade Address: wss://api.valr.com/ws/trade