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

Type of the order

The CQGOrder.Properties collection depends on the order type.

Depending on it, calling the CQGOrder.PrepareModify method will return different results.

instrument_name

The detailed instrument name to be be used when creating the order. For example, F.US.EP.M20, C.US.CLE.U21.100 (U21 is September 2021; 100 is a strike), C.US.CLE.M20.N100 (M20 is June 2020; N100 is a negative strike: -100).

The full instrument name (e.g. F.US.EPZ16) is also supported for backward compatibility, but its using is depricated.

cqg_account
The account on which the order will be place.
order_quantity

This parameter can be signed or unsigned - depending on the CQGAPIConfig.UseOrderSide settings.

order_side

Side of the order

Not used if CQGAPIConfig.UseOrderSide is set to false.

limit_price

The limit price of the order

stop_price

The stop price of the order

ue_name_part

Part of the user-friendly name.

Other parts of UEName are automatically generated.

CQGCEL Interface : CreateOrderByInstrumentName Method

Glossary Item Box

Description

This method creates a new order with the specified parameters.

The result of this method is the same as the one from CQGCEL.CreateOrder, however it allows to create an order by providing the full instrument name without prior need to subscribe to the instrument.

Syntax

Visual Basic
Public Function CreateOrderByInstrumentName( _
   ByVal order_type As eOrderType, _
   ByVal instrument_name As String, _
   ByVal cqg_account As CQGAccount, _
   ByVal order_quantity As Long, _
   Optional ByVal order_side As eOrderSide = osdUndefined, _
   Optional ByVal limit_price As Double = 0, _
   Optional ByVal stop_price As Double = 0, _
   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 the order type.

Depending on it, calling the CQGOrder.PrepareModify method will return different results.

instrument_name

The detailed instrument name to be be used when creating the order. For example, F.US.EP.M20, C.US.CLE.U21.100 (U21 is September 2021; 100 is a strike), C.US.CLE.M20.N100 (M20 is June 2020; N100 is a negative strike: -100).

The full instrument name (e.g. F.US.EPZ16) is also supported for backward compatibility, but its using is depricated.

cqg_account
The account on which the order will be place.
order_quantity

This parameter can be signed or unsigned - depending on the CQGAPIConfig.UseOrderSide settings.

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

The limit price of the order

stop_price

The stop price of the order

ue_name_part

Part of the user-friendly name.

Other parts of UEName are automatically generated.

Return Type

Returns the newly created CQGOrder object if successful, otherwise throws an exception.

Example

The example below shows how to place market order using this method.

VB
C#
 
 

See Also