Futures | Interactive Brokers

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 Interactive Brokers.

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. Interactive Broker expresses this asset class using a contract code format that combines the ticker symbol, month code, and year. Here month and year represent the expiration of the contract.

For the complete list of the futures symbols, please check this page.

The format is: [Ticker Symbol][Month Code][Year]

For instance, let's consider the E-Mini S&P 500 futures contract. Its ticker symbol is "ES," indicating the E-Mini S&P 500. Now, for the month component, a specific code is used to represent each month:

  • January is represented by "F"
  • February is represented by "G"
  • March is represented by "H"
  • April is represented by "J"
  • May is represented by "K"
  • June is represented by "M"
  • July is represented by "N"
  • August is represented by "Q"
  • September is represented by "U"
  • October is represented by "V"
  • November is represented by "X"
  • December is represented by "Z"

For example, if you wish to trade an E-Mini S&P 500 contract expiring in September, you will be looking for a contract that starts with "ESU." Similarly, for a contract expiring in December, the code will start with "ESZ."

To denote the year of the contract, you simply append the year to the code. For instance, "ESU23" would represent the E-Mini S&P 500 contract expiring on September 2023.

Sample:

  • Product = "ES"  represents “E-Mini S&P 500”.
  • Month_code = "U"  represents “September”.
  • Year = "23"  represents 2023 (using two digits to represent the year).

Keep in mind that some trading platforms may use different formats to represent the year, such as:

  • One digit: '3' for the year 2023
  • Two digits: '23' for the year 2023
  • Three digits: '023' for the year 2023
  • Four digits: '2023'

NOTE: Interactive Broker uses the two-digit year format for traders to represent the year by using two digits.

Action

The signal action indicates the type of trade to be triggered. The action can be any of the following four:

  • Buy: Triggers an action to buy the asset.
  • Sell: Triggers an action to sell the asset.
  • Close/Exit: Triggers an action to close an existing open position and exit the trade.
  • Cancel: Triggers an action to cancel any open orders.

Quantity

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

Note: You can also use the JSON field- quantity_type

This is an optional field indicating the type of quantity being specified. We have three options - fixed, cash, and percent_of_equity.

Fixed (Default): The trade quantity will be set as a fixed quantity, such as “100” shares or “10” shares.

{
 "quantity": 100,
 "quantity_type": "fixed"
}

Cash: The trade quantity is represented by the available cash amount. For instance, if the quantity_type is set to "cash", and the trader specifies a value of 100, it means they are trading 100 units of the currency value, such as 100 USD or 100 GBP, depending on the currency locale of the trader.

{
 "quantity": 100,
 "quantity_type": "cash"
}

Percent_of_equity: The quantity is calculated as a percentage of the total equity (account balance, not including unrealized p/l). For instance, if the total equity is $50,000 and the quantity_type is set to “percent_of_equity” with the value of “2” then the trade quantity would be $50,000*0.02 = $1000.

{
  "quantity": 2,
  "quantity_type": "percent_of_equity"
}

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": "ESU23",
  "action": "buy",
  "quantity": 123,
  "class": "future"
}

II. Sell

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

III. Close

{
  "symbol": "ESU23",
  "action": "close",
  "class": "future"
}

IV. Cancel

{
  "symbol": "ESU23",
  "action": "cancel",
  "class": "future"
}

Limit Order

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

  • Symbol
  • Action
  • Quantity
  • Limit_price
  • Class

Symbol

The ticker symbol of the futures contract. Interactive Broker expresses this asset class using a contract code format that combines the ticker symbol, month code, and year. Here month and year represent the expiration of the contract.

For the complete list of the futures symbols, please check this page.

The format is: [Ticker Symbol][Month Code][Year]

For instance, let's consider the E-Mini S&P 500 futures contract. Its ticker symbol is "ES," indicating the E-Mini S&P 500. Now, for the month component, a specific code is used to represent each month:

  • January is represented by "F"
  • February is represented by "G"
  • March is represented by "H"
  • April is represented by "J"
  • May is represented by "K"
  • June is represented by "M"
  • July is represented by "N"
  • August is represented by "Q"
  • September is represented by "U"
  • October is represented by "V"
  • November is represented by "X"
  • December is represented by "Z"

For example, if you wish to trade an E-Mini S&P 500 contract expiring in September, you will be looking for a contract that starts with "ESU." Similarly, for a contract expiring in December, the code will start with "ESZ."

To denote the year of the contract, you simply append the year to the code. For instance, "ESU23" would represent the E-Mini S&P 500 contract expiring on September 2023.

Sample:

  • Product = "ES"  represents “E-Mini S&P 500”.
  • Month_code = "U"  represents “September”.
  • Year = "23"  represents 2023 (using two digits to represent the year).

Keep in mind that some trading platforms may use different formats to represent the year, such as:

  • One digit: '3' for the year 2023
  • Two digits: '23' for the year 2023
  • Three digits: '023' for the year 2023
  • Four digits: '2023'

NOTE: Interactive Broker uses the two-digit year format for traders to represent the year by using two digits.

Action

The signal action indicates the type of trade to be triggered. The action can be any of the following four:

  • Buy: Triggers an action to buy the asset.
  • Sell: Triggers an action to sell the asset.
  • Close/Exit: Triggers an action to close an existing open position and exit the trade.
  • Cancel: Triggers an action to cancel any open orders.

Quantity

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

Note: You can also use the JSON field- quantity_type.

This is an optional field indicating the type of quantity being specified. We have three options - fixed, cash, and percent_of_equity.

Fixed (Default): The trade quantity will be set as a fixed quantity, such as “100” shares or “10” shares.

{
 "quantity": 100,
 "quantity_type": "fixed"
}

Cash: The trade quantity is represented by the available cash amount. For instance, if the quantity_type is set to "cash", and the trader specifies a value of 100, it means they are trading 100 units of the currency value, such as 100 USD or 100 GBP, depending on the currency locale of the trader.

{
 "quantity": 100,
 "quantity_type": "cash"
}

Percent_of_equity: The quantity is calculated as a percentage of the total equity (account balance, not including unrealized p/l). For instance, if the total equity is $50,000 and the quantity_type is set to “percent_of_equity” with the value of “2” then the trade quantity would be $50,000*0.02 = $1000.

{
  "quantity": 2,
  "quantity_type": "percent_of_equity"
}

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.

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": "ESU23",
  "action": "buy",
  "quantity": 123,
  "limit_price": 123.98,
  "class": "future"
}

II. Sell

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

III. Close

{
  "symbol": "ESU23",
  "action": "close",
  "limit_price": 123.98,
  "class": "future"
}

IV. Cancel

{
  "symbol": "ESU23",
  "action": "cancel",
  "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. Interactive Broker expresses this asset class using a contract code format that combines the ticker symbol, month code, and year. Here month and year represent the expiration of the contract.

For the complete list of the futures symbols, please check this page.

The format is: [Ticker Symbol][Month Code][Year]

For instance, let's consider the E-Mini S&P 500 futures contract. Its ticker symbol is "ES," indicating the E-Mini S&P 500. Now, for the month component, a specific code is used to represent each month:

  • January is represented by "F"
  • February is represented by "G"
  • March is represented by "H"
  • April is represented by "J"
  • May is represented by "K"
  • June is represented by "M"
  • July is represented by "N"
  • August is represented by "Q"
  • September is represented by "U"
  • October is represented by "V"
  • November is represented by "X"
  • December is represented by "Z"

For example, if you wish to trade an E-Mini S&P 500 contract expiring in September, you will be looking for a contract that starts with "ESU." Similarly, for a contract expiring in December, the code will start with "ESZ."

To denote the year of the contract, you simply append the year to the code. For instance, "ESU23" would represent the E-Mini S&P 500 contract expiring on September 2023.

Sample:

  • Product = "ES"  represents “E-Mini S&P 500”.
  • Month_code = "U"  represents “September”.
  • Year = "23"  represents 2023 (using two digits to represent the year).

Keep in mind that some trading platforms may use different formats to represent the year, such as:

  • One digit: '3' for the year 2023.
  • Two digits: '23' for the year 2023.
  • Three digits: '023' for the year 2023.
  • Four digits: '2023'.

NOTE: Interactive Broker uses the two-digit year format for traders to represent the year by using two digits.

Action

The signal action indicates the type of trade to be triggered. The action can be any of the following four:

  • Buy: Triggers an action to buy the asset.
  • Sell: Triggers an action to sell the asset.
  • Close/Exit: Triggers an action to close an existing open position and exit the trade.
  • Cancel: Triggers an action to cancel any open orders.

Quantity

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

Note: You can also use the JSON field- quantity_type.

This is an optional field indicating the type of quantity being specified. We have three options - fixed, cash, and percent_of_equity.

Fixed (Default): The trade quantity will be set as a fixed quantity, such as “100” shares or “10” shares.

{
 "quantity": 100,
 "quantity_type": "fixed"
}

Cash: The trade quantity is represented by the available cash amount. For instance, if the quantity_type is set to "cash", and the trader specifies a value of 100, it means they are trading 100 units of the currency value, such as 100 USD or 100 GBP, depending on the currency locale of the trader.

{
 "quantity": 100,
 "quantity_type": "cash"
}

Percent_of_equity: The quantity is calculated as a percentage of the total equity (account balance, not including unrealized p/l). For instance, if the total equity is $50,000 and the quantity_type is set to “percent_of_equity” with the value of “2” then the trade quantity would be $50,000*0.02 = $1000.

{
  "quantity": 2,
  "quantity_type": "percent_of_equity"
}

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": "ESU23",
  "action": "buy",
  "quantity": 123,
  "stop_price": 123.98,
  "class": "future"
}

II. Sell

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

III. Close

{
  "symbol": "ESU23",
  "action": "close",
  "stop_price": 123.98,
  "class": "future"
}

IV. Cancel

{
  "symbol": "ESU23",
  "action": "cancel",
  "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. Interactive Broker expresses this asset class using a contract code format that combines the ticker symbol, month code, and year. Here month and year represent the expiration of the contract.

For the complete list of the futures symbols, please check this page.

The format is: [Ticker Symbol][Month Code][Year]

For instance, let's consider the E-Mini S&P 500 futures contract. Its ticker symbol is "ES," indicating the E-Mini S&P 500. Now, for the month component, a specific code is used to represent each month:

  • January is represented by "F"
  • February is represented by "G"
  • March is represented by "H"
  • April is represented by "J"
  • May is represented by "K"
  • June is represented by "M"
  • July is represented by "N"
  • August is represented by "Q"
  • September is represented by "U"
  • October is represented by "V"
  • November is represented by "X"
  • December is represented by "Z"

For example, if you wish to trade an E-Mini S&P 500 contract expiring in September, you will be looking for a contract that starts with "ESU." Similarly, for a contract expiring in December, the code will start with "ESZ."

To denote the year of the contract, you simply append the year to the code. For instance, "ESU23" would represent the E-Mini S&P 500 contract expiring on September 2023.

Sample:

  • Product = "ES"  represents “E-Mini S&P 500”.
  • Month_code = "U"  represents “September”.
  • Year = "23"  represents 2023 (using two digits to represent the year).

Keep in mind that some trading platforms may use different formats to represent the year, such as:

  • One digit: '3' for the year 2023.
  • Two digits: '23' for the year 2023.
  • Three digits: '023' for the year 2023.
  • Four digits: '2023'.

NOTE: Interactive Broker uses the two-digit year format for traders to represent the year by using two digits.

Action

The signal action indicates the type of trade to be triggered. The action can be any of the following four:

  • Buy: Triggers an action to buy the asset.
  • Sell: Triggers an action to sell the asset.
  • Close/Exit: Triggers an action to close an existing open position and exit the trade.
  • Cancel: Triggers an action to cancel any open orders.

Quantity

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

Note: You can also use the JSON field- quantity_type.

This is an optional field indicating the type of quantity being specified. We have three options - fixed, cash, and percent_of_equity.

Fixed (Default): The trade quantity will be set as a fixed quantity, such as “100” shares or “10” shares.

{
 "quantity": 100,
 "quantity_type": "fixed"
}

Cash: The trade quantity is represented by the available cash amount. For instance, if the quantity_type is set to "cash", and the trader specifies a value of 100, it means they are trading 100 units of the currency value, such as 100 USD or 100 GBP, depending on the currency locale of the trader.

{
 "quantity": 100,
 "quantity_type": "cash"
}

Percent_of_equity: The quantity is calculated as a percentage of the total equity (account balance, not including unrealized p/l). For instance, if the total equity is $50,000 and the quantity_type is set to “percent_of_equity” with the value of “2” then the trade quantity would be $50,000*0.02 = $1000.

{
  "quantity": 2,
  "quantity_type": "percent_of_equity"
}

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.

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": "ESU23",
  "action": "buy",
  "quantity": 123,
  "limit_price": 123.98,
  "stop_price": 123.98,
  "class": "future"
}

II. Sell

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

III. Close

{
  "symbol": "ESU23",
  "action": "close",
  "limit_price": 123.98,
  "stop_price": 123.98,
  "class": "future"
}

IV. Cancel

{
  "symbol": "ESU23",
  "action": "cancel",
  "limit_price": 123.98,
  "stop_price": 123.98,
  "class": "future"
}
Jan 19, 2024

Contact Us

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