public void OrderFilledUnlockSequenceSubmitOpening(Order orderClosed) { List <List <Order> > lockingClosesFound = new List <List <Order> >(); lock (this.dictionaryLock) { // if among all the keys we have an order, then we should have Open orders sequenced foreach (List <Order> lockingCloseOrders in this.sequencerLockCloseOpen.Keys) { if (lockingCloseOrders.Contains(orderClosed) == false) { continue; } lockingClosesFound.Add(lockingCloseOrders); } // analyzing all locks for all symbols to find out whether this closed order released the lock foreach (List <Order> lockingCloseFound in lockingClosesFound) { // delete the locking order from the list (most likely containing 1 order) lockingCloseFound.Remove(orderClosed); if (lockingCloseFound.Count > 0) { continue; } // delete the list of locks from global dictionary List <Order> ordersOpen = this.sequencerLockCloseOpen[lockingCloseFound]; this.sequencerLockCloseOpen.Remove(lockingCloseFound); this.orderProcessor.AppendOrderMessageAndPropagateCheckThrowOrderNull(orderClosed, "last CloseOpenSequence order filled, unlocking submission of [" + ordersOpen.Count + "]ordersOpen"); if (ordersOpen.Count == 0) { continue; } // submitting all released opening orders foreach (Order submitting in ordersOpen) { OrderStateMessage omsg = new OrderStateMessage(submitting, OrderState.Submitting, "sequence cleared: [" + submitting.State + "]=>[" + OrderState.Submitting + "]" + " for [" + ordersOpen.Count + "] fellow ordersOpen" + " by orderClose=[" + orderClosed + "]"); this.orderProcessor.UpdateOrderStateAndPostProcess(submitting, omsg); } BrokerProvider broker = ordersOpen[0].Alert.DataSource.BrokerProvider; ThreadPool.QueueUserWorkItem(new WaitCallback(broker.SubmitOrdersThreadEntryDelayed), new object[] { ordersOpen, ordersOpen[0].Alert.Bars.SymbolInfo.SequencedOpeningAfterClosedDelayMillis }); } } }
public void OrderFilledUnlockSequenceSubmitOpening(Order order) { List <List <Order> > ordersCloseFoundInKeys = new List <List <Order> >(); lock (this.ordersCloseOpen) { foreach (List <Order> ordersClose in this.ordersCloseOpen.Keys) { if (ordersClose.Contains(order) == false) { continue; } ordersCloseFoundInKeys.Add(ordersClose); } foreach (List <Order> ordersCloseFound in ordersCloseFoundInKeys) { ordersCloseFound.Remove(order); if (ordersCloseFound.Count == 0) { List <Order> ordersOpen = this.ordersCloseOpen[ordersCloseFound]; this.ordersCloseOpen.Remove(ordersCloseFound); if (ordersOpen.Count == 0) { continue; } this.orderProcessor.AppendOrderMessageAndPropagateCheckThrowOrderNull(order, "last CloseOpenSequence order filled, unlocking submission of [" + ordersOpen.Count + "]ordersOpen"); foreach (Order submitting in ordersOpen) { OrderStateMessage omsg = new OrderStateMessage(submitting, OrderState.Submitting, "sequence cleared: [" + submitting.State + "]=>[" + OrderState.Submitting + "]" + " for [" + ordersOpen.Count + "] fellow ordersOpen" + " by orderClose=[" + order + "]"); this.orderProcessor.UpdateOrderStateAndPostProcess(submitting, omsg); } BrokerProvider broker = ordersOpen[0].Alert.DataSource.BrokerProvider; ThreadPool.QueueUserWorkItem(new WaitCallback(broker.SubmitOrdersThreadEntry), new object[] { ordersOpen }); } } } }
public OrderCallbackDupesCheckerTransparent(BrokerProvider brokerProvider) : base(brokerProvider) { }
public OrderCallbackDupesChecker(BrokerProvider brokerProvider) { this.brokerProvider = brokerProvider; }
public void Initialize(BrokerProvider brokerProvider) { this.BrokerProvider = brokerProvider; }
public BrokerEditor(BrokerProvider BrokerProvider, IDataSourceEditor dataSourceEditor) { this.brokerProvider = BrokerProvider; this.dataSourceEditor = dataSourceEditor; }