Программный код:
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, Action1 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()
评论 (4)
登录 或 创建账户, 登录或注册以发表评论
Чтобы указать таймфрейм для альфы, необходимо использовать AlfaTimeFrames.
В этом случае выдается
к удивлению код:
Напишите мне в скайп, который в профиле.