Brokerages
FIX Connections
Supported Connections
The following FIX connections are available on QuantConnect:
| Name | Integration Implementation | Model Implementation |
|---|---|---|
| Bloomberg | Lean.Brokerages.Fix.Bloomberg | BloombergFixBrokerageModel.cs |
| Raiffeisen Bank International | Lean.Brokerages.RaiffeisenBankInternational | RBIBrokerageModel.cs |
| Wolverine | Lean.Brokerages.Wolverine | WolverineBrokerageModel.cs |
Order Properties
FIX connections support custom order properties. The following table describes the members of the FixOrderProperties object that you can set to customize order execution:
| Property | Data Type | Description | Default Value |
|---|---|---|---|
TimeInForcetime_in_force | TimeInForce | A TimeInForce instruction to apply to the order. | TimeInForce.GoodTilCanceledTimeInForce.GOOD_TIL_CANCELED |
HandleInstructionhandle_instruction | char?str/NoneType | The instruction for order handling on the broker floor. The following values are supported:
| |
Notesnotes | stringstr | The free form text instructions that may be sent to the broker. | |
AdditionalPropertiesadditional_properties | Dictionary<string, string>Dict[str, str] | The custom FIX tags to send with the order. The key is the FIX tag number and the value is the tag value. |
Each FIX connection provides an order properties class that inherits the FixOrderProperties class. For example, the Bloomberg FIX connection provides the BloombergFixOrderProperties class.
Some FIX counterparties require extra tags on order messages. For example, a broker behind the Bloomberg FIX connection requires tag 9301=1 to mark orders as direct market access (DMA). To send extra tags with your orders, add them to the AdditionalPropertiesadditional_properties dictionary:
public override void Initialize()
{
// Set the default order properties to mark orders as direct market access (DMA)
var orderProperties = new BloombergFixOrderProperties();
orderProperties.AdditionalProperties["9301"] = "1";
DefaultOrderProperties = orderProperties;
} def initialize(self) -> None:
# Set the default order properties to mark orders as direct market access (DMA)
order_properties = BloombergFixOrderProperties()
order_properties.additional_properties["9301"] = "1"
self.default_order_properties = order_properties
Portfolio State
FIX connections do not support fetching the portfolio state. You must provide the cash and holdings on deployment.
If your brokerage account has existing cash holdings, follow these steps (see video):
- In the Algorithm Cash State section, click .
- Click .
- Enter the currency ticker (for example, USD or CAD) and a quantity.
If your brokerage account has existing position holdings, follow these steps (see video):
- In the Algorithm Holdings State section, click .
- Click .
- Enter the symbol ID, symbol, quantity, and average price.