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
  • Available Parameters and Valid Values
  • Using Different Order Types
  • Available Commands
  • Command Descriptions
  1. Webhooks

Commands

Your introduction to NinjaTrader commands

PreviousOverviewNextPlace Order

Last updated 3 months ago

NinjaTrader's ATI (Automated Trading Interface) methods and commands offer robust capabilities for advanced trading automation. You can interact with the platform programmatically using specific commands to manage orders, positions, and much more, directly through the interface. This functionality is especially useful for those who want to integrate NinjaTrader with external systems or develop custom automated trading strategies.

Available Parameters and Valid Values

To utilize these methods, you'll be working with various commands such as PLACE, CANCEL, and CHANGE orders, each accepting specific parameters that define their action.

For example, when placing an order, you can specify the instrument, order type, price, quantity, and other trade characteristics. This level of detail provides fine-grained control over trading activities, enabling precise execution based on your trading criteria.

The following chart outlines valid values for each of the parameter types required by .


Parameters
Values

COMMAND

CANCEL, CANCELALLORDERS, CHANGE, CLOSEPOSITION, CLOSESTRATEGY, FLATTENEVERYTHING, PLACE, REVERSEPOSITION, FLATTEN, FLATPLACE, CANCELORDERS, CANCELREPLACE

ACCOUNT

The name of the account the command is to be processed (This will reflect the Account's Name property as opposed to the Display Name property.)

INSTRUMENT

Instrument name (e.g., ES 03-25, ES MAR25, ESH5)

ACTION

BUY, SELL

QTY

Any integer value

ORDER TYPE

MARKET, LIMIT, STOPMARKET, or STOPLIMIT

LIMIT PRICE

Any decimal value (use decimals not commas, e.g., 1212.25)

STOP PRICE

Any decimal value

TIF

DAY or GTC

OCO ID

Any string value

ORDER ID

Any string value (must be unique)

STRATEGY

Strategy template name (must exist in NinjaTrader)

STRATEGY ID

Any string value (must be unique)

In general, when specifying parameters in a webhook alert message an underscore takes the place of any space between words, e.g., order_type, stop_price, oco_id, etc.


Using Different Order Types

  • Market: A simple command to place a BUY or SELL market order. It executes immediately at the current market price.

  • Limit: To buy or sell at a specified price. If the price is above or below the current market, the order may execute immediately.

  • Stop: This command triggers a market or limit order when a specified stop price is reached. The stop_price parameter is crucial here.

Available Commands

When crafting payloads to send to NinjaTrader its important to understand that certain values are required depending on the command. For example, to CLOSEPOSITION you only need to supply the Account and Instrument information. Whereas, for a PLACE command, you must supply Account, Instrument, Actions, Qty, OrderType and TIF information.

The following table displays required (R) and optional (O) values for each different command value.

Command Descriptions

In the message field you will supply the payload information you want to send to CrossTrade for relay to NinjaTrader. You can customize this however you want based on the methods NinjaTrader will accept and the custom modifications CrossTrade has built.

Continue reading to learn more about creating webhook alert payloads. Each command subsection has descriptions and example message payloads. There is also some very useful information for common use cases in the section.

CrossTrade commands
Examples & Use Cases
Green commands are only available using the CrossTrade NT8 Add-On.
Chart of commands and fields available to NinjaTrader webhooks