本文整理匯總了C#中QuickFix.SessionID類的典型用法代碼示例。如果您正苦於以下問題:C# SessionID類的具體用法?C# SessionID怎麽用?C# SessionID使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SessionID類屬於QuickFix命名空間,在下文中一共展示了SessionID類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: OnMessage
private void OnMessage(QuickFix.FIX42.MarketDataRequest m, SessionID s)
{
QuickFix.FIX42.MarketDataRequest.NoRelatedSymGroup symbolGroup = new QuickFix.FIX42.MarketDataRequest.NoRelatedSymGroup();
m.GetGroup(1, symbolGroup);
string symbolName = symbolGroup.Get(new Symbol()).getValue();
string mdRequestId = m.MDReqID.ToString();
if (!m_ProductSubscription.ContainsKey(symbolName)) {
bool fullSpeed = symbolName.StartsWith("B");
Console.WriteLine("Subscribe : " + symbolName + ". Full Speed: " + fullSpeed);
QuotePublisher publisher = new QuotePublisher(symbolName, mdRequestId, fullSpeed, s);
m_ProductSubscription.Add(symbolName, publisher);
}
}
示例2: onLogon
public virtual void onLogon(SessionID sessionID)
{
Console.WriteLine("SessionID: " + sessionID);
if (this.IxROVD6JN == null)
return;
this.IxROVD6JN((object)this, new FIXSessionIDEventArgs(sessionID));
}
示例3: NewOrderSingle
internal static dynamic NewOrderSingle(SessionID sid)
{
if (sid == null)
{
return null;
}
string value = sid.getBeginString();
if (value.Equals("FIX.4.0"))
return new QuickFix40.NewOrderSingle();
if (value.Equals("FIX.4.1"))
return new QuickFix41.NewOrderSingle();
if (value.Equals("FIX.4.2"))
return new QuickFix42.NewOrderSingle();
if (value.Equals("FIX.4.3"))
return new QuickFix43.NewOrderSingle();
if (value.Equals("FIX.4.4"))
return new QuickFix44.NewOrderSingle();
if (value.Equals("FIX.5.0"))
return new QuickFix50.NewOrderSingle();
return null;
}
示例4: OrderCancelRequest
internal static dynamic OrderCancelRequest(SessionID sid)
{
if (sid == null)
{
return null;
}
string value = sid.getBeginString();
if (value.Equals("FIX.4.0"))
return new QuickFix40.OrderCancelRequest();
if (value.Equals("FIX.4.1"))
return new QuickFix41.OrderCancelRequest();
if (value.Equals("FIX.4.2"))
return new QuickFix42.OrderCancelRequest();
if (value.Equals("FIX.4.3"))
return new QuickFix43.OrderCancelRequest();
if (value.Equals("FIX.4.4"))
return new QuickFix44.OrderCancelRequest();
if (value.Equals("FIX.5.0"))
return new QuickFix50.OrderCancelRequest();
return null;
}
示例5: 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);
}
示例6: onLogout
public virtual void onLogout(SessionID sessionID)
{
Console.WriteLine("SessionID: " + sessionID);
if (this.N4PQenDmP == null)
return;
this.N4PQenDmP(this, new FIXSessionIDEventArgs(sessionID));
}
示例7: OnLogon
public void OnLogon( SessionID sessionID)
{
Session session = Session.LookupSession(sessionID);
Message message = null;
//行情訂閱
message = OKMarketDataRequest.create24HTickerRequest();
//深度訂閱
//message = OKMarketDataRequest.createOrderBookRequest();
//用戶信息請求
//message = OKTradingRequest.createUserAccountRequest();
//創建訂單
// try{
// message = OKTradingRequest.createOrderBookRequest();
// } catch (Exception e) {
// Console.WriteLine(e.Message);
// }
//取消訂單請求
// message = OKTradingRequest.createOrderCancelRequest();
//訂單狀態請求
// message = OKTradingRequest.createOrderStatusRequest();
session.Send(message);
}
示例8: onLogon
public virtual void onLogon(SessionID sessionID)
{
Console.WriteLine("SessionID: " + sessionID);
if (this.lCISky2Q1 == null)
return;
this.lCISky2Q1(this, new FIXSessionIDEventArgs(sessionID));
}
示例9: SendNewOrderSingle
public void SendNewOrderSingle(string symbol, int quantity, decimal? price, decimal? stop, decimal? gain, string account, SessionID session)
{
clOrdId = DateTime.Now.Ticks.ToString();
lastSymbol = symbol;
lastAccount = account;
var newOrderSingle = new NewOrderSingle(new ClOrdID(clOrdId),
new Symbol(symbol),
new Side(Side.BUY),
new TransactTime(DateTime.Now),
new OrdType(gain.HasValue ? 'X' : stop.HasValue ? OrdType.STOP : price.HasValue ? OrdType.LIMIT : OrdType.MARKET))
{
Account = new Account(account),
OrderQty = new OrderQty(quantity),
TargetStrategy = new TargetStrategy(TargetStrategy),
TimeInForce = new TimeInForce(TIF),
};
if (TIF == TimeInForce.GOOD_TILL_DATE)
newOrderSingle.ExpireDate = new ExpireDate(DateTime.Today.AddDays(1).AsLocalMktDate());
if (stop.HasValue)
newOrderSingle.StopPx = new StopPx(stop.Value);
if (price.HasValue)
newOrderSingle.Price = new Price(price.Value);
if (gain.HasValue)
newOrderSingle.SetField(new DecimalField(6001, gain.Value));
Session.SendToTarget(newOrderSingle, session);
}
示例10: onLogout
public virtual void onLogout(SessionID sessionID)
{
Console.WriteLine("SessionID: " + sessionID);
if (this.Br2Z76TG6 == null)
return;
this.Br2Z76TG6((object)this, new FIXSessionIDEventArgs(sessionID));
}
示例11: onLogout
public override void onLogout(SessionID sessionID)
{
bool flag1;
if (this.priceSessionID == null)
{
flag1 = true;
}
else
{
Session session = Session.lookupSession(this.priceSessionID);
flag1 = session != null && !session.isLoggedOn();
}
bool flag2;
if (this.orderSessionID == null)
{
flag2 = true;
}
else
{
Session session = Session.lookupSession(this.orderSessionID);
flag2 = session != null && !session.isLoggedOn();
}
if (!flag1 || !flag2)
return;
this.EmitLogout((SessionID)null);
}
示例12: FileStore
public FileStore(string path, SessionID sessionID)
{
//BEGIN - Custom part
//search for special directory (ie: %appdata%)
if (path.StartsWith("%"))
{
int end = path.IndexOf("%", 1);
string specialFolderName = path.Substring(1, end - 1);
Environment.SpecialFolder specialFolder = (Environment.SpecialFolder)Enum.Parse(typeof(Environment.SpecialFolder), specialFolderName, true);
string specialPath = Environment.GetFolderPath(specialFolder);
path = Path.Combine(specialPath, path.Substring(end + 2));
}
//END - Custom part
if (!System.IO.Directory.Exists(path))
System.IO.Directory.CreateDirectory(path);
string prefix = Prefix(sessionID);
seqNumsFileName_ = System.IO.Path.Combine(path, prefix + ".seqnums");
msgFileName_ = System.IO.Path.Combine(path, prefix + ".body");
headerFileName_ = System.IO.Path.Combine(path, prefix + ".header");
sessionFileName_ = System.IO.Path.Combine(path, prefix + ".session");
open();
}
示例13: OnCreate
public void OnCreate(SessionID sessionID)
{
Session session = Session.LookupSession(sessionID);
// Hey QF/J users, don't do this in a real app.
if (null != session)
session.Reset("AT Session Reset");
}
示例14: onLogon
public void onLogon(SessionID sessionID)
{
Console.WriteLine("onLogon " + sessionID);
String exchange = "CME";
String symbol = "CL";
RequestSymbols(exchange, symbol, sessionID);
}
示例15: ToAdmin
public void ToAdmin(Message message, SessionID sessionID)
{
if (message.Header.GetField(Tags.MsgType) == MsgType.LOGON)
{
message.SetField(new QuickFix.Fields.Username("batman"));
message.SetField(new QuickFix.Fields.Password("gotham123"));
}
}