Futures | TradeStation

This document outlines the appropriate format that the traders must follow while writing the webhook payload for setting up the following types of Futures orders to be executed into TradeStation.

Let’s get started 🚀

Market Order

The traders can write the webhook payload for setting up market orders using these four payload fields:

  • Symbol
  • Action
  • Quantity
  • Class

Symbol

The ticker symbol of the futures contract. TradeStation expresses this asset class using the single ticker symbol for futures contracts. E.g. MES, MNQ, MGC, and MYM, etc.

Action

The signal action indicates the type of trade to be executed. It can be one of the following:

  • Buy: Triggers an action to buy the asset.
  • Sell: Triggers an action to sell the asset.
  • Buy-to-Cover: Triggers an action to buy back and close a previously sold asset (ending a short trade).
  • Sell-Short: Triggers an action to sell borrowed assets with the expectation of buying them back at a lower price.
  • Buy-to-Open: Triggers an action to initiate a new position by buying assets.
  • Buy-to-Close: Triggers an action to exit and close an existing position.
  • Sell-to-Open: Triggers an action to initiate a new position by selling assets.
  • Sell-to-Close: Triggers an action to exit and close an existing short position.

Quantity

The number of assets to be traded. If omitted, the quantity will be dynamically calculated or defaulted to 1.

Class

The Class is a field or property that identifies and categorizes financial instruments such as futures, options, warrants, bonds, CFDs, crypto, forex, stocks, and funds. Required to be specified for assets with time-limited contracts like futures.

EXAMPLE

I. Buy

{
  "symbol": "MES",
  "action": "buy",
  "quantity": 123,
  "class": "future"
}

II. Sell

{
  "symbol": "MES",
  "action": "sell",
  "quantity": 123,
  "class": "future"
}

III. Buy-To-Cover

{
  "symbol": "MES",
  "action": "buy_to_cover",
  "quantity": 123,
  "class": "future"
}

IV. Sell Short

{
  "symbol": "MES",
  "action": "sell_to_cover",
  "quantity": 123,
  "class": "future"
}

V. Buy-To-Open

{
  "symbol": "MES",
  "action": "buy_to_open",
  "quantity": 123,
  "class": "future"
}

VI. Buy-To-Close

{
  "symbol": "MES",
  "action": "buy_to_close",
  "quantity": 123,
  "class": "future"
}

VII. Sell-To-Open

{
  "symbol": "MES",
  "action": "sell_to_open",
  "quantity": 123,
  "class": "future"
}

VIII. Sell-To-Close

{
  "symbol": "MES",
  "action": "sell_to_close",
  "quantity": 123,
  "class": "future"
}

Limit Order

The traders can write the webhook payload for setting up Limit orders using these four payload fields:

  • Symbol
  • Action
  • Quantity
  • Limit_price
  • Class

Symbol

The ticker symbol of the futures contract. TradeStation expresses this asset class using the single ticker symbol for futures contracts. E.g. MES, MNQ, MGC, and MYM, etc.

Action

The signal action indicates the type of trade to be executed. It can be one of the following:

  • Buy: Triggers an action to buy the asset.
  • Sell: Triggers an action to sell the asset.
  • Buy-to-Cover: Triggers an action to buy back and close a previously sold asset (ending a short trade).
  • Sell-Short: Triggers an action to sell borrowed assets with the expectation of buying them back at a lower price.
  • Buy-to-Open: Triggers an action to initiate a new position by buying assets.
  • Buy-to-Close: Triggers an action to exit and close an existing position.
  • Sell-to-Open: Triggers an action to initiate a new position by selling assets.
  • Sell-to-Close: Triggers an action to exit and close an existing short position.

Quantity

The number of assets to be traded. If omitted, the quantity will be dynamically calculated or defaulted to 1.

Limit_price

An optional field specifying the execution price for a "BUY" or "SELL" trade. If specified, the trade will be executed at the specified limit price. If not, the trade will be executed at the current market price.

Class

The Class is a field or property that identifies and categorizes financial instruments such as futures, options, warrants, bonds, CFDs, crypto, forex, stocks, and funds. Required to be specified for assets with time-limited contracts like futures.

EXAMPLE

I. Buy

{
  "symbol": "MES",
  "action": "buy",
  "quantity": 123,
  "limit_price": 123.98,
  "class": "future"
}

II. Sell

{
  "symbol": "MES",
  "action": "sell",
  "quantity": 123,
  "limit_price": 123.98,
  "class": "future"
}

III. Buy-To-Cover

{
  "symbol": "MES",
  "action": "buy_to_cover",
  "quantity": 123,
  "limit_price": 123.98,
  "class": "future"
}

IV. Sell-Short

{
  "symbol": "MES",
  "action": "sell_short",
  "quantity": 123,
  "limit_price": 123.98,
  "class": "future"
}

V. Buy-To-Open

{
  "symbol": "MES",
  "action": "buy_to_open",
  "quantity": 123,
  "limit_price": 123.98,
  "class": "future"
}

VI. Buy-To-close

{
  "symbol": "MES",
  "action": "buy_to_close",
  "quantity": 123,
  "limit_price": 123.98,
  "class": "future"
}

VII. Sell-To-Open

{
  "symbol": "MES",
  "action": "sell_to_open",
  "quantity": 123,
  "limit_price": 123.98,
  "class": "future"
}

VIII. Sell-To-Close

{
  "symbol": "MES",
  "action": "sell_to_close",
  "quantity": 123,
  "limit_price": 123.98,
  "class": "future"
}

Stop Order

The traders can write the webhook payload for setting up Stop orders using these five payload fields:

  • Symbol
  • Action
  • Quantity
  • Stop_price
  • Class

Symbol

The ticker symbol of the futures contract. TradeStation expresses this asset class using the single ticker symbol for futures contracts. E.g. MES, MNQ, MGC, and MYM, etc.

Action

The signal action indicates the type of trade to be executed. It can be one of the following:

  • Buy: Triggers an action to buy the asset.
  • Sell: Triggers an action to sell the asset.
  • Buy-to-Cover: Triggers an action to buy back and close a previously sold asset (ending a short trade).
  • Sell-Short: Triggers an action to sell borrowed assets with the expectation of buying them back at a lower price.
  • Buy-to-Open: Triggers an action to initiate a new position by buying assets.
  • Buy-to-Close: Triggers an action to exit and close an existing position.
  • Sell-to-Open: Triggers an action to initiate a new position by selling assets.
  • Sell-to-Close: Triggers an action to exit and close an existing short position.

Quantity

The number of assets to be traded. If omitted, the quantity will be dynamically calculated or defaulted to 1.

Stop_price

An optional field specifying the price level at which a stop-loss or stop-limit order should be triggered. It helps limits potential losses by automatically closing the position when the specified price is reached.

Class

The Class is a field or property that identifies and categorizes financial instruments such as futures, options, warrants, bonds, CFDs, crypto, forex, stocks, and funds. Required to be specified for assets with time-limited contracts like futures.

EXAMPLE

I. Buy

{
  "symbol": "MES",
  "action": "buy",
  "quantity": 123,
  "stop_price": 123.98,
  "class": "future"
}

II. Sell

{
  "symbol": "MES",
  "action": "sell",
  "quantity": 123,
  "stop_price": 123.98,
  "class": "future"
}

III. Buy-To-Cover

{
  "symbol": "MES",
  "action": "buy_to_cover",
  "quantity": 123,
  "stop_price": 123.98,
  "class": "future"
}

IV. Sell-Short

{
  "symbol": "MES",
  "action": "sell_short",
  "quantity": 123,
  "stop_price": 123.98,
  "class": "future"
}

V. Buy-To-Open

{
  "symbol": "MES",
  "action": "buy_to_open",
  "quantity": 123,
  "stop_price": 123.98,
  "class": "future"
}

VI. Buy-To-Close

{
  "symbol": "MES",
  "action": "buy_to_close",
  "quantity": 123,
  "stop_price": 123.98,
  "class": "future"
}

VII. Sell-To-Open

{
  "symbol": "MES",
  "action": "sell_to_open",
  "quantity": 123,
  "stop_price": 123.98,
  "class": "future"
}

VIII. Sell-To-Close

{
  "symbol": "MES",
  "action": "sell_to_close",
  "quantity": 123,
  "stop_price": 123.98,
  "class": "future"
}

Stop-Limit Order

The traders can write the webhook payload for setting up Stop-Limit orders using these six payload fields:

  • Symbol
  • Action
  • Quantity
  • Limit_price
  • Stop_price
  • Class

Symbol

The ticker symbol of the futures contract. TradeStation expresses this asset class using the single ticker symbol for futures contracts. E.g. MES, MNQ, MGC, and MYM, etc.

Action

The signal action indicates the type of trade to be executed. It can be one of the following:

  • Buy: Triggers an action to buy the asset.
  • Sell: Triggers an action to sell the asset.
  • Buy-to-Cover: Triggers an action to buy back and close a previously sold asset (ending a short trade).
  • Sell-Short: Triggers an action to sell borrowed assets with the expectation of buying them back at a lower price.
  • Buy-to-Open: Triggers an action to initiate a new position by buying assets.
  • Buy-to-Close: Triggers an action to exit and close an existing position.
  • Sell-to-Open: Triggers an action to initiate a new position by selling assets.
  • Sell-to-Close: Triggers an action to exit and close an existing short position.

Quantity

The number of assets to be traded. If omitted, the quantity will be dynamically calculated or defaulted to 1.

Limit_price

An optional field specifying the execution price for a "BUY" or "SELL" trade. If specified, the trade will be executed at the specified limit price. If not, the trade will be executed at the current market price.

Stop_price

An optional field specifying the price level at which a stop-loss or stop-limit order should be triggered. It helps limits potential losses by automatically closing the position when the specified price is reached.

Class

The Class is a field or property that identifies and categorizes financial instruments such as futures, options, warrants, bonds, CFDs, crypto, forex, stocks, and funds. Required to be specified for assets with time-limited contracts like futures.

EXAMPLE

I. Buy

{
  "symbol": "MES",
  "action": "buy",
  "quantity": 123,
  "limit_price": 123.98,
  "stop_price": 123.98,
  "class": "future"
}

II. Sell

{
  "symbol": "MES",
  "action": "sell",
  "quantity": 123,
  "limit_price": 123.98,
  "stop_price": 123.98,
  "class": "future"
}

III. Buy-To-Cover

{
  "symbol": "MES",
  "action": "buy_to_cover",
  "quantity": 123,
  "limit_price": 123.98,
  "stop_price": 123.98,
  "class": "future"
}

IV. Sell-Short

{
  "symbol": "MES",
  "action": "sell_short",
  "quantity": 123,
  "limit_price": 123.98,
  "stop_price": 123.98,
  "class": "future"
}

V. Buy-To-Open

{
  "symbol": "MES",
  "action": "buy_to_open",
  "quantity": 123,
  "limit_price": 123.98,
  "stop_price": 123.98,
  "class": "future"
}

VI. Buy-To-Close

{
  "symbol": "MES",
  "action": "buy_to_close",
  "quantity": 123,
  "limit_price": 123.98,
  "stop_price": 123.98,
  "class": "future"
}

VII. Sell-To-Open

{
  "symbol": "MES",
  "action": "sell_to_open",
  "quantity": 123,
  "limit_price": 123.98,
  "stop_price": 123.98,
  "class": "future"
}

VIII. Sell-To-Close

{
  "symbol": "MES",
  "action": "Sell_to_close",
  "quantity": 123,
  "limit_price": 123.98,
  "stop_price": 123.98,
  "class": "future"
}




Sep 29, 2023

Contact Us

Not finding what you're looking for? Contact Us Directly