private void OnInstrumentFill(int qty, string BS, string px, string key) { // Update position. if (BS == "B") { m_Position += qty; } else { m_Position -= qty; } // Send the data to the TradeMacher. TradeMatching.Fill m_Fill = new TradeMatching.Fill(); if (BS == "B") { m_Fill.BS = TradeMatching.TradeType.BUY; } else { m_Fill.BS = TradeMatching.TradeType.SELL; } m_Fill.Price = Convert.ToDouble(px); m_Fill.TradeID = key; m_Fill.Qty = qty; m_Matcher.Fill_Received(m_Fill); m_NetPos = m_Matcher.NetPos; }
private void OnInstrumentFill(Fill x) { // Update position. if (x.BuySell == "B") { m_Position += x.Qty; } else { m_Position -= x.Qty; } // Send the data to the TradeMacher. TradeMatching.Fill m_Fill = new TradeMatching.Fill(); if (x.BuySell == "B") { m_Fill.BS = TradeMatching.TradeType.BUY; } else { m_Fill.BS = TradeMatching.TradeType.SELL; } m_Fill.Price = Convert.ToDouble(x.Price); m_Fill.TradeID = x.TradeID; m_Fill.Qty = (int)x.Qty; m_Matcher.Fill_Received(m_Fill); m_NetPos = m_Matcher.NetPos; }