private static void DoFixRequest(IMarketDataProvider provider, Instrument instrument, MarketDataType type, char subCh, string suffix) { FIXMarketDataRequest request = new FIXMarketDataRequest(); request.MDReqID = DataManager.GetRequestId(); request.SubscriptionRequestType = subCh; switch (type) { case MarketDataType.Trade: request.AddGroup(new FIXMDEntryTypesGroup('2')); break; case MarketDataType.Quote: request.AddGroup(new FIXMDEntryTypesGroup('0')); request.AddGroup(new FIXMDEntryTypesGroup('1')); request.MarketDepth = 1; // Top of Book break; case MarketDataType.MarketDepth: request.AddGroup(new FIXMDEntryTypesGroup('0')); request.AddGroup(new FIXMDEntryTypesGroup('1')); request.MarketDepth = 0; // Full Book break; } if (!instrument.ContainsField(15)) instrument.Currency = Framework.Configuration.DefaultCurrency; FIXRelatedSymGroup symGrp = new FIXRelatedSymGroup(); request.AddGroup(symGrp); symGrp.Symbol = instrument.Symbol; symGrp.SecurityType = instrument.SecurityType; symGrp.SecurityExchange = instrument.SecurityExchange; symGrp.Currency = instrument.Currency; symGrp.SecurityID = instrument.SecurityID; symGrp.SecurityIDSource = instrument.SecurityIDSource; symGrp.MaturityDate = instrument.MaturityDate; symGrp.MaturityMonthYear = instrument.MaturityMonthYear; symGrp.StrikePrice = instrument.StrikePrice; symGrp.PutOrCall = ((FIXInstrument)instrument).PutOrCall; foreach (FIXSecurityAltIDGroup group2 in instrument.SecurityAltIDGroup) symGrp.AddGroup(group2); symGrp.SetStringValue(10001, suffix); if (provider == ProviderManager.MarketDataSimulator) { provider.SendMarketDataRequest(request); } else { switch (subCh) { case MARKET_DATA_SUBSCRIBE: bool flag1 = false; lock (DataManager.providers) { Hashtable local_4 = DataManager.providers[provider] as Hashtable; if (local_4 == null) { local_4 = new Hashtable(); DataManager.providers.Add(provider, local_4); } Hashtable local_5 = local_4[instrument] as Hashtable; if (local_5 == null) { local_5 = new Hashtable(); local_4.Add(instrument, local_5); } RequestItem local_6 = local_5[type] as RequestItem; if (local_6 == null) { local_6 = new RequestItem(request); local_5.Add(type, local_6); flag1 = true; } RequestItem temp_91 = local_6; int temp_94 = temp_91.GetRequestId() + 1; temp_91.SetRequestId(temp_94); } if (!flag1) break; provider.SendMarketDataRequest(request); break; case MARKET_DATA_UNSUBSCRIBE: bool canSend = false; string msg = null; lock (DataManager.providers) { Hashtable local_10 = DataManager.providers[provider] as Hashtable; if (local_10 != null) { Hashtable local_11 = local_10[instrument] as Hashtable; if (local_11 != null) { RequestItem local_12 = local_11[type] as RequestItem; if (local_12 != null) { RequestItem temp_152 = local_12; int temp_155 = temp_152.GetRequestId() - 1; temp_152.SetRequestId(temp_155); if (local_12.GetRequestId() == 0) { local_11.Remove(type); if (local_11.Count == 0) { local_10.Remove(instrument); if (local_10.Count == 0) DataManager.providers.Remove(provider); } canSend = true; } } else msg = "No this RequestItem"; } else msg = "No Request for this instrument"; } else msg = "No Request for this provider"; } if (msg != null) DataManager.LogRequestMessage(provider, instrument, type, msg); if (!canSend) break; provider.SendMarketDataRequest(request); break; } } }
public virtual void Send(FIXMarketDataRequest request) { }
public override void SendMarketDataRequest(FIXMarketDataRequest request) { if (this.IsConnected) this.application.Send(request); else this.EmitError(nvcneRd3YWS84l4984.Ey6KSwFglw(804)); }
public FIXMarketDataRequestEventArgs(FIXMarketDataRequest marketDataRequest) { this.MarketDataRequest = marketDataRequest; }
public void SendMarketDataRequest(FIXMarketDataRequest request) { bool flag = (int)request.SubscriptionRequestType == 49; for (int i = 0; i < request.NoRelatedSym; ++i) this.V6Aetvk5jr(InstrumentManager.Instruments[request.GetRelatedSymGroup(i).Symbol], request.GetRelatedSymGroup(i).GetStringValue(10001), flag); }
public virtual void SendMarketDataRequest(FIXMarketDataRequest request) { if (this.IsConnected) { switch (request.SubscriptionRequestType) { case '1': string str1 = this.agD49enOqk(request.GetRelatedSymGroup(0)); RequestRecord requestRecord1; if (str1 == null) { ++this.mdReqCount; string str2 = string.Format(BeAEwTZGlZaeOmY5cm.J00weU3cM6(3836), (object)Clock.Now, (object)this.mdReqCount); request.MDReqID = str2; requestRecord1 = new RequestRecord(request.GetRelatedSymGroup(0).Symbol, request); this.mdRequests.Add((object)str2, (object)requestRecord1); this.application.Send(request); } else requestRecord1 = this.mdRequests[(object)str1] as RequestRecord; ++requestRecord1.RequestCount; break; case '2': string str3 = this.agD49enOqk(request.GetRelatedSymGroup(0)); if (str3 == null) break; RequestRecord requestRecord2 = this.mdRequests[(object)str3] as RequestRecord; --requestRecord2.RequestCount; if (requestRecord2.RequestCount != 0) break; request.MDReqID = str3; this.application.Send(request); this.mdRequests.Remove((object)str3); break; } } else { if (this.j4t4Wyi2Ea == null) return; this.j4t4Wyi2Ea(new ProviderErrorEventArgs((IProvider)this, -1, -1, BeAEwTZGlZaeOmY5cm.J00weU3cM6(3894))); } }
internal RequestItem(FIXMarketDataRequest request) { this.request = request; this.id = 0; }
public virtual void Send(FIXMarketDataRequest Request) { Console.WriteLine(BeAEwTZGlZaeOmY5cm.J00weU3cM6(992)); MarketDataRequest marketDataRequest = new MarketDataRequest(new MDReqID(Request.MDReqID), new SubscriptionRequestType(Request.SubscriptionRequestType), new MarketDepth(Request.MarketDepth)); if (Request.ContainsField(265)) marketDataRequest.set(new MDUpdateType(Request.MDUpdateType)); MarketDataRequest.NoMDEntryTypes noMdEntryTypes = new MarketDataRequest.NoMDEntryTypes(); for (int i = 0; i < Request.NoMDEntryTypes; ++i) { noMdEntryTypes.set(new MDEntryType(Request.GetMDEntryTypesGroup(i).MDEntryType)); marketDataRequest.addGroup((Group)noMdEntryTypes); } noMdEntryTypes.Dispose(); MarketDataRequest.NoRelatedSym noRelatedSym = new MarketDataRequest.NoRelatedSym(); for (int i = 0; i < Request.NoRelatedSym; ++i) { FIXRelatedSymGroup relatedSymGroup = Request.GetRelatedSymGroup(i); noRelatedSym.set(new Symbol(relatedSymGroup.Symbol)); if (relatedSymGroup.ContainsField(65)) noRelatedSym.set(new SymbolSfx(relatedSymGroup.SymbolSfx)); if (relatedSymGroup.ContainsField(48)) noRelatedSym.set(new SecurityID(relatedSymGroup.SecurityID)); if (relatedSymGroup.ContainsField(22)) noRelatedSym.set(new IDSource(relatedSymGroup.SecurityIDSource)); if (relatedSymGroup.ContainsField(167)) noRelatedSym.set(new QuickFix.SecurityType(relatedSymGroup.SecurityType)); if (relatedSymGroup.ContainsField(200)) noRelatedSym.set(new MaturityMonthYear(relatedSymGroup.MaturityMonthYear)); if (relatedSymGroup.ContainsField(202)) noRelatedSym.set(new StrikePrice(relatedSymGroup.StrikePrice)); if (relatedSymGroup.ContainsField(206)) noRelatedSym.set(new OptAttribute(relatedSymGroup.OptAttribute)); if (relatedSymGroup.ContainsField(231)) noRelatedSym.set(new ContractMultiplier(relatedSymGroup.ContractMultiplier)); if (relatedSymGroup.ContainsField(223)) noRelatedSym.set(new CouponRate(relatedSymGroup.CouponRate)); if (relatedSymGroup.ContainsField(207)) noRelatedSym.set(new SecurityExchange(relatedSymGroup.SecurityExchange)); if (relatedSymGroup.ContainsField(106)) noRelatedSym.set(new Issuer(relatedSymGroup.Issuer)); if (relatedSymGroup.ContainsField(348)) noRelatedSym.set(new EncodedIssuerLen(relatedSymGroup.EncodedIssuerLen)); if (relatedSymGroup.ContainsField(349)) noRelatedSym.set(new EncodedIssuer(relatedSymGroup.EncodedIssuer)); if (relatedSymGroup.ContainsField(107)) noRelatedSym.set(new SecurityDesc(relatedSymGroup.SecurityDesc)); if (relatedSymGroup.ContainsField(350)) noRelatedSym.set(new EncodedSecurityDescLen(relatedSymGroup.EncodedSecurityDescLen)); if (relatedSymGroup.ContainsField(351)) noRelatedSym.set(new EncodedSecurityDesc(relatedSymGroup.EncodedSecurityDesc)); marketDataRequest.addGroup((Group)noRelatedSym); } noRelatedSym.Dispose(); try { Session.sendToTarget((QuickFix.Message)marketDataRequest, this.fSessionID); } catch (Exception ex) { Console.WriteLine(BeAEwTZGlZaeOmY5cm.J00weU3cM6(1096) + ex.Message); } }
public RequestRecord(string symbol, FIXMarketDataRequest request) { this.Symbol = symbol; this.Request = request; this.RequestCount = 0; }
public void SendMarketDataRequest(FIXMarketDataRequest request) { SubscriptionDataType subscriptionDataType = (SubscriptionDataType) 0; for (int i = 0; i < request.NoMDEntryTypes; ++i) { switch (request.GetMDEntryTypesGroup(i).MDEntryType) { case '0': case '1': if (request.MarketDepth == 1) { subscriptionDataType |= SubscriptionDataType.Quotes; break; } else { subscriptionDataType |= SubscriptionDataType.OrderBook; break; } case '2': subscriptionDataType |= SubscriptionDataType.Trades; break; } } for (int i = 0; i < request.NoRelatedSym; ++i) { FreeQuant.Instruments.Instrument instrument1 = FreeQuant.Instruments.InstrumentManager.Instruments[request.GetRelatedSymGroup(i).Symbol]; Instrument instrument2 = Map.FQ_OQ_Instrument[(object) instrument1] as Instrument; switch (request.SubscriptionRequestType) { case '1': this.provider.CallSubscribe(instrument2, subscriptionDataType); break; case '2': this.provider.CallUnsubscribe(instrument2, subscriptionDataType); break; default: throw new Exception("Unknown subscription request type " + (object) request.SubscriptionRequestType); } } }
public FIXMarketDataRequestEventArgs(FIXMarketDataRequest marketDataRequest) { this.MarketDataRequest = marketDataRequest; }