internal void PositionClosed(TradeResult tradeResult) { if (tradeResult.IsSuccessful) { Grids.Where(x => x.Status == TradeStatus.Active && x.RobotPosition.Id == tradeResult.Position.Id).All(x => { x.Reset(); return(true); }); if (Grids.All(x => x.Status == TradeStatus.Inactive)) { Reset(); } } }
internal void PendingOrderCancelled(TradeResult tradeResult) { if (tradeResult.IsSuccessful) { Grids.Where(x => x.Status == TradeStatus.Pending && x.RobotPendingOrder.Id == tradeResult.PendingOrder.Id).All(x => { x.Reset(); return(true); }); if (Grids.All(x => x.Status == TradeStatus.Inactive)) { Reset(); } } }