CQG API 4.0 - Revised
NewInstrument Method
See Also  Send Feedback
symbol_

Symbol to resolve in one of the following formats:

  • symbol prefix (e.g. EP)
  • symbol prefix with month (EPZ)
  • symbol prefix with month and year (EPZ7)
  • symbol prefix with relative month (EP?1)
  • full or short option instrument name (C.EPF1617650 or C.EP_F16.17650)
CQGCEL Interface : NewInstrument Method

Glossary Item Box

Description

Resolves the given symbol and subscribes to the instrument.

Syntax

Visual Basic
Public Sub NewInstrument( _
   ByVal symbol_ As String _
) 

Parameters

symbol_

Symbol to resolve in one of the following formats:

  • symbol prefix (e.g. EP)
  • symbol prefix with month (EPZ)
  • symbol prefix with month and year (EPZ7)
  • symbol prefix with relative month (EP?1)
  • full or short option instrument name (C.EPF1617650 or C.EP_F16.17650)

Remarks

The method works in asynchronous mode, i.e. the method just triggers the request in the CQGCEL without waiting for its results.

InstrumentResolved event is fired as a result of the method call.

An exception will be thrown if symbol is empty string.

Depricated:

If the symbol is valid, the result will come with the InstrumentSubscribed event.

If the symbol is not valid, the IncorrectSymbol event will be fired.

 

Note: Only tradable instruments are considered to be valid.

It is a good practice to cancel the request as soon as it becomes unnecessary. Such approach allows using memory resources more optimal.

Call RemoveInstrument for request cancelling.

Example

See the usage of the NewInstrument method in CQGCEL Example.

See Also