# cTrader ProtoOAGetTrendbarsReq

Independent and unofficial. Not affiliated with or endorsed by any broker or platform named here. Educational only: nothing here is advice, and nothing here recommends a broker or a trade.

This is the markdown version of https://openbrokerapi.com/platforms/ctrader/messages/protooagettrendbarsreq, written from the same records as that page.

Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.

Asks for historical bars of one size for one symbol, by period of time or by count.

- Message: `ProtoOAGetTrendbarsReq`
- Interface: cTrader Open API
- Group: Historical data
- Status: verified. Source: [help.ctrader.com](https://help.ctrader.com/open-api/messages/#protooagettrendbarsreq), checked 2026-10-12.
- The definition file it was checked against: https://github.com/spotware/openapi-proto-messages/blob/main/OpenApiMessages.proto

This is a message of the cTrader Open API, not an HTTP endpoint. It has no method and no path: it is sent over an open TCP or WebSocket connection, as Protocol Buffers or as JSON. It is in no OpenAPI file on this site and the request builder does not list it.

Note: No JSON sample is given here. A required field of this message is an enumeration, and Spotware's page on sending and receiving JSON does not say how an enumeration value is written in JSON.

## The message

- Name: `ProtoOAGetTrendbarsReq`
- Direction: Request, sent by the client
- Payload type: `PROTO_OA_GET_TRENDBARS_REQ`, number `2137`. This number is what identifies the message on the wire.
- Answered by: [ProtoOAGetTrendbarsRes](https://openbrokerapi.com/platforms/ctrader/messages/protooagettrendbarsres)

## Fields

- `payloadType` (type ProtoOAPayloadType, optional): Identifies the message. Its default in the definition is PROTO_OA_GET_TRENDBARS_REQ, which is number 2137.
- `ctidTraderAccountId` (type int64, required): The account the message is about, by its cTrader account id. Responses and events carry the same id, which is how a program holding several accounts on one connection tells them apart.
- `fromTimestamp` (type int64, optional): The start of the period, as Unix time in milliseconds. Not below zero, which is 1 January 1970.
- `toTimestamp` (type int64, optional): The end of the period, as Unix time in milliseconds. Not above 2147483646000, which the definition dates to 19 January 2038.
- `period` (type ProtoOATrendbarPeriod, required): The bar size, as a value of the ProtoOATrendbarPeriod enumeration, for example M1.
- `symbolId` (type int64, required): The symbol, by its id on the cTrader platform. Ids come from the symbol list.
- `count` (type uint32, optional): A cap on the number of bars, counted back from the end of the period.

## Limits that apply at cTrader Open API

- Requests a second, not historical data: 50 requests per second
  - Scope: Per connection, requests that are not for historical data
  - Status: verified. Source: [help.ctrader.com](https://help.ctrader.com/open-api/), checked 2026-10-12.
  - Note: Historical data requests have their own lower limit, held in a separate record.
- Requests a second, historical data: 5 requests per second
  - Scope: Per connection, historical data requests only
  - Status: verified. Source: [help.ctrader.com](https://help.ctrader.com/open-api/), checked 2026-10-12.

## Related cTrader messages: Historical data

- [ProtoOAGetTickDataReq](https://openbrokerapi.com/platforms/ctrader/messages/protooagettickdatareq): Asks for historical ticks of one symbol, bid or ask, in a period of time.
- [ProtoOAGetTickDataRes](https://openbrokerapi.com/platforms/ctrader/messages/protooagettickdatares): Returns the historical ticks, newest first, one page at a time.
- [ProtoOAGetTrendbarsRes](https://openbrokerapi.com/platforms/ctrader/messages/protooagettrendbarsres): Returns the historical bars that were asked for.

## More on cTrader

- [All cTrader messages](https://openbrokerapi.com/platforms/ctrader/messages): 49 documented here, grouped by what they do.
- [Historical candles: the call at each API](https://openbrokerapi.com/endpoints/candles): The same job at every broker and platform API recorded here, HTTP or not.
- [cTrader API quickstart](https://openbrokerapi.com/platforms/ctrader/quickstart)
- [All cTrader error codes](https://openbrokerapi.com/errors/ctrader)
- [cTrader API page](https://openbrokerapi.com/platforms/ctrader): The full record: access, authentication, limits and the source for each.

## Licence and how to cite

The records behind this page are all rights reserved. This file is the page itself, at its own address, in another format. It is not part of the CC BY 4.0 downloads listed at https://openbrokerapi.com/data. Quote from it with a link to the page.

Cite as: cTrader ProtoOAGetTrendbarsReq. Broker API Hub, https://openbrokerapi.com/platforms/ctrader/messages/protooagettrendbarsreq, newest check 2026-10-12.

Where you rely on a single figure, cite the source and the checked date printed beside it as well. Where this page and a broker's own documentation differ, the documentation wins.
