if (AtmIsFlat()) { if (_enterLong) { _atmStrategyId = GetAtmStrategyUniqueId(); atmStrategyOrderId = GetAtmStrategyUniqueId(); Print(_atmStrategyId + " A "); AtmStrategyCreate(OrderAction.Buy, OrderType.Market, 0, 0, TimeInForce.Day, atmStrategyOrderId, ATMTemplateName, _atmStrategyId, (atmCallbackErrorCode, atmCallbackId) => { // checks that the call back is returned for the current atmStrategyId stored if (atmCallbackId == _atmStrategyId) { Print(_atmStrategyId + " B "); // check the atm call back for any error codes if (atmCallbackErrorCode == Cbi.ErrorCode.NoError) { Print(_atmStrategyId + " C "); // if no error, set private bool to true to indicate the atm strategy is created isAtmStrategyCreated = true; } } }); } if (isAtmStrategyCreated) { string[,] orders = GetAtmStrategyStopTargetOrderStatus("Stop1", _atmStrategyId); // Check length to ensure that returned array holds order information if (orders.Length > 0) { for (int i = 0; i < orders.GetLength(0); i++) { Print(_atmStrategyId + " L "); Print("Average fill price is " + orders[i, 0].ToString()); Print("Filled amount is " + orders[i, 1].ToString()); } } }
I am getting this OUTPUT:
35a006e31c2f4837ba6924dd8f606a98 A
35a006e31c2f4837ba6924dd8f606a98 B
35a006e31c2f4837ba6924dd8f606a98 C
35a006e31c2f4837ba6924dd8f606a98 L
Average fill price is 0
Filled amount is 0
Why am I getting all zeroes? What am I doing wrong?
Comment