Strategy Definition

The WebAPI protocol allows a user to define (or retrieve an already defined) strategy contract using StrategyDefinitionRequest.

There are two types of strategies that can be created:

      Synthetic Strategy - Spreads and aggregations executed by CQG servers through orders for each leg.

      Exchange Strategy or User-Defined Strategy (UDS) - A spread with options, futures or another UDS(es) legs that is intended to be available directly on the exchange.

There are separate entitlements to trade synthetic strategies and request timed bars. If client has at least one, the client can also define synthetic strategy. Market data subscription is not available.

UDS doesn’t support historical requests. But defining and subscribing on market data doesn’t require special entitlements.

Note: Additional parameters for strategy trading are available in StrategyTradingParameters at the Order level (Order.strategy_trading_parameters).

For UDS, its duration is determined by the exchange. You can subscribe to SymbolResolutionRequest or ContractMetadataRequest. Upon expiration, you will receive an update with ContractMetadata.deleted = true. Synthetic strategies expire after some amount of days after its first definition if no orders are placed for them. Currently, there is no way to subscribe to expiration events for synthetic strategies.
An expired strategy must be redefined before use.

UDS nodes support only NODE_OPERATION_SUM in StrategyNodeDefinition.node_operation.

Additional attributes might be required by exchange when defining a UDS. Use StrategyDefinitionRequest.exchange_extra_attributes to provide these attributes. Details are available in ExchangeExtraAttributesForStrategyDefinition.

For a correct UDS type definition, specify ExchangeStrategy.requested_cqg_type using one of the values from ExchangeStrategyRequestedCQGTypes.

UDS can be defined in simulation mode (see StrategyDefinitionRequest.is_simulated) for testing purposes or in a demo environment. A strategy defined in this mode will not be registered on the exchange, and the CQG Simulation environment will be used to provide market data or fill orders.

Refer to StrategyDefinitionRequest, StrategyDefinition and StrategyNodeDefinition for more details.

Example

The example demonstrates how to define a synthetic strategy like SPREAD(F.US.EPH25-F.US.EPM25), where: - F.US.EPH25 is a contract with contract_id 1. - F.US.EPM25 is a contract with contract_id 2.

Client Message:

{
  "information_requests": [
    {
      "id": 1,
      "strategy_definition_request": {
        "strategy_definition": {
          "node_definitions": [
            {
              "node_operation": 1,
              "leg": {
                "contract_id": 1
              }
            },
            {
              "node_operation": 1,
              "leg": {
                "contract_id": 2,
                "qty_ratio": {
                  "significand": -1
                }
              }
            }
          ]
        }
      }
    }
  ]
}

Server Response:

{
  "information_reports": [
    {
      "id": 1,
      "is_report_complete": true,
      "status_code": 0,
      "strategy_definition_report": {
        "contract_metadata": {
          "contract_id": 3,
          "contract_symbol": "SPREAD(F.US.EPH25-F.US.EPM25, 0.25, 1:1, DOWN)",
          "correct_price_scale": 0.01,
          "display_price_scale": 2,
          "description": "SPREAD(F.US.EPH25-F.US.EPM25, 0.25, 1:1, DOWN)",
          "title": "EPH25-EPM25",
          "tick_size": 0.25,
          "currency": "",
          "tick_value": 0,
          "cfi_code": "MCXXXX",
          "instrument_group_name": "SPREAD(F.US.EPH25-F.US.EPM25, 0.25, 1:1, DOWN)",
          "session_info_id": -1,
          "short_instrument_group_name": "EPH25-EPM25",
          "instrument_group_description": "",
          "dialect_id": "0",
          "country_code": "",
          "strategy_definition": {
            "node_definitions": [
              {
                "node_operation": 1,
                "leg": {
                  "contract_id": 1,
                  "node_number": 1
                }
              },
              {
                "node_operation": 1,
                "leg": {
                  "contract_id": 2,
                  "qty_ratio": {
                    "significand": -1
                  },
                  "node_number": 2
                }
              }
            ]
          },
          "position_tracking": 1,
          "speculation_type_required": false,
          "volume_display_exponent": 0,
          "trade_size_increment": {
            "significand": 1,
            "exponent": 0
          },
          "cqg_contract_symbol": "SPREAD(F.US.EPH25-F.US.EPM25, 0.25, 1:1, DOWN)",
          "open_close_type": 0
        }
      }
    }
  ]
}