本文整理匯總了C#中QuickFix.Fields.Side類的典型用法代碼示例。如果您正苦於以下問題:C# Side類的具體用法?C# Side怎麽用?C# Side使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Side類屬於QuickFix.Fields命名空間,在下文中一共展示了Side類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: TranslateOrderImpl
private static OrderData TranslateOrderImpl(Symbol symbol,
Side side,
OrdType ordType,
OrderQty orderQty,
Price price,
ClOrdID clOrdID,
Account account)
{
switch (ordType.getValue())
{
case OrdType.LIMIT:
if (price.Obj == 0)
throw new IncorrectTagValue(price.Tag);
break;
//case OrdType.MARKET: break;
default:
throw new IncorrectTagValue(ordType.Tag);
}
return new OrderData
{
MarketSide = TranslateFixFields.Translate(side),
Symbol = symbol.getValue(),
OrderType = TranslateFixFields.Translate(ordType),
Quantity = orderQty.getValue(),
Price = price.getValue(),
ClOrdID = clOrdID.getValue(),
Account =
account == null
? TradingAccount.None
: new TradingAccount(account.getValue())
};
}
示例2: Set
public void Set(QuickFix.Fields.Side val)
{
this.Side = val;
}
示例3: CreateOrders
private Queue<QuickFix.FIX42.NewOrderSingle> CreateOrders(int n)
{
Queue<QuickFix.FIX42.NewOrderSingle> orders = new Queue<QuickFix.FIX42.NewOrderSingle>(n);
for (int i = 0; i < n; i++) {
ClOrdID cloudOrderId = new ClOrdID(Guid.NewGuid().ToString());
HandlInst handlInst = new HandlInst(HandlInst.AUTOMATED_EXECUTION_ORDER_PRIVATE_NO_BROKER_INTERVENTION);
Symbol symbol = new Symbol("MSFT");
Side side = new Side(Side.BUY);
TransactTime time = new TransactTime();
OrdType orderType = new OrdType(OrdType.LIMIT);
QuickFix.FIX42.NewOrderSingle order = new QuickFix.FIX42.NewOrderSingle(cloudOrderId, handlInst, symbol, side, time, orderType);
order.Account = new Account("Account");
order.OrderQty = new OrderQty(100);
order.ExDestination = new ExDestination("*");
order.TimeInForce = new TimeInForce(TimeInForce.DAY);
order.Price = new Price(50m);
order.SecurityType = new SecurityType(SecurityType.COMMON_STOCK);
orders.Enqueue(order);
}
return orders;
}