Пример #1
0
 private bool CanCut(Instrument instrument, DateTime baseTime)
 {
     return(instrument.Trading.CanTrade(baseTime, PlaceContext.Empty) && instrument.HasTradePrice(_account));
 }
Пример #2
0
 internal bool ShouldCalculatePreCheckNecessary(AccountClass.Instrument instrument, bool isBuy, Dictionary <Guid, decimal> unfilledLotsPerTran, out decimal?unfilledLot)
 {
     return(_preCheckService.Value.ShouldCalculatePreCheckNecessary(instrument, isBuy, unfilledLotsPerTran, out unfilledLot));
 }
Пример #3
0
        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);
        }