本文整理匯總了C#中StockSharp.Algo.Candles.CandleSeries.WhenCandlesChanged方法的典型用法代碼示例。如果您正苦於以下問題:C# CandleSeries.WhenCandlesChanged方法的具體用法?C# CandleSeries.WhenCandlesChanged怎麽用?C# CandleSeries.WhenCandlesChanged使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類StockSharp.Algo.Candles.CandleSeries
的用法示例。
在下文中一共展示了CandleSeries.WhenCandlesChanged方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: OnStarted
protected override void OnStarted()
{
Logger.Info("Waiting for TraderConnected event.");
_connectorManager.TraderConnectedEvent.WaitOne();
Connector = _connectorManager.Trader;
Logger.Info("Waiting for PortfolioFoundEvent event.");
PortfolioFoundEvent.WaitOne();
Portfolio = _portfolio;
Logger.Info("Waiting for SecurityFound event.");
SecurityFoundEvent.WaitOne();
Logger.Info("Configuring QStrategy.");
Security = _security;
Volume = _strategyConfiguration.Volume;
_ordersCheckTimer = new Timer(CheckOrdersElapsed, null, 0, _strategyConfiguration.OrdersCheckInterval.Milliseconds);
_series = new CandleSeries(typeof(TimeFrameCandle), _security, _strategyConfiguration.CandleTimeFrame)
{
From = CurrentTime - TimeSpan.FromTicks(_strategyConfiguration.CandleTimeFrame.Ticks * _strategyConfiguration.IndicatorLength)
};
_connectorManager.CandleManager.Start(_series);
Security
.WhenChanged(Connector)
.Do(ProcessSecurityChange)
.Apply(this);
_series
.WhenCandlesChanged()
.Do(ProcessCandle)
.Apply(this);
base.OnStarted();
}