internal void Initialise(int numberOfRows, string secType, double tickSize)
        {
            this.mAsks = new List <ModelEntry>(numberOfRows);
            this.mBids = new List <ModelEntry>(numberOfRows);
            InProgress = true;

            mFormatPrice    = PriceFormatter.GetPriceFormatter(secType, tickSize);
            mFormatAvgPrice = PriceFormatter.GetPriceFormatter(secType, tickSize, true);
        }
Example #2
0
        private void startMarketData(ContractDetails contractData, bool snapshot)
        {
            var id = mNextTickerId++;

            logMessage($"Starting ticker: id={id}; {contractToString(contractData.Contract)}");

            mApi.reqMktData(id, contractData.Contract, "", snapshot, false, null);
            Ticker ticker = new Ticker(contractData)
            {
                ContractDetails = contractData,
                FormatPrice     = PriceFormatter.GetPriceFormatter(contractData.Contract.SecType, contractData.MinTick * contractData.PriceMagnifier),
                IsSnapshot      = true
            };

            mTickers.Add(ticker);
        }