Целую неделю работал тестировщиком. [confused]
Если подписаться на изменение стакана то регистрация заявок не проходит. Коннектор - HistoryEmulationConnector.
Код:
Код class TestStrategy : Strategy
{
public CandleSeries CandleSeries { get; set; }
protected override void OnStarted()
{
Connector.WhenCandlesFinished(CandleSeries).Do(CandleManager_Processing).Apply(this);
Security.WhenMarketDepthChanged(Connector).Do((d) => {}).Apply(this);//закомментируте что бы регистрировать заявки
Connector.SubscribeMarketDepth(Security);
Connector.SubscribeCandles(CandleSeries);
base.OnStarted();
}
private void CandleManager_Processing(Candle candle)
{
if (_order == null)
{
_order = this.BuyAtMarket(1);
_order.WhenRegistered(Connector).Do((o) =>
{
this.AddInfoLog("Order №1 Registered"); //не сработает если подписаться на событие изменения стакана
}).Apply(this);
RegisterOrder(_order);
}
}
private Order _order;
}
Лог:
2020/09/17 17:15:42.468| |HistoryEmulationConnector|Инструмент подписывается на PortfolioLookup,T(L)=2020.09.17 17:15:42.469,Name=,TransId=1,IsSubscribe=True,Strategy=e0a7a49d-895c-4642-b329-73bfac99a7a3
2020/09/17 17:15:42.489| |HistoryEmulationConnector|Инструмент @ подписывается на OrderStatus,T(L)=2020.09.17 17:15:42.489,Sec=@,TransId=2,OrdType=,Pf=(ClCode=),Cond=,MR=,Strategy=e0a7a49d-895c-4642-b329-73bfac99a7a3,IsSubscribe=True
2020/09/17 17:15:46.567| |HistoryEmulationConnector|Connect
2020/09/17 17:15:46.623| |Basket |Connecting 'История (c 02.10.2017 0:00:00 +00:00 по 09.09.2020 0:00:00 +00:00)'.
2020/09/17 17:15:46.672| |Basket |Connected to 'История (c 02.10.2017 0:00:00 +00:00 по 09.09.2020 0:00:00 +00:00)'.
2020/09/17 17:15:46.706| |HistoryEmulationConnector|Инструмент @ подписывается на SecurityLookup,T(L)=2020.09.17 17:15:46.706,Sec=@,TransId=3,SecId=@,Name=,SecType=,ExpDate=
2020/09/17 17:15:46.711| |Basket |Send to История (c 02.10.2017 0:00:00 +00:00 по 09.09.2020 0:00:00 +00:00): SecurityLookup,T(L)=2020.09.17 17:15:46.706,Sec=@,TransId=4,SecId=@,Name=,SecType=,ExpDate=
2020/09/17 17:15:46.745| |HistoryEmulationConnector|Инструмент подписывается на TimeFrameLookup,T(L)=2020.09.17 17:15:46.745,TrId=5,To=31.12.9999 23:59:59 +00:00
2020/09/17 17:15:46.746| |Basket |Send to История (c 02.10.2017 0:00:00 +00:00 по 09.09.2020 0:00:00 +00:00): TimeFrameLookup,T(L)=2020.09.17 17:15:46.745,TrId=6,To=31.12.9999 23:59:59 +00:00
2020/09/17 17:15:46.752| |TS_SBER@TQBR_test account|Стратегия Запущена. [0,-1]. Позиция 0.
2020/09/17 17:15:46.766| |HistoryEmulationConnector|Инструмент SBER@TQBR подписывается на MarketData,T(L)=2020.09.17 17:15:46.766,Sec=SBER@TQBR,Price=0,01,Dec=2,DataType=Стакан,IsSubscribe=True,TransId=7,SmallTF=True
2020/09/17 17:15:46.771| |Basket |Send to История (c 02.10.2017 0:00:00 +00:00 по 09.09.2020 0:00:00 +00:00): MarketData,T(L)=2020.09.17 17:15:46.766,Sec=SBER@TQBR,Price=0,01,Dec=2,DataType=Стакан,IsSubscribe=True,TransId=7,SmallTF=True
2020/09/17 17:15:46.811| |HistoryEmulationConnector|SubscribeCandles
2020/09/17 17:15:46.813| |HistoryEmulationConnector|Инструмент SBER@TQBR подписывается на MarketData,T(L)=2020.09.17 17:15:46.813,Sec=SBER@TQBR,Price=0,01,Dec=2,DataType=Таймфрейм свеча: 00:01:00,IsSubscribe=True,TransId=8,SmallTF=True
2020/09/17 17:15:46.813| |Basket |Send to История (c 02.10.2017 0:00:00 +00:00 по 09.09.2020 0:00:00 +00:00): MarketData,T(L)=2020.09.17 17:15:46.813,Sec=SBER@TQBR,Price=0,01,Dec=2,DataType=Таймфрейм свеча: 00:01:00,IsSubscribe=True,TransId=8,SmallTF=True
2020/09/17 17:15:46.861| |Basket |Send to История (c 02.10.2017 0:00:00 +00:00 по 09.09.2020 0:00:00 +00:00): PortfolioLookup,T(L)=2020.09.17 17:15:42.469,Name=,TransId=9,IsSubscribe=True,Strategy=e0a7a49d-895c-4642-b329-73bfac99a7a3
2020/09/17 17:15:46.870| |HistoryEmulationConnector|Subscription 1 Stopped->Online.
2020/09/17 17:15:46.872| |Basket |Send to История (c 02.10.2017 0:00:00 +00:00 по 09.09.2020 0:00:00 +00:00): OrderStatus,T(L)=2020.09.17 17:15:42.489,Sec=@,TransId=10,OrdType=,Pf=(ClCode=),Cond=,MR=,Strategy=e0a7a49d-895c-4642-b329-73bfac99a7a3,IsSubscribe=True
2020/09/17 17:15:46.901| |HistoryEmulationConnector|Subscription 3 removed.
2020/09/17 17:15:46.901| |HistoryEmulationConnector|Subscription 3 Stopped->Finished.
2020/09/17 17:15:46.909| |HistoryEmulationConnector|Subscription 7 Stopped->Active.
2020/09/17 17:15:46.912| |HistoryEmulationConnector|Subscription 7 Active->Online.
2020/09/17 17:15:46.913|Warning|HistoryEmulationConnector|Subscription 7 Online->Online.
2020/09/17 17:15:46.913| |HistoryEmulationConnector|Subscription 8 Stopped->Active.
2020/09/17 17:15:46.913| |HistoryEmulationConnector|Subscription 8 Active->Online.
2020/09/17 17:15:46.913|Warning|HistoryEmulationConnector|Subscription 8 Online->Online.
2020/09/17 17:15:46.914| |HistoryEmulationConnector|Subscription 2 Stopped->Online.
2020/09/17 17:15:46.915| |HistoryEmulationConnector|Изменение состояния эмуляции Stopped -> Starting
2020/09/17 17:15:46.915| |HistoryEmulationConnector|Изменение состояния эмуляции Starting -> Started
2020/09/17 17:15:47.154| |TS_SBER@TQBR_test account|Регистрация новой Market (0x3BEB3DD) заявки на Buy с ценой 0 и объемом 1.
2020/09/17 17:15:47.175| |HistoryEmulationConnector|RegisterOrder: 0/ SBER@TQBR test account Покупка Цена=0 Объем=1 Сост=None Бал=0 Тип=Market UID=e0a7a49d-895c-4642-b329-73bfac99a7a3 Strategy=e0a7a49d-895c-4642-b329-73bfac99a7a3
2020/09/17 17:15:47.203| |HistoryEmulationConnector|New order: 11/ SBER@TQBR test account Покупка Цена=0 Объем=1 Сост=Pending Бал=1 Тип=Market UID=e0a7a49d-895c-4642-b329-73bfac99a7a3 Strategy=e0a7a49d-895c-4642-b329-73bfac99a7a3
2020/09/17 17:15:49.842| |HistoryEmulationConnector|Изменение состояния эмуляции Started -> Stopping
2020/09/17 17:15:49.843| |HistoryEmulationConnector|Disconnect
2020/09/17 17:15:49.844| |HistoryEmulationConnector|UnSubscribeAll
2020/09/17 17:15:49.845| |HistoryEmulationConnector|Инструмент отписывается от PortfolioLookup,T(L)=2020.09.17 17:15:49.845,OriginId=1,Name=,TransId=12,IsSubscribe=False,Strategy=e0a7a49d-895c-4642-b329-73bfac99a7a3
2020/09/17 17:15:49.847| |Basket |Send to История (c 02.10.2017 0:00:00 +00:00 по 09.09.2020 0:00:00 +00:00): PortfolioLookup,T(L)=2020.09.17 17:15:49.845,OriginId=9,Name=,TransId=13,IsSubscribe=False,Strategy=e0a7a49d-895c-4642-b329-73bfac99a7a3
2020/09/17 17:15:49.849| |HistoryEmulationConnector|Инструмент @ отписывается от OrderStatus,T(L)=2020.09.17 17:15:49.849,OriginId=2,Sec=@,TransId=14,OrdType=,Pf=(ClCode=),Cond=,MR=,Strategy=e0a7a49d-895c-4642-b329-73bfac99a7a3,IsSubscribe=False
2020/09/17 17:15:49.849| |Basket |Send to История (c 02.10.2017 0:00:00 +00:00 по 09.09.2020 0:00:00 +00:00): OrderStatus,T(L)=2020.09.17 17:15:49.849,OriginId=10,Sec=@,TransId=15,OrdType=,Pf=(ClCode=),Cond=,MR=,Strategy=e0a7a49d-895c-4642-b329-73bfac99a7a3,IsSubscribe=False
2020/09/17 17:15:49.851| |HistoryEmulationConnector|Инструмент SBER@TQBR отписывается от MarketData,T(L)=2020.09.17 17:15:49.851,OriginId=7,Sec=SBER@TQBR,Price=0,01,Dec=2,DataType=Стакан,IsSubscribe=False,TransId=16,OrigId=7,SmallTF=True
2020/09/17 17:15:49.851| |Basket |Send to История (c 02.10.2017 0:00:00 +00:00 по 09.09.2020 0:00:00 +00:00): MarketData,T(L)=2020.09.17 17:15:49.851,OriginId=7,Sec=SBER@TQBR,Price=0,01,Dec=2,DataType=Стакан,IsSubscribe=False,TransId=16,OrigId=7,SmallTF=True
2020/09/17 17:15:49.851| |HistoryEmulationConnector|Инструмент SBER@TQBR отписывается от MarketData,T(L)=2020.09.17 17:15:49.851,OriginId=8,Sec=SBER@TQBR,Price=0,01,Dec=2,DataType=Таймфрейм свеча: 00:01:00,IsSubscribe=False,TransId=17,OrigId=8,SmallTF=True
2020/09/17 17:15:49.851| |Basket |Send to История (c 02.10.2017 0:00:00 +00:00 по 09.09.2020 0:00:00 +00:00): MarketData,T(L)=2020.09.17 17:15:49.851,OriginId=8,Sec=SBER@TQBR,Price=0,01,Dec=2,DataType=Таймфрейм свеча: 00:01:00,IsSubscribe=False,TransId=17,OrigId=8,SmallTF=True
2020/09/17 17:15:49.857| |Basket |Disconnecting 'История (c 02.10.2017 0:00:00 +00:00 по 09.09.2020 0:00:00 +00:00)'.
2020/09/17 17:15:49.857| |HistoryEmulationConnector|Subscription 7 removed.
2020/09/17 17:15:49.857| |HistoryEmulationConnector|Subscription 7 Online->Stopped.
2020/09/17 17:15:49.857| |HistoryEmulationConnector|Subscription 7 removed.
2020/09/17 17:15:49.858| |HistoryEmulationConnector|Subscription 8 removed.
2020/09/17 17:15:49.858| |HistoryEmulationConnector|Subscription 8 Online->Stopped.
2020/09/17 17:15:49.858| |HistoryEmulationConnector|Subscription 8 removed.
2020/09/17 17:15:49.859| |Basket |Disconnected from 'История (c 02.10.2017 0:00:00 +00:00 по 09.09.2020 0:00:00 +00:00)'.
2020/09/17 17:15:49.862| |HistoryEmulationConnector|Изменение состояния эмуляции Stopping -> Stopped