Пример #1
0
        public void UpdateOtherUpdates(OrderOtherUpd otherupd)
        {
            try
            {
                Order ord;
                if (_ordersMap.TryGetValue(otherupd.OrdId, out ord))
                {
                    ProcessOrderWithStratMsg(otherupd, ord);
                }
                else if (_inactiveOrderMap.TryGetValue(otherupd.OrdId, out ord))
                {
                    ProcessOrderWithStratMsg(otherupd, ord);
                }
                else
                {
                    _logger.LogError("MISSING ORDER for strat." + otherupd.OrdId + ":" + otherupd.UpdTime);
                    //if (!_PendingIOrder.ContainsKey(strat.OrdId))
                    //{
                    //    _PendingIOrder.AddOrUpdate(strat.OrdId, new Queue<IOrder>(), (k, v) => { return v; });
                    //}
                    //_PendingIOrder[strat.OrdId].Enqueue(strat);
                    //stratMsgBlock.Post(strat);
                }

                //_stratMsgMap.AddOrUpdate(strat.OrdId, strat, (key, oldVal) => oldVal = strat);
            }
            catch (Exception ex)
            {
                _logger.LogError("Strat Upd Error:" + ex.Message);
            }

            //await stratMsgBlock.SendAsync(strat);
        }
Пример #2
0
 private void ProcessOrderWithStratMsg(OrderOtherUpd strat, Order ord)
 {
     //ord.StratDetails = msg;
     ord.Status    = strat.Mode;
     ord.StartAlgo = strat.StartAlg;
     ord.StartSub  = strat.StartSub;
     ord.FreeText  = strat.FreeText;
     ord.ExecTime  = strat.UpdTime;
 }