// wywoływane przez NolClient po otrzymaniu komunikatu 'TrdgSesStat'
		void HandleSessionStatusMsgEvent(TradingSessionStatusMsg msg)
		{
			var symbol = msg.Instrument != null ? msg.Instrument.Symbol : null;
			Trace.WriteLine(string.Format("{0,-10} {1}", symbol, msg.SessionPhase));
		}
예제 #2
0
		/// <summary>
		/// Deaktywacja odbioru informacji o statusie sesji.
		/// </summary>
		public void TradingSessionStatusStop()
		{
			if (!statusOn) return;
			Debug.WriteLine("\nTradingSessionStatusStop...");
			using (Socket socket = GetSyncSocket())
			{
				TrdSesStatusRequestMsg request = new TrdSesStatusRequestMsg();
				request.Type = SubscriptionRequestType.CancelSubscription;
				request.Send(socket);
				TradingSessionStatusMsg response = new TradingSessionStatusMsg(socket);
				if (response.RequestId != request.Id)
					throw new FixmlException("Unexpected TrdgSesStat ReqID.");
				// mamy taki status - ale czy to tego requesta dotyczy, to ja tylko zgadywać mogę... :/
				if (response.SessionStatus == TradingSessionStatus.RequestRejected)
					throw new FixmlException("TrdgSesStat rejected, reason = " + response.RejectReason);
			}
			Debug.WriteLine("TradingSessionStatusStop OK\n");
			statusOn = false;
		}