本文整理汇总了C#中Price.getValue方法的典型用法代码示例。如果您正苦于以下问题:C# Price.getValue方法的具体用法?C# Price.getValue怎么用?C# Price.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Price
的用法示例。
在下文中一共展示了Price.getValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: fromApp
public void fromApp(QuickFix.Message message, SessionID sessionID)
{
// receiving messages
Symbol sym = new Symbol();
message.getField(sym);
Tick k = new TickImpl(sym.getValue());
{
// bid
BidPx bp = new BidPx();
BidSize bs = new BidSize();
k.bid = (decimal)bp.getValue();
k.bs = (int)message.getField(bs).getValue();
}
{
// ask
OfferPx op = new OfferPx();
OfferSize os = new OfferSize();
k.ask = (decimal)op.getValue();
k.os = (int)message.getField(os).getValue();
}
{
// last
Price price = new Price();
message.getField(price);
k.trade = (decimal)price.getValue();
}
tl.newTick(k);
//ClOrdID clOrdID = new ClOrdID();
//message.getField(clOrdID);
}
示例2: onMessage
public override void onMessage( QuickFix40.NewOrderSingle order, SessionID sessionID )
{
Symbol symbol = new Symbol();
Side side = new Side();
OrdType ordType = new OrdType();
OrderQty orderQty = new OrderQty();
Price price = new Price();
ClOrdID clOrdID = new ClOrdID();
order.get( ordType );
if ( ordType.getValue() != OrdType.LIMIT )
throw new IncorrectTagValue( ordType.getField() );
order.get( symbol );
order.get( side );
order.get( orderQty );
order.get( price );
order.get( clOrdID );
QuickFix40.ExecutionReport executionReport = new QuickFix40.ExecutionReport
( genOrderID(),
genExecID(),
new ExecTransType( ExecTransType.NEW ),
new OrdStatus ( OrdStatus.FILLED ),
symbol,
side,
orderQty,
new LastShares ( orderQty.getValue() ),
new LastPx ( price.getValue() ),
new CumQty ( orderQty.getValue() ),
new AvgPx ( price.getValue() ) );
executionReport.set( clOrdID );
if( order.isSetAccount() )
executionReport.set( order.getAccount() );
try
{
Session.sendToTarget( executionReport, sessionID );
}
catch ( SessionNotFound ) {}
}