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
  • Example Payloads
  • Buy or Sell Market Orders
  • Buy or Sell Limit Orders
  • Stop Market and Stop Limit Orders
  • Using ATM Strategy Templates
  • Flatten Before Entry
  1. Webhooks
  2. Commands

Place Order

PreviousCommandsNextFlat Place Order

Last updated 1 month ago

This command will place orders, place orders that initiate a NinjaTrader , or place orders that are applied to an active NinjaTrader position ATM Strategy.

Providing the optional strategy name field with a valid ATM Strategy template name will result in execution of that ATM Strategy once the order is partially or completely filled. Pass in an optional unique string value for the strategy ID in order to reference that ATM Strategy via other commands.

To apply an order to an active ATM Strategy (existing strategies Stop Loss and Profit Target orders are amended) pass in the active strategy ID value and leave the strategy name field blank.

Pass in an optional unique string value for the order ID in order to reference that order via other commands. If specifying an ATM Strategy template name, there is no need to pass in an order ID as the strategy based orders can be referenced by their internally generated names such as TARGET1, STOP1 and so on.

Example Payloads

This example message will trigger a simple market order for BUY or SELL actions that will remain in-force for the rest of the trading day.

Buy or Sell Market Orders

key=your-secret-key;
command=PLACE;
account=sim101;
instrument=ES 06-25;
action=BUY;
qty=1;
order_type=MARKET;
tif=DAY;

Be aware that if you send a BUY order and then a SELL order using the same quantity, the sell order will offset the buy position. This scenario does not create a net short position.

Buy or Sell Limit Orders

key=your-secret-key;
command=PLACE;
account=sim101;
instrument=ES 06-25;
action=BUY;
qty=1;
order_type=LIMIT;
limit_price=4500;
tif=DAY;

If you place a Buy limit order above the current price, or a Sell limit order below, it will be executed immediately as you're crossing the spread.

Stop Market and Stop Limit Orders

key=your-secret-key;
command=PLACE;
account=sim101;
instrument=ES 06-25;
action=BUY;
qty=1;
order_type=STOPMARKET;
stop_price=4600;
tif=DAY;

You must use the stop_price command and not the limit_price command when submitting Stop Market or Stop Limit order types

Using ATM Strategy Templates

This payload will trigger a simple market order for BUY or SELL actions that will use an ATM strategy template and remain in-force for the rest of the trading day.

key=your-secret-key;
command=PLACE;
account=sim101;
instrument=ES 06-25;
action=BUY;
qty=1;
order_type=MARKET;
tif=DAY;
strategy=crosstrade;

Similar to the offsetting scenario when sending a Sell after a Buy, when using an ATM strategy, this will create orphaned Stops and Target orders as those are not canceled by default. You must send a CLOSEPOSITION or REVERSEPOSITION command before the next directional trade to avoid this. The quantity you set inside of your CrossTrade alert will supersede your default ATM quantity

Flatten Before Entry

If you want to close an existing position before opening a new position, there are 2 options. You can either include "flatten_first=true;" inside your message, or you can use the FLATPLACE command in lieu of PLACE.

Both options are available as convenience and achieve the same net effect of executing a CLOSEPOSITION command prior to the PLACE command.

.

.

ATM Strategy
Read more about Flatten First
Read more about the FLATPLACE command