Algorithmic Strategy Orders

WebAPI protocol allows the use of The CQG Algo platform. Details about some strategies can also be checked here.

Clients must be enabled to use the CQG Algo. Available strategies can be checked through OrderEntitlementRequest.

Client Message:

{
  "information_requests": {
    "id": 1,
    "order_entitlement_request": {
      "contract_id": 1,
      "account_id": 123456
    }
  }
}

Server Response:

On account 123456, it is allowed to use “CQG RTWAP”, “CQG TWAP”, and “CQG VWAP” algo strategies.

{
  "information_reports": {
    "id": 1,
    "status_code": 0,
    "order_entitlement_report": {
      "order_entitlements": [
        {
          "order_type": 1,
          "is_synthetic": false,
          "duration": 1,
          "exec_instruction": 12,
          "algo_strategies": [
            "CQG RTWAP",
            "CQG TWAP",
            "CQG VWAP"
          ]
        }
      ]
    }
  }
}

After receiving the list of available strategies, you may request strategy definition using AlgoStrategyDefinitionRequest to get the parameters of the strategy, possible values, and layouts. The definition is provided in FIXatdl format.

Client Message:

{
  "information_requests": {
    "id": 2,
    "algo_strategy_definition_request": {
      "algo_strategies": "CQG VWAP"
    }
  }
}

Server Response:

{
  "information_reports": {
    "id": 2,
    "status_code": 0,
    "algo_strategy_definition_report": {
      "algo_strategy_definitions": [
        {
          "abbreviation": "CQG VWAP",
          "definition": "<CQG VWAP FIXatdl definition>"
        }
      ]
    }
  }
}

Before placing an order, a trade subscription must be sent. If you also want to receive child orders, set include_algo_strategy_child_orders = true (see TradeSubscription for details).

Client Message:

{
  "trade_subscriptions": [
    {
      "id": 3,
      "subscription_scopes": [1],
      "subscribe": true,
      "include_algo_strategy_child_orders": false
    }
  ]
}

Server Response:

{
  "trade_subscription_statuses": [
    {
      "id": 3,
      "status_code": 0
    }
  ]
}

{
  "trade_snapshot_completions": [
    {
      "subscription_id": 3,
      "subscription_scopes": [1]
    }
  ]
}

Now you can place an algo strategy order. The algo_strategy field is set with the desired strategy ("CQG VWAP"), and algo strategy parameters are set in Order.extra_attributes. The parameters are taken from the definition but with an additional prefix ALGO_. For example, if FIXatdl has a parameter CQG_i_would_price, in extra_attributes it should be ALGO_CQG_i_would_price.

Client Message:

{
  "order_requests": {
    "request_id": 4,
    "new_order": {
      "order": {
        "account_id": 123456,
        "contract_id": 1,
        "cl_order_id": "algo order 1",
        "order_type": 1,
        "duration": 1,
        "side": 1,
        "when_utc_timestamp": {
          "seconds": 1741606449,
          "nanos": 204000000
        },
        "qty": {
          "significand": 5,
          "exponent": 0
        },
        "extra_attributes": [
          { "name": "ALGO_CQG_i_would_price", "value": "0" },
          { "name": "ALGO_CQG_impact_model", "value": "2" },
          { "name": "ALGO_CQG_percent_of_volume", "value": "0.05" },
          { "name": "ALGO_CQG_time_horizon_days", "value": "60" },
          { "name": "ALGO_CQG_wake_interval_seconds", "value": "15" },
          { "name": "ALGO_CQG_averaging_method", "value": "0" },
          { "name": "ALGO_CQG_schedule_slicing_method", "value": "0" },
          { "name": "ALGO_CQG_start_time", "value": "20250310-11:40:00" },
          { "name": "ALGO_CQG_end_time", "value": "20250310-12:40:59" },
          { "name": "ALGO_CQG_max_duration_in_minutes", "value": "0" },
          { "name": "ALGO_CQG_tick_offset", "value": "0" },
          { "name": "ALGO_CQG_payup_model", "value": "3" },
          { "name": "ALGO_CQG_opposite_size_ratio", "value": "0" },
          { "name": "ALGO_CQG_opposite_size_raw", "value": "0" },
          { "name": "ALGO_CQG_max_chase_ticks", "value": "0" },
          { "name": "ALGO_CQG_on_miss", "value": "0" },
          { "name": "ALGO_CQG_model_sensitivity", "value": "0" },
          { "name": "ALGO_CQG_success_probability", "value": "0.0" },
          { "name": "ALGO_CQG_join_threshold", "value": "0.0" }
        ],
        "algo_strategy": "CQG VWAP"
      }
    }
  }
}

Server Response:

In case of success, you will receive OrderStatus (#order_2-orderstatus) with status 1 (IN_TRANSIT) and 3 (WORKING). Status codes are listed here.