CQG API 4.0 - Revised
CreateStrategyOrder Method
See Also  Send Feedback
order_type

Type of the order.

The CQGOrder.Properties collection depends on it.

The otStopLimit order type is not supported.

cqg_definition

Strategy definition that should be used to place the order.

The CQGStrategyDefinition.Status property value should be srsPending or srsSuccess, otherwise an exception will be thrown.

cqg_account

Account that should be used to place the order

cqg_accounts

Additional accounts, on which order legs should be placed.

Is not supported yet; hence, Nothing should be passed.

order_quantity

Order quantity. Signed or unsigned - depends on CQGAPIConfig.UseOrderSide setting.

order_side

Side of the order. Not used if CQGAPIConfig.UseOrderSide is set to false.

limit_price
Limit price for the order
stop_price
Stop price for the order
ue_name_part

Part of the user-friendly name.

Other parts of UEName are automatically generated.

CQGCEL Interface : CreateStrategyOrder Method

Glossary Item Box

Description

Creates new strategy order with specified parameters.

Syntax

Visual Basic
Public Function CreateStrategyOrder( _
   ByVal order_type As eOrderType, _
   ByVal cqg_definition As CQGStrategyDefinition, _
   ByVal cqg_account As CQGAccount, _
   ByVal cqg_accounts As CQGAccounts, _
   ByVal order_quantity As Long, _
   Optional ByVal order_side As eOrderSide = osdUndefined, _
   Optional ByVal limit_price As Double = -2147483647, _
   Optional ByVal stop_price As Double = -2147483647, _
   Optional ByVal ue_name_part As String = "" _
) As CQGOrder

Parameters

order_type
ValueDescription
otLimit

Limit order.

otMarket

Market order.

otStop

Stop order.

otStopLimit

Stop Limit order.

otUndefined

Undefined order type.

Type of the order.

The CQGOrder.Properties collection depends on it.

The otStopLimit order type is not supported.

cqg_definition

Strategy definition that should be used to place the order.

The CQGStrategyDefinition.Status property value should be srsPending or srsSuccess, otherwise an exception will be thrown.

cqg_account

Account that should be used to place the order

cqg_accounts

Additional accounts, on which order legs should be placed.

Is not supported yet; hence, Nothing should be passed.

order_quantity

Order quantity. Signed or unsigned - depends on CQGAPIConfig.UseOrderSide setting.

order_side
ValueDescription
osdBuySide properties return this value if CQGAPIConfig.UseOrderSide is set to True.

Depending on the owner, osdBuy value is returned in case of:

  • the object is a CQGTrade referring to a buy trade
  • the object is a CQGPosition referring to a long position.

  • the object is a CQGOrder referring to an order of buy type.
  • the object is a CQGFill referring to a fill of buy type.
osdSellSide properties return this value if CQGAPIConfig.UseOrderSide is set to True.

Depending on the owner, osdSell value is returned in case of:

  • the object is a CQGTrade referring to a sell trade
  • the object is a CQGPosition referring to a short position.

  • the object is a CQGOrder referring to an order of sell type.
  • the object is a CQGFill referring to a fill of sell type.
osdUndefinedSide properties return this value if CQGAPIConfig.UseOrderSide is set to False.

Side of the order. Not used if CQGAPIConfig.UseOrderSide is set to false.

limit_price
Limit price for the order
stop_price
Stop price for the order
ue_name_part

Part of the user-friendly name.

Other parts of UEName are automatically generated.

Return Type

A CQGOrder object which represents the newly created order.

Remarks

Important Note: The eOrderProperty.opExecutionPattern property must be set for the strategy order, otherwise, the order will not be placed.

Depending on its type, the order can be either placed as is or some properties should be set before actual placing.

Some of the properties can be modified after order creation and before the order is placed. For more information see the CQGOrder and CQGOrderProperties objects.

The status of the order is set to osNotSent and its state to olsNotSent before the CQGOrder.Place method is called.

See Also