示例#1
0
		// funkcja pomocnicza przygotowująca typ zlecenia FIXML
		private static OrderType Order_GetType(OrderMainData data)
		{
			switch (data.PriceType)
			{
				case PriceType.Limit: return (data.ActivationPrice != null) ? OrderType.StopLimit : OrderType.Limit;
				case PriceType.PKC: return (data.ActivationPrice != null) ? OrderType.StopLoss : OrderType.PKC;
				default: return OrderType.PCR_PCRO;
			}
		}
示例#2
0
		// funkcja pomocnicza przygotowująca parametr FIXML TimeInForce 
		private static OrdTimeInForce Order_GetTimeInForce(OrderMainData data)
		{
			if (data.ImmediateOrCancel) return OrdTimeInForce.WiA;
			if (data.MinimumQuantity == data.Quantity) return OrdTimeInForce.WuA;
			if (data.PriceType == PriceType.PCRO)
				return (DateTime.Now.Hour < 12) ? OrdTimeInForce.Opening : OrdTimeInForce.Closing;
			if (data.ExpirationDate != null) return OrdTimeInForce.Date;
			return OrdTimeInForce.Day;
		}
示例#3
0
		// aktualizacja danych z sieci - podstawowe dane zlecenia
		private void Update(OrderMainData data)
		{
			CreateTime = data.CreateTime;
			Instrument = BosInstrument.Create(data.Instrument);
			Side = data.Side;
			Price = BosPrice.Create(data.PriceType, data.PriceLimit);
			ActivationPrice = data.ActivationPrice;
			Quantity = data.Quantity;
			MinimumQuantity = data.MinimumQuantity;
			VisibleQuantity = data.VisibleQuantity;
			ImmediateOrCancel = data.ImmediateOrCancel;
			ExpirationDate = data.ExpirationDate;
		}