コード例 #1
0
ファイル: QuickFIX43Provider.cs プロジェクト: heber/FreeOQ
		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)));
			}
		}
コード例 #2
0
ファイル: QuickFIX42Application.cs プロジェクト: heber/FreeOQ
		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);
			}
		}
コード例 #3
0
		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);
		}
コード例 #4
0
ファイル: FQProvider.cs プロジェクト: heber/FreeOQ
 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);
     }
   }
 }