[BLOCKER] [S#3.0beta] трейды не регистрируются под статегией
Есть стратегия унаследованная от TimeFrameStrategy.
Для каждой новой свечки делается следующее:
Код
OpenWealth.Log.Out("ДО отмены приказов");
OpenWealth.Log.Out("Strategy.Orders " + base.Orders.Count);
OpenWealth.Log.Out("Strategy.StopOrders " + base.StopOrders.Count);
OpenWealth.Log.Out("Strategy.Orders active " + base.Orders.Count(o => o.State == OrderStates.Active));
OpenWealth.Log.Out("Strategy.StopOrders active " + base.StopOrders.Count(o => o.State == OrderStates.Active));
OpenWealth.Log.Out("Trader.Orders " + Const.SmartInstance.Trader.Orders.Count());
OpenWealth.Log.Out("Trader.StopOrders " + Const.SmartInstance.Trader.StopOrders.Count());
// отменяем активные заявки
base.CancelActiveOrders();
OpenWealth.Log.Out("ПОСЛЕ отмены приказов");
OpenWealth.Log.Out("Strategy.Orders " + base.Orders.Count);
OpenWealth.Log.Out("Strategy.StopOrders " + base.StopOrders.Count);
OpenWealth.Log.Out("Strategy.Orders active " + base.Orders.Count(o => o.State == OrderStates.Active));
OpenWealth.Log.Out("Strategy.StopOrders active " + base.StopOrders.Count(o => o.State == OrderStates.Active));
OpenWealth.Log.Out("Trader.Orders " + Const.SmartInstance.Trader.Orders.Count());
OpenWealth.Log.Out("Trader.StopOrders " + Const.SmartInstance.Trader.StopOrders.Count());
// регистрируем заявки (обычным способом, без котирования)
StrategyInstance.Alerts.ForEach(a => base.RegisterOrder(Translations.AlertToOrder(a)));
System.Threading.Thread.Sleep(10000);
OpenWealth.Log.Out("ПОСЛЕ регистрации новых приказов");
OpenWealth.Log.Out("Strategy.Orders " + base.Orders.Count);
OpenWealth.Log.Out("Strategy.StopOrders " + base.StopOrders.Count);
OpenWealth.Log.Out("Strategy.Orders active " + base.Orders.Count(o => o.State == OrderStates.Active));
OpenWealth.Log.Out("Strategy.StopOrders active " + base.StopOrders.Count(o => o.State == OrderStates.Active));
OpenWealth.Log.Out("Trader.Orders " + Const.SmartInstance.Trader.Orders.Count());
OpenWealth.Log.Out("Trader.StopOrders " + Const.SmartInstance.Trader.StopOrders.Count());
Для каждой свечки (для одной итерации) создаются два ордера.
Вывод на второй свечке (на первой аналогично добавились только в общий список):
Код
09.02.2011 19:41:35 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] ДО отмены приказов
09.02.2011 19:41:35 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.Orders 0
09.02.2011 19:41:35 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.StopOrders 0
09.02.2011 19:41:35 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.Orders active 0
09.02.2011 19:41:35 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.StopOrders active 0
09.02.2011 19:41:35 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Trader.Orders 2
09.02.2011 19:41:35 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Trader.StopOrders 2
09.02.2011 19:41:35 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] ПОСЛЕ отмены приказов
09.02.2011 19:41:35 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.Orders 0
09.02.2011 19:41:35 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.StopOrders 0
09.02.2011 19:41:35 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.Orders active 0
09.02.2011 19:41:35 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.StopOrders active 0
09.02.2011 19:41:35 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Trader.Orders 2
09.02.2011 19:41:35 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Trader.StopOrders 2
09.02.2011 19:41:35 [OpenWealth.StockSharp.SmartCOM.<Smart_NewOrders>b__18] RTS-3.11 -1 Conditional
09.02.2011 19:41:35 [OpenWealth.StockSharp.SmartCOM.<Smart_NewOrders>b__18] RTS-3.11 +1 Conditional
09.02.2011 19:41:45 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] ПОСЛЕ регистрации новых приказов
09.02.2011 19:41:45 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.Orders 0
09.02.2011 19:41:45 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.StopOrders 0
09.02.2011 19:41:45 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.Orders active 0
09.02.2011 19:41:45 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.StopOrders active 0
09.02.2011 19:41:45 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Trader.Orders 4
09.02.2011 19:41:45 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Trader.StopOrders 4
На третьей свечке добавляются наконец в список стратегии, но только в стоп ордера:
Код
09.02.2011 19:51:36 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] ДО отмены приказов
09.02.2011 19:51:36 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.Orders 0
09.02.2011 19:51:36 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.StopOrders 0
09.02.2011 19:51:36 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.Orders active 0
09.02.2011 19:51:36 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.StopOrders active 0
09.02.2011 19:51:36 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Trader.Orders 4
09.02.2011 19:51:36 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Trader.StopOrders 4
09.02.2011 19:51:36 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] ПОСЛЕ отмены приказов
09.02.2011 19:51:36 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.Orders 0
09.02.2011 19:51:36 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.StopOrders 0
09.02.2011 19:51:36 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.Orders active 0
09.02.2011 19:51:37 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.StopOrders active 0
09.02.2011 19:51:37 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Trader.Orders 4
09.02.2011 19:51:37 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Trader.StopOrders 4
09.02.2011 19:51:37 [OpenWealth.StockSharp.SmartCOM.<Smart_NewOrders>b__18] RTS-3.11 -1 Conditional
09.02.2011 19:51:37 [OpenWealth.HeadRealTradeStockSharp.OnOrderChanged] Ордер изменен. Состояние: Active статус: ReceiveByServer время снятия: бумага: RTS-3.11 b/s: Sell средняя цена: 0 тип: Conditional
09.02.2011 19:51:37 [OpenWealth.StockSharp.SmartCOM.<Smart_NewOrders>b__18] RTS-3.11 +1 Conditional
09.02.2011 19:51:37 [OpenWealth.HeadRealTradeStockSharp.OnOrderChanged] Ордер изменен. Состояние: Active статус: ReceiveByServer время снятия: бумага: RTS-3.11 b/s: Buy средняя цена: 0 тип: Conditional
09.02.2011 19:51:47 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] ПОСЛЕ регистрации новых приказов
09.02.2011 19:51:47 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.Orders 0
09.02.2011 19:51:47 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.StopOrders 2
09.02.2011 19:51:47 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.Orders active 0
09.02.2011 19:51:47 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Strategy.StopOrders active 2
09.02.2011 19:51:47 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Trader.Orders 6
09.02.2011 19:51:47 [OpenWealth.StockSharp.StrategyAdapter.OnProcess] Trader.StopOrders 6
Т.е. 2е ошибки:
1. ордера не всегда добавляются в список ордеров стратегии (чаще не добавляются)
2. в одном случае стоп ордер добавляется в Orders и StopOrders, в другом только в StopOrders
Что я делаю не так?