CrossTrade Docs
Basic CommandsAdvanced Commands
  • Welcome!
    • Set Up Guide
  • Getting Started
    • Installation
    • User Dashboard
      • XT Control Panel
      • Manual Trader
      • Command Builder
    • Alert History
    • TradingView Alerts
      • Dynamic Variables
      • XT Alert Builder
      • Example Indicators
      • Example Strategies
    • VPS Connection Guide
  • Webhooks
    • Overview
    • Commands
      • Place Order
      • Flat Place Order
      • Close Position
      • Reverse
      • Reverse Position
      • Flatten Positions
      • Flatten Everything
      • Cancel Order
      • Cancel Orders
      • Cancel All Orders
      • Cancel Replace
      • Change Order
      • Close Strategy
    • Advanced Options
      • Multi-Account Placement
      • Flatten First
      • Require Market Position
      • Max Positions
      • Bracket Orders
      • Percentage and Tick Prices
      • Limit Order Timeouts
      • Trading Window
      • Bypass Trade Windows
      • Delay Timer
      • Rate-Limiting
      • Alert Commenting
      • Kill Switch
      • Notes
    • Examples & Use Cases
    • Troubleshooting
  • Account Manager
    • Overview
      • How It Works
      • Dashboard
      • Global Settings
      • Frequently Asked Questions (FAQ)
    • Monitors
      • Profit/Loss Thresholds
      • Minimum Profit Drawdown
      • Trailing Drawdown
      • Advanced Usage
    • Account Settings
      • Auto-Flattening
      • Trading Windows
    • Management Logs
  • NinjaTrader
    • ATM Strategies
      • Creating ATM Template
    • Optimizing NinjaTrader Performance
    • Enabling Multi-Provider Mode
  • CrossTrade API
    • Overview
    • Authentication
    • Rate Limiting
    • Webhook Trading
    • Accounts
      • GET Accounts Summary
      • GET Accounts
      • GET Account
    • Positions
      • GET Positions
      • GET Position
      • POST Close Position
      • POST Reverse
      • POST Reverse Position
      • POST Flatten Positions
      • POST Flatten Everything
    • Orders
      • GET Orders
      • GET Order
      • GET Order Status
      • POST Cancel Order
      • POST Cancel Orders
      • POST Cancel All Orders
      • POST Place Order
      • POST Flat Place Order
      • POST Replace Order
      • PUT Change Order
    • Strategies
      • GET Strategies
      • GET Strategy
      • POST Close Strategy
    • Executions
      • GET Executions
      • GET Execution
    • Quotes
      • GET Quote
  • Changelog
    • XT Versions
    • All Updates
  • Affiliate Program
    • Media Kit
  • Social Links
    • Discord
    • TradingView
    • YouTube
    • X (Twitter)
    • Instagram
    • Facebook
    • Reddit
    • Website
    • Blog
Powered by GitBook
On this page
  • Advanced Usage
  • Example Payload
  1. Webhooks
  2. Advanced Options

Rate-Limiting

PreviousDelay TimerNextAlert Commenting

Last updated 1 month ago

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 create 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 06-25; action=BUY; qty=1; order_type=MARKET; TIF=DAY; rate_limit=1; id=mystrategy;

Learn more...