Also, for NT Support.
I wanted to know who supplies the OrderState. Rejected. Is is NT or does it come from the broker? When and where does is the order rejected come from? Is the order accepted and Working before it is rejected or auto rejected? What exactly is the flow/life cycle of an Order from start to finish.
private Order orderToConfirm = null; private int sumbitOrderRetries = 3; public void EnterLongLimit() {[INDENT]int retryCount = 0;[/INDENT] Outside: if( retryCount < sumbitOrderRetries) { Inside: if(zLimtPriceOk(limitPrice)) // Limit Price is Good to Go {[INDENT=2]try{ orderToConfirm = EnterLongLimit(barsInProgressEnter, ordersLiveUntilCanceled, orderSize * orderMuliplier, limitPrice, longEntryName); retryCount++; } catch (Exception e) { Print("Cant Place Order zEnterLongLimit: " + e); } [/INDENT][INDENT=3]if(orderToConfirm != null && orderToConfirm.OrderState != OrderState.Rejected) // Order was accepted[/INDENT][INDENT=3] { return; } else { goto Outside; }[/INDENT] } else // Limit Price is Not Good { goto Inside; } } else { Print("Cant Place Order zEnterLongLimit. Maximun number of retries hit") ; return; } public bool zLimtPriceOk(double limitPrice) { bool result = true; if(limitPrice > GetCurrentAsk() && limitPrice > GetCurrentBid()) { result = true; } else result = false; return result; }
Comment