Skip to main content

Rate-Limiting

On Tradovate

rate_limit + id work identically with destination=tradovate;: blocked alerts are rejected before any Tradovate request is made. That also makes self-rate-limiting a good way to keep a noisy strategy clear of Tradovate's own API penalties: penalty tickets (p-ticket with a p-time wait) and the 1,500 requests per hour limit on order placement. See Rate limits on Tradovate.

Some traders have issues with certain 3rd-party services sending duplicate alerts in rapid succession, which can have catastrophic consequences. In response to this, we've created self-rate limiting, where the trader can dictate how often CrossTrade is allowed to evaluate similar commands.

To use rate limiting, you simply have to provide a rate_limit and id identifier field to any alert message to track the message type. In this example, we set a rate_limit=1 and id=mystrategy.

By default, if the rate limit is a single number, it defines the number of requests allowed through CrossTrade every one minute (60 seconds) for that id. So if 2 alerts show up within a few milliseconds of each other, the first one with that id will be accepted, and the second one will be blocked.

Advanced Usage​

If you have more advanced rate limiting requirements, it is also possible to dictate both the request count and the finite interval to allow that many requests.

rate_limit=1; (default, 1 request every 60 seconds)

rate_limit=1/120; (1 request every 120 seconds, or 2 minutes)

rate_limit=3/900; (3 requests every 900 seconds, or 15 minutes)

And so on. The maximum request rate limit is 1,000 requests over 86,400 seconds, or 24 hours.

Example Payload​

The following alert will only be processed if no other alerts with ID "mystrategy" have shown up in the last 1 minute.

key=your-secret-key;
command=place;
account=sim101;
instrument=ES 12-26;
action=buy;
qty=1;
order_type=market;
tif=day;
rate_limit=1;
id=mystrategy;

Alert History showing a signal rejected because the rate limit was hit: 1 request per 60 seconds for ID scalper

Learn more...