本文整理匯總了C#中QuickFix.Fields.ClOrdID類的典型用法代碼示例。如果您正苦於以下問題:C# ClOrdID類的具體用法?C# ClOrdID怎麽用?C# ClOrdID使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ClOrdID類屬於QuickFix.Fields命名空間,在下文中一共展示了ClOrdID類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CheckIsInGroupTest
public void CheckIsInGroupTest()
{
QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary("../../../spec/fix/FIX44.xml");
QuickFix.DataDictionary.DDGrp g = dd.Messages["B"].GetGroup(33);
QuickFix.Fields.Text textField = new QuickFix.Fields.Text("woot");
QuickFix.Fields.ClOrdID clOrdIdField = new QuickFix.Fields.ClOrdID("not woot");
Assert.DoesNotThrow(delegate() { dd.CheckIsInGroup(textField, g, "B"); });
Assert.Throws(typeof(TagNotDefinedForMessage), delegate { dd.CheckIsInGroup(clOrdIdField, g, "B"); });
}
示例2: 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())
};
}
示例3: Set
public void Set(QuickFix.Fields.ClOrdID val)
{
this.ClOrdID = val;
}
示例4: CreateNewOrderSingleMessage
public Message CreateNewOrderSingleMessage(string symbol,
MarketSide marketSide,
string clOrdID,
TradingAccount account,
decimal price,
decimal quantity,
OrderType orderType,
string execID)
{
var fOrdType = TranslateFixFields.Translate(orderType);
var fSide = TranslateFixFields.Translate(marketSide);
var fSymbol = new Symbol(symbol);
var fTransactTime = new TransactTime(DateTime.Now);
var fClOrdID = new ClOrdID(clOrdID);
var nos = new NewOrderSingle(fClOrdID,
fSymbol,
fSide,
fTransactTime,
fOrdType)
{
OrderQty = new OrderQty(quantity),
TimeInForce = new TimeInForce(TimeInForce.GOOD_TILL_CANCEL)
};
if (orderType == OrderType.Limit)
nos.Price = new Price(price);
return nos;
}
示例5: 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;
}