private bool CanCut(Instrument instrument, DateTime baseTime) { return(instrument.Trading.CanTrade(baseTime, PlaceContext.Empty) && instrument.HasTradePrice(_account)); }
internal bool ShouldCalculatePreCheckNecessary(AccountClass.Instrument instrument, bool isBuy, Dictionary <Guid, decimal> unfilledLotsPerTran, out decimal?unfilledLot) { return(_preCheckService.Value.ShouldCalculatePreCheckNecessary(instrument, isBuy, unfilledLotsPerTran, out unfilledLot)); }
private Transaction CutCommon(Dictionary <Guid, decimal> closedLotPerOpenOrderDict, Instrument instrument, bool cutAsBuy, decimal lotBalanceSum, Price setPrice) { DateTime baseTime = Market.MarketManager.Now; var account = instrument.Owner; var factory = TransactionFacade.CreateAddTranCommandFactory(OrderType.Risk, instrument.Setting.Category); var command = factory.CreateCutTransaction(account, instrument, lotBalanceSum, setPrice, cutAsBuy); command.Execute(); Transaction tran = command.Result; if (tran.InstrumentCategory == InstrumentCategory.Physical || _account.Setting().RiskLevelAction == RiskLevelAction.CloseNetPosition || _account.Setting().RiskLevelAction == RiskLevelAction.CloseAll) { tran.FirstOrder.SplitOrder(closedLotPerOpenOrderDict, true); } return(tran); }