예제 #1
0
			public static string OptionOrder(string accountNumber, SideOfOrder_t side, string underlying, Cfi_t cfi,
			                                     PositionEffect_t positionEffect, DateTime expireDate, double strike, int contracts,
			                                     TimeInForce_t time, OrderType_t type, double limitPrice) {
				StringBuilder fixml = new StringBuilder(HEADER);
				// TODO: Support Buy To Cover
				fixml.AppendFormat(@"<Order TmInForce=""{0}"" Typ=""{1}"" Side=""{2}"" Px=""{3}"" PosEfct=""{4}"" Acct=""{5}"">",
				                   time.GetHashCode(), type.GetHashCode(), side.GetHashCode(), limitPrice, positionEffect.GetHashCode(), accountNumber);
				fixml.AppendFormat(@"<Instrmt CFI=""{0}"" SecTyp=""{1}"" MatDt=""{2:yyyy-MM-dd}T00:00:00.000-05:00"" StrkPx=""{3}"" Sym=""{4}""/>",
				                   cfi.ToString(), SecurityType_t.OPT.ToString(), expireDate, strike, underlying);
				fixml.AppendFormat(@"<OrdQty Qty=""{0}""/>", contracts);
				fixml.AppendFormat(@"</Order>");
				fixml.AppendFormat(FOOTER);
				
				return fixml.ToString();		
			}
예제 #2
0
			public static string StockOrder(string accountNumber, SideOfOrder_t side, string symbol, int shares, 
			                                   TimeInForce_t time, OrderType_t type, double limitPrice) {
				StringBuilder fixml = new StringBuilder(HEADER);
				
				// TODO: Support Buy To Cover
				fixml.AppendFormat(@"<Order TmInForce=""{0}"" Typ=""{1}"" Side=""{2}"" Px=""{3}"" Acct=""{4}"">",
				                   time.GetHashCode(), type.GetHashCode(), side.GetHashCode(), limitPrice, accountNumber);
				fixml.AppendFormat(@"<Instrmt SecTyp=""{0}"" Sym=""{1}""/>", SecurityType_t.CS.ToString(), symbol);
				fixml.AppendFormat(@"<OrdQty Qty=""{0}""/>", shares.ToString());
				fixml.AppendFormat(@"</Order>");
				fixml.AppendFormat(FOOTER);
				
				return fixml.ToString();
			}