We finished developing our automated Strategy and run it from money account in production (MES 12-21). However we've been having a number of strategy freezes (and the chart also freezes), every time it submitted a trade to the server:
- The output screen stops right at the order submission time.
- The chart doesn't draw more (just stalls), and we cannot follow the evolution of the trade.
- We can still disable the strategy there, and disconnect the connection successfully
- However at that point some NT processes hang and it cannot reconnect again.
Of course the order is in the server so it progresses and finishes correctly.
Our strategy does all the calculation in 1000 Ticks, and moves to 10 Tick timeframe to chase the price and submit a simple market order (this way we avoid they problems we had with stop and limit orders). It seems to me the problem could be there - in the switch from one timeframe (1000 Ticks) to the other (10 Ticks) to submit the trade? This is the function that finally submits it:
else if (State == State.Configure) { // To manage the order to be submitted in great detail AddDataSeries(Data.BarsPeriodType.Tick, 10); CommonStatic.PS = this; DecisionMaker.Initialize(); ScreenOut.Print(this, "FullCycleBaseStrategy.OnStateChange :: DEBUG :: After Configure"); } [...] internal static Order[] EndOfBarEnterLongNOrders10Tick(Strategy strategy, int numOrders) { var orders = new Order[numOrders]; if (CommonStatic.PS.Close[0] >= DesiredEntryPriceUp) { int newNumContracts = (NumContracts / numOrders); orders[0] = CommonStatic.PS.EnterLong(newNumContracts, "Order0"); ScreenOut.Print(CommonStatic.PS, "OrderGenerator.EndOfBarEnterLongNOrders10Tick :: DEBUG :: Order0 submitted."); Activate10TickOrderUp = false; VV.OrderTypeToSubmit = FullCycleOrderType.NoOrder; } return orders; }
Please advice. Thanks,
Alberto.
Comment