本文整理汇总了C#中ISession.Start方法的典型用法代码示例。如果您正苦于以下问题:C# ISession.Start方法的具体用法?C# ISession.Start怎么用?C# ISession.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISession
的用法示例。
在下文中一共展示了ISession.Start方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoginCallback
private void LoginCallback(ISession session)
{
Console.WriteLine("My accountId is: " + session.AccountDetails.AccountId);
_session = session;
_session.MarketDataChanged += MarketDataUpdate;
_session.Subscribe(new OrderBookSubscriptionRequest(_instrumentId),
() => Console.WriteLine("Subscribed to " + ("instrument: " + _instrumentId)),
FailureCallback("subscribe to order book " + _instrumentId));
_session.Start();
}
示例2: OnLoginSuccess
private void OnLoginSuccess(ISession session)
{
Console.WriteLine("My accountId is: " + session.AccountDetails.AccountId);
_session = session;
_session.HeartbeatReceived += HeartbeatEvent;
session.Subscribe(new HeartbeatSubscriptionRequest(), () => Console.WriteLine("Subscribed to heartbeat"), FailureCallback("subscribe to heartbeats"));
Thread thread = new Thread(RunHeartbeatClient);
thread.IsBackground = true;
thread.Start();
session.Start();
}
示例3: OnLoginSuccess
private void OnLoginSuccess(ISession session)
{
Console.WriteLine("My accountId is: " + session.AccountDetails.AccountId);
_session = session;
_session.MarketDataChanged += MarketDataUpdate;
_session.EventStreamFailed += StreamFailure;
_session.EventStreamSessionDisconnected += SessionDisconnected;
InitialiseInstruments();
foreach (long instrumentId in _instrumentIds)
{
SubscribeToInstrument(instrumentId);
}
session.Start();
}
示例4: OnLoginSuccess
private void OnLoginSuccess(ISession session)
{
const long instructionId = 1;
const long instrumentId = 4001;
_session = session;
_session.HistoricMarketDataReceived += OnHistoricMarketData;
_session.Subscribe(new HistoricMarketDataSubscriptionRequest(),
() => Console.WriteLine("Successful subscription"),
failureResponse => Console.Error.WriteLine("Failed to subscribe: {0}", failureResponse));
_session.RequestHistoricMarketData(new AggregateHistoricMarketDataRequest(instructionId, instrumentId,
DateTime.Parse("2011-05-11"),
DateTime.Parse("2011-06-13"),
Resolution.Day, Format.Csv,
Option.Bid),
() => Console.WriteLine("Successful request"),
failureResponse =>
Console.Error.WriteLine("Failed request: {0}", failureResponse));
_session.Start();
}
示例5: LoginCallback
private void LoginCallback(ISession session)
{
Console.WriteLine("My accountId is: " + session.AccountDetails.AccountId);
// Hold onto the session for later use.
_session = session;
// Add listeners for events.
_session.OrderChanged += OrderEventListener;
_session.InstructionRejected += FailOnInstructionRejected;
_session.MarketDataChanged += MarketDataUpdate;
// Subscribe to my order events.
_session.Subscribe(new OrderSubscriptionRequest(), SubscribeCallback("orders"),
FailureCallback("subscribe to orders"));
// Subscribe to the order book that I'm interested in.
_session.Subscribe(new OrderBookSubscriptionRequest(_instrumentId),
SubscribeCallback("instrument: " + _instrumentId),
FailureCallback("subscribe to order book " + _instrumentId));
// Start the event processing loop, this method will block until the session is stopped.
session.Start();
}