Skip to content

Commit d23f04f

Browse files
committed
Doc. Backtesting/Emulation Historical data. Remove CandleManager
1 parent 3a65866 commit d23f04f

File tree

2 files changed

+8
-41
lines changed

2 files changed

+8
-41
lines changed

Documentation/en/Topics/StrategyTestingHistory.aml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,8 @@ connector.NewSecurity += s =>
342342
343343
// start strategy before emulation started
344344
strategy.Start();
345-
candleManager.Start(series);
345+
_series = new CandleSeries(typeof(TimeFrameCandle), security, timeFrame);
346+
connector.SubscribeCandles(series);
346347
347348
// start historical data loading when connection established successfully and all data subscribed
348349
connector.Start();
@@ -366,31 +367,14 @@ connector.Connect();
366367
</para>
367368
</content>
368369
</step>
369-
370-
<step>
371-
<content>
372-
<para>
373-
Creation of the <codeEntityReference>T:StockSharp.Algo.Candles.CandleManager</codeEntityReference> (required for the moving average strategy),
374-
in which the <codeEntityReference>T:StockSharp.Algo.Testing.HistoryEmulationConnector</codeEntityReference> is specified as the source:
375-
</para>
376-
<code language="C#"><![CDATA[
377-
var candleManager = new CandleManager((Connector)connector);
378-
var series = new CandleSeries(typeof(TimeFrameCandle), security, timeFrame)
379-
{
380-
BuildCandlesMode = emulationInfo.UseCandleTimeFrame == null ? BuildCandlesModes.Build : BuildCandlesModes.Load
381-
};
382-
]]></code>
383-
384-
</content>
385-
</step>
386370
<step>
387371
<content>
388372
<para>
389373
Creation of the <token>ma</token> strategy itself:
390374
</para>
391375
<code language="C#"><![CDATA[
392376
// create strategy based on 80 5-min and 10 5-min
393-
var strategy = new SmaStrategy(chart, _candlesElem, _tradesElem, _shortMa, _shortElem, _longMa, _longElem, candleManager, series)
377+
var strategy = new SmaStrategy(chart, _candlesElem, _tradesElem, _shortMa, _shortElem, _longMa, _longElem, _series)
394378
{
395379
Volume = 1,
396380
Portfolio = portfolio,

Documentation/ru/Topics/StrategyTestingHistory.aml

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,9 @@ connector.NewSecurity += s =>
369369
370370
// start strategy before emulation started
371371
strategy.Start();
372-
candleManager.Start(series);
373-
372+
_series = new CandleSeries(typeof(TimeFrameCandle), security, timeFrame);
373+
connector.SubscribeCandles(series);
374+
374375
// start historical data loading when connection established successfully and all data subscribed
375376
connector.Start();
376377
};
@@ -394,33 +395,15 @@ trader.Connect();
394395
</para>
395396
</content>
396397
</step>
397-
398-
<step>
399-
<content>
400-
<para>
401-
Создание менеджера свечей <codeEntityReference>T:StockSharp.Algo.Candles.CandleManager</codeEntityReference> (необходимо для
402-
стратегии скользящих средних), в котором в качестве источника указан шлюз
403-
<codeEntityReference>T:StockSharp.Algo.Testing.HistoryEmulationConnector</codeEntityReference>:
404-
</para>
405-
<code language="C#"><![CDATA[
406-
var candleManager = emulationInfo.UseCandleTimeFrame == null
407-
? new CandleManager(new TradeCandleBuilderSourceEx(connector))
408-
: new CandleManager(connector);
409-
410-
var series = new CandleSeries(typeof(TimeFrameCandle), security, timeFrame);
411-
412-
]]></code>
413-
414-
</content>
415-
</step>
398+
416399
<step>
417400
<content>
418401
<para>
419402
Создание самой стратегии <token>ma</token>:
420403
</para>
421404
<code language="C#"><![CDATA[
422405
// создаем торговую стратегию, скользящие средние на 80 5-минуток и 10 5-минуток
423-
var strategy = new SmaStrategy(chart, _candlesElem, _tradesElem, _shortMa, _shortElem, _longMa, _longElem, candleManager, series)
406+
var strategy = new SmaStrategy(chart, _candlesElem, _tradesElem, _shortMa, _shortElem, _longMa, _longElem, _series)
424407
{
425408
Volume = 1,
426409
Portfolio = portfolio,

0 commit comments

Comments
 (0)