本页面尚未提供您的语言版本,显示其他语言版本。

Instrument identifier

The instruments in the S# from different sources have the Security.Id uniform identifier. This is done so that the trading algorithm code does not depend on the type of connection (OpenECry, Rithmic, Interactive Brokers etc.). For the instrument identifier the following syntax is used - [instrument code]@[board code]. For example, for the Apple inc shares identifier will be AAPL@NASDAQ. For the derivatives market instruments board will be NYSE (or other board name where AAPL futures trade). For example, for the June futures on the ES index the identifier will be ESM5@NYSE.

Tip

The Hydra application for market data download enumerates folders with a history based on the same mechanism.

Identifiers generation algorithm overriding

  1. To start the instrument identifiers generation on the own algorithm, you must create the descendant of the SecurityIdGenerator class, and override the SecurityIdGenerator.GenerateId(System.String secCode, System.String boardCode ) method:

    class CustomSecurityIdGenerator : SecurityIdGenerator
    {
       public override string GenerateId(string secCode, ExchangeBoard board)
       {
          // will be generate in CODE--BOARD form
          return secCode + "--" + board.Code;
       }
    }
    
  2. Then, the created generator must be passed to the connector:

    connector.SecurityIdGenerator = new CustomSecurityIdGenerator();