Ejemplo n.º 1
0
 private bool CanCut(Instrument instrument, DateTime baseTime)
 {
     return(instrument.Trading.CanTrade(baseTime, PlaceContext.Empty) && instrument.HasTradePrice(_account));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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);
        }