public void OnTrade(TradeDto trade)
        {
            _eventLoopScheduler.Schedule(() =>
            {
                var currencyPair = trade.CurrencyPair;

                var currencyPairTracker = GetTrackerFor(currencyPair);

                currencyPairTracker.OnTrade(trade, _priceCache);
                PublishPositionReport();
            });
        }
        public void OnTrade(TradeDto trade, IDictionary<string, SpotPriceDto> priceCache)
        {
            if (trade.Status != TradeStatusDto.Done)
                return;

            if (trade.Direction == DirectionDto.Buy)
            {
                _baseTradedAmount += trade.Notional;
                _counterTradedAmount += trade.Notional*trade.SpotRate;
            }
            else
            {
                _baseTradedAmount -= trade.Notional;
                _counterTradedAmount -= trade.Notional*trade.SpotRate;
            }
            TradeCount++;

            OnPrice(priceCache, true);
        }
 public void OnTrade(TradeDto trade)
 {
     Log.Information("Received done trade");
     _analyticsEngine.OnTrade(trade);
 }