Цитата: public void Test()
{
CandleManager candleManager = new CandleManager(trader);
// 5 minute candles
CandleSeries series = new CandleSeries(typeof(TimeFrameCandle), security, TimeSpan.FromMinutes(5));
series.ProcessCandle += series_ProcessCandle;
candleManager.Processing += candleManager_Processing;
candleManager.Start(series);
}
void series_ProcessCandle(Candle obj)
{
Logger.WriteLine("Process candle");
}
void candleManager_Processing(CandleSeries arg1, Candle arg2)
{
Logger.WriteLine("Received Processing event");
}
Цитата:Unhandled Exception: System.InvalidCastException: Unable to cast object of type 'System.TimeSpan' to type 'StockSharp.AlfaDirect.AlfaTimeFrames'.
at StockSharp.AlfaDirect.AlfaTrader.#=qjbXuGHh73XvrWZicy6gOKXr2Dom0efIFR9MSjpJMLe0=(SynchronizedDictionary`2 #=qA5mbLCf6AEYY2ZjSKZfmqw==)
at Ecng.Collections.CollectionHelper.SyncDo[TCollection](TCollection collection, Action`1 action)
at StockSharp.AlfaDirect.AlfaTrader.#=qC5NNrqRcgxVSSeVdRzYPn46I7MwkMp1XS5d1hUpptZw=()
at Ecng.Common.ThreadingHelper.<>c__DisplayClass1.<Timer>b__0(Object s)
at System.Threading.TimerQueueTimer.CallCallbackInContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserv
eSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx
)
at System.Threading.TimerQueueTimer.CallCallback()
at System.Threading.TimerQueueTimer.Fire()
at System.Threading.TimerQueue.FireNextTimers()
at System.Threading.TimerQueue.AppDomainTimerCallback()