Пример #1
0
        internal void DetectTrade(Fill fill)
        {
            var id = fill.Instrument.Id;

            if (this.detectors[id] == null)
            {
                var detector = new TradeDetector(TradeDetectionType.FIFO, this.portfolio);
                detector.TradeDetected += (sender, e) =>
                {
                    var info = e.TradeInfo;
                    foreach (var item in Items)
                    {
                        item.OnRoundTrip(info);
                    }
                };
                this.detectors[id] = detector;
            }
            this.detectors[id].Add(fill);
        }