public bool AddReplaceItem(MarketDepth item) { bool flag = false; int num = 0; IEnumerator enumerator = this.fList.GetEnumerator(); try { while (enumerator.MoveNext()) { MarketDepth marketDepth = (MarketDepth)enumerator.Current; if (marketDepth.Price == item.Price && marketDepth.Size == item.Size && marketDepth.MarketMaker == item.MarketMaker && marketDepth.Side == item.Side) { this.fList[num] = item; flag = true; } num++; } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } if (!flag) { this.fList.Add(item); } return flag; }
public void EmitMarketDepth(FreeQuant.Data.MarketDepth depth, Instrument instrument) { if (this.WiB4iTUE4w == null) { return; } this.WiB4iTUE4w((object)this, new MarketDepthEventArgs(depth, (IFIXInstrument)instrument, (IMarketDataProvider)this)); }
public void Add(MarketDepth marketDepth) { DataManager.Add(this, marketDepth); }
public void Add(string series, MarketDepth marketDepth) { DataManager.Add(this, series, marketDepth); }
public MarketDepth(MarketDepth marketDepth) : this(marketDepth.DateTime, marketDepth.ProviderId, marketDepth.MarketMaker, marketDepth.Source, marketDepth.Position, marketDepth.operation, marketDepth.side, marketDepth.Price, marketDepth.Size) { }
public static void Add(Instrument instrument, string suffix, MarketDepth marketDepth) { DataManager.Add(instrument.Symbol + SERIES_SEPARATOR + suffix, marketDepth); }
internal void NEl89GHdA(Instrument obj0, MarketDepth obj1) { if (!this.isActive) return; if (Trace.IsLevelEnabled(TraceLevel.Verbose)) Trace.WriteLine(string.Format("fds", (object) this.Name, (object) obj0.Symbol, (object) obj1)); this.OnNewMarketDepth(obj0, obj1); }
public void Add(MarketDepth marketDepth) { try { OrderBookEntryList orderBookEntryList; switch (marketDepth.Side) { case MDSide.Bid: orderBookEntryList = this.bidList; break; case MDSide.Ask: orderBookEntryList = this.askList; break; default: throw new ArgumentException("Invalid Side" + marketDepth.Side); } switch (marketDepth.Operation) { case MDOperation.Insert: if (marketDepth.Position == -1) { int index = -1; switch (marketDepth.Side) { case MDSide.Bid: index = 0; while (index < orderBookEntryList.Count && marketDepth.Price <= orderBookEntryList[index].Price) ++index; break; case MDSide.Ask: index = orderBookEntryList.Count; while (index > 0 && marketDepth.Price <= orderBookEntryList[index - 1].Price) --index; break; } orderBookEntryList.Insert(index, new OrderBookEntry(marketDepth.DateTime, marketDepth.Price, marketDepth.Size)); this.EmitChanged(marketDepth.Side, marketDepth.Operation, index); break; } else { orderBookEntryList.Insert(marketDepth.Position, new OrderBookEntry(marketDepth.DateTime, marketDepth.Price, marketDepth.Size)); this.EmitChanged(marketDepth.Side, marketDepth.Operation, marketDepth.Position); break; } case MDOperation.Update: if (marketDepth.Position == -1 || marketDepth.Position >= orderBookEntryList.Count) break; OrderBookEntry orderBookEntry = orderBookEntryList[marketDepth.Position]; orderBookEntry.DateTime = marketDepth.DateTime; orderBookEntry.Size = marketDepth.Size; if (marketDepth.Price > 0.0) orderBookEntry.Price = marketDepth.Price; this.EmitChanged(marketDepth.Side, marketDepth.Operation, marketDepth.Position); break; case MDOperation.Delete: if (marketDepth.Position == -1) break; orderBookEntryList.RemoveAt(marketDepth.Position); this.EmitChanged(marketDepth.Side, marketDepth.Operation, marketDepth.Position); break; case MDOperation.Reset: orderBookEntryList.Clear(); this.EmitChanged(marketDepth.Side, marketDepth.Operation, marketDepth.Position); break; case MDOperation.Undefined: break; default: throw new ArgumentException("MDOperation is unknown: " + marketDepth.Operation.ToString()); } } catch (Exception ex) { Trace.WriteLine(ex.ToString()); } }
public HistoricalMarketDepthEventArgs(MarketDepth marketDepth, string requestId, IFIXInstrument instrument, IHistoricalDataProvider provider, int dataLength) : base(requestId, instrument, provider, dataLength) { this.MarketDepth = marketDepth; }
public void SetNewMarketDepth(FreeQuant.Instruments.Instrument instrument, MarketDepth depth) { try { Strategy strategy = (Strategy) null; if (!this.strategies.TryGetValue(instrument, out strategy)) return; strategy.OnOrderBookChanged((OrderBookUpdate) this.objectConverter.Convert(depth)); } catch (Exception ex) { this.EmitError(ex); } }
protected override void OnNewMarketDepth(Instrument instrument, MarketDepth marketDepth) { this.kXJRQmVtwY.OnMarketDepth(instrument, marketDepth); this.k7bROYTXtn.OnMarketDepth(instrument, marketDepth); }
public void Add(MarketDepth marketDepth) { try { OrderBookEntryList orderBookEntryList; switch (marketDepth.Side) { case MDSide.Bid: orderBookEntryList = this.bidList; break; case MDSide.Ask: orderBookEntryList = this.askList; break; default: throw new ArgumentException("Invalid Side" + marketDepth.Side); } switch (marketDepth.Operation) { case MDOperation.Insert: if (marketDepth.Position == -1) { int index = -1; switch (marketDepth.Side) { case MDSide.Bid: index = 0; while (index < orderBookEntryList.Count && marketDepth.Price <= orderBookEntryList[index].Price) { ++index; } break; case MDSide.Ask: index = orderBookEntryList.Count; while (index > 0 && marketDepth.Price <= orderBookEntryList[index - 1].Price) { --index; } break; } orderBookEntryList.Insert(index, new OrderBookEntry(marketDepth.DateTime, marketDepth.Price, marketDepth.Size)); this.EmitChanged(marketDepth.Side, marketDepth.Operation, index); break; } else { orderBookEntryList.Insert(marketDepth.Position, new OrderBookEntry(marketDepth.DateTime, marketDepth.Price, marketDepth.Size)); this.EmitChanged(marketDepth.Side, marketDepth.Operation, marketDepth.Position); break; } case MDOperation.Update: if (marketDepth.Position == -1 || marketDepth.Position >= orderBookEntryList.Count) { break; } OrderBookEntry orderBookEntry = orderBookEntryList[marketDepth.Position]; orderBookEntry.DateTime = marketDepth.DateTime; orderBookEntry.Size = marketDepth.Size; if (marketDepth.Price > 0.0) { orderBookEntry.Price = marketDepth.Price; } this.EmitChanged(marketDepth.Side, marketDepth.Operation, marketDepth.Position); break; case MDOperation.Delete: if (marketDepth.Position == -1) { break; } orderBookEntryList.RemoveAt(marketDepth.Position); this.EmitChanged(marketDepth.Side, marketDepth.Operation, marketDepth.Position); break; case MDOperation.Reset: orderBookEntryList.Clear(); this.EmitChanged(marketDepth.Side, marketDepth.Operation, marketDepth.Position); break; case MDOperation.Undefined: break; default: throw new ArgumentException("MDOperation is unknown: " + marketDepth.Operation.ToString()); } } catch (Exception ex) { Trace.WriteLine(ex.ToString()); } }
public object Convert(MarketDepth marketDepth) { return new OrderBookUpdate(marketDepth); }
protected override void OnNewMarketDepth(Instrument instrument, MarketDepth marketDepth) { this.A6MpF2380O.OnMarketDepth(instrument, marketDepth); this.HeHpDewVKD.OnMarketDepth(instrument, marketDepth); this.marketManager.OnMarketDepth(instrument, marketDepth); this.exits[instrument].OnMarketDepth(marketDepth); this.entries[instrument].OnMarketDepth(marketDepth); this.moneyManagers[instrument].OnMarketDepth(marketDepth); this.riskManagers[instrument].OnMarketDepth(marketDepth); }
public virtual void OnMarketDepth(MarketDepth marketDepth) { }
public virtual void OnMarketDepth(Instrument instrument, MarketDepth marketDepth) { }
protected override void OnNewMarketDepth(Instrument instrument, MarketDepth marketDepth) { this.marketManager.OnMarketDepth(instrument, marketDepth); this.klBiFcxZsD.OnMarketDepth(instrument, marketDepth); this.csNiLdTRqH[instrument].OnMarketDepth(marketDepth); }
private void HiaeqOcUjh(IFIXInstrument instrument, MarketDepth md) { if (this.NewMarketDepth != null) { this.NewMarketDepth(this, new MarketDepthEventArgs(md, instrument, this)); } }
protected virtual void OnNewMarketDepth(Instrument instrument, MarketDepth marketDepth) { }
internal OrderBookUpdate(MarketDepth marketDepth) { this.marketDepth = marketDepth; }
public static void Add(string series, MarketDepth marketDepth) { DataManager.server.Add(series, marketDepth); }
public MarketDepthEventArgs(MarketDepth marketDepth, IFIXInstrument instrument, IMarketDataProvider provider) : base(instrument, provider) { this.MarketDepth = marketDepth; }
public static void Add(Instrument instrument, MarketDepth marketDepth) { DataManager.Add(instrument, SUFFIX_MARKET_DEPTH, marketDepth); }
public void EmitMarketDepth(Instrument instrument, DateTime time, BidAsk side, OrderBookAction action, double price, int size, int position) { MarketDepth marketDepth = new MarketDepth(time, string.Empty, position, EnumConverter.Convert(action), EnumConverter.Convert(side), price, size); if (this.NewMarketDepth == null) return; this.NewMarketDepth((object) this, new MarketDepthEventArgs(marketDepth, (IFIXInstrument) instrument.instrument, (IMarketDataProvider) this)); }