Cryptocurrency | TradeStation

This document outlines the appropriate format that the traders must follow while writing the webhook payload for setting up the following types of cryptocurrency 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 three payload fields:

  • Symbol
  • Action
  • Quantity

Symbol

The ticker symbol represents the specific cryptocurrency. TradeStation represents this asset by pairing of cryptocurrency ticker symbol with the US dollar. e.g. BTCUSD, ETHUSD, 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 purchase 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.

EXAMPLE

I. Buy

{
  "symbol": "BTCUSD",
  "action": "buy",
  "quantity": 3
}

II. Sell

{
  "symbol": "BTCUSD",
  "action": "sell",
  "quantity": 3
}

III. Buy-To-Cover

{
  "symbol": "BTCUSD",
  "action": "buy_to_cover",
  "quantity": 3
}

IV. Sell-Short

{
  "symbol": "BTCUSD",
  "action": "sell_short",
  "quantity": 3
}

V. Buy-to-open

{
  "symbol": "BTCUSD",
  "action": "buy_to_open",
  "quantity": 3
}

VI. Buy-To-Close

{
  "symbol": "BTCUSD",
  "action": "buy_to_close",
  "quantity": 3
}

VII. Sell-To-Open

{
  "symbol": "BTCUSD",
  "action": "sell_to_open",
  "quantity": 3
}

VIII. Sell-To-Close

{
  "symbol": "BTCUSD",
  "action": "sell_to_close",
  "quantity": 3
}

Limit Order

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

  • Symbol
  • Action
  • Quantity
  • Limit_price

Symbol

The ticker symbol represents the specific cryptocurrency. TradeStation represents this asset by pairing of cryptocurrency ticker symbol with the US dollar. e.g. BTCUSD, ETHUSD, 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 you specify the limit price the trade will be executed at the specified limit price. Or If you choose not to specify a limit price, the trade will be executed at the current market price.
EXAMPLE
I. Buy

{
  "symbol": "BTCUSD",
  "action": "buy",
  "quantity": 123,
  "limit_price": 123.98
}

II. Sell

{
  "symbol": "BTCUSD",
  "action": "sell",
  "quantity": 123,
  "limit_price": 123.98
}

III. Buy-To-Cover

{
  "symbol": "BTCUSD",
  "action": "buy_to_cover",
  "quantity": 123,
  "limit_price": 123.98
}

IV. Sell-Short

{
  "symbol": "BTCUSD",
  "action": "sell_short",
  "quantity": 123,
  "limit_price": 123.98
}

V. Buy-To-Open

{
  "symbol": "BTCUSD",
  "action": "buy_to_open",
  "quantity": 123,
  "limit_price": 123.98
}

VI. Buy-To-Close

{
  "symbol": "BTCUSD",
  "action": "buy_to_close",
  "quantity": 123,
  "limit_price": 123.98
}

VII. Sell-To-Open

{
  "symbol": "BTCUSD",
  "action": "sell_to_open",
  "quantity": 123,
  "limit_price": 123.98
}

VIII. Sell-To-Close

{
  "symbol": "BTCUSD",
  "action": "sell_to_close",
  "quantity": 123,
  "limit_price": 123.98
}

Stop Order

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

  • Symbol
  • Action
  • Quantity
  • Stop_price

Symbol

The ticker symbol represents the specific cryptocurrency. TradeStation represents this asset by pairing of cryptocurrency ticker symbol with the US dollar. e.g. BTCUSD, ETHUSD, 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.

EXAMPLE

I. Buy

{
  "symbol": "BTCUSD",
  "action": "buy",
  "quantity": 123,
  "limit_price": 123.98
}

II. Sell

{
  "symbol": "BTCUSD",
  "action": "sell",
  "quantity": 123,
  "limit_price": 123.98
}

III. Buy-To-Cover

{
  "symbol": "BTCUSD",
  "action": "buy_to_cover",
  "quantity": 123,
  "stop_price": 123.98
}

IV. Sell-Short

{
  "symbol": "BTCUSD",
  "action": "sell_short",
  "quantity": 123,
  "stop_price": 123.98
}

V. Buy-To-Open

{
  "symbol": "BTCUSD",
  "action": "buy_to_open",
  "quantity": 123,
  "stop_price": 123.98
}

VI. Buy-To-Close

{
  "symbol": "BTCUSD",
  "action": "buy_to_close",
  "quantity": 123,
  "stop_price": 123.98
}

VII. Sell-To-Open

{
  "symbol": "BTCUSD",
  "action": "sell_to_open",
  "quantity": 123,
  "stop_price": 123.98
}

VIII. Sell-To-Close

{
  "symbol": "BTCUSD",
  "action": "sell_to_close",
  "quantity": 123,
  "stop_price": 123.98
}

Stop-Limit Order

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

  • Symbol
  • Action
  • Quantity
  • Limit_price
  • Stop_price

Symbol

The ticker symbol represents the specific cryptocurrency. TradeStation represents this asset by pairing of cryptocurrency ticker symbol with the US dollar. e.g. BTCUSD, ETHUSD, 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 you specify the limit price the trade will be executed at the specified limit price. Or If you choose not to specify a limit price, 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.

EXAMPLE

I. Buy

{
  "symbol": "BTCUSD",
  "action": "buy",
  "quantity": 2,
  "stop_price": 60,
  "limit_price": 58.50
}

II. Sell

{
  "symbol": "BTCUSD",
  "action": "sell",
  "quantity": 2,
  "stop_price": 60,
  "limit_price": 58.50
}

III. Buy-To-Cover

{
  "symbol": "BTCUSD",
  "action": "buy_to_cover"
  "quantity": 2,
  "stop_price": 60,
  "limit_price": 58.50
}

IV. Sell-Short

{
  "symbol": "BTCUSD",
  "action": "sell_short",
  "quantity": 2,
  "stop_price": 60,
  "limit_price": 58.50
}

V. Buy-To-Open

{
  "symbol": "BTCUSD",
  "action": "buy_to_open",
  "quantity": 2,
  "stop_price": 60,
  "limit_price": 58.50
}

VI. Buy-To-Close

{
  "symbol": "BTCUSD",
  "action": "buy_to_close",
  "quantity": 2,
  "stop_price": 60,
  "limit_price": 58.50
}

VII. Sell-To-Open

{
  "symbol": "BTCUSD",
  "action": "sell_to_open",
  "quantity": 2,
  "stop_price": 60,
  "limit_price": 58.50
}

VIII. Sell-To-Close

{
  "symbol": "BTCUSD",
  "action": "sell_to_close",
  "quantity": 2,
  "stop_price": 60,
  "limit_price": 58.50
}
Sep 29, 2023

Contact Us

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