Пример #1
0
		/// <summary>
		///   建構子
		/// </summary>
		/// <param name="service">AbstractOrderService 下單服務抽象類別</param>
		/// <param name="args">下單參數</param>
		/// <param name="openNextBar">是否開倉於下一根 Bars</param>
		internal OrderMarket(AbstractOrderService service, SOrderParameters args, bool openNextBar) {
			this.ID = service.GetOrderID();
			Contracts cContract = args.Lots;
			this.Info = new Order(args.Name, args.Action, OrderCategory.Market, (cContract.IsDefault) ? service.DefaultContracts : args.Lots, openNextBar, args.ExitTypeInfo);

			__cSender = service as IOrderSender;
			__cPositions = service.Positions;
		}
Пример #2
0
		/// <summary>
		///   建構子
		/// </summary>
		/// <param name="service">AbstractOrderService 下單服務抽象類別</param>
		/// <param name="args">下單參數</param>
		internal OrderPriced(AbstractOrderService service, SOrderParameters args) {
			this.ID = service.GetOrderID();
			Contracts cContract = args.Lots;
			this.Info = new Order(args.Name, args.Action, OrderCategory.Limit, (cContract.IsDefault) ? service.DefaultContracts : args.Lots, false, args.ExitTypeInfo);

			__cSender = service as IOrderSender;
			__cPositions = service.Positions;
		}
Пример #3
0
        /// <summary>
        ///   建構子
        /// </summary>
        /// <param name="service">AbstractOrderService 下單服務抽象類別</param>
        /// <param name="args">下單參數</param>
        /// <param name="openNextBar">是否開倉於下一根 Bars</param>
        internal OrderMarket(AbstractOrderService service, SOrderParameters args, bool openNextBar)
        {
            this.ID = System.Guid.NewGuid().GetHashCode();
            Contracts cContract = args.Lots;

            this.Info = new Order(args.Name, args.Action, OrderCategory.Market, (cContract.IsDefault) ? service.DefaultContracts : args.Lots, openNextBar, args.ExitTypeInfo);

            __cSender    = service as IOrderSender;
            __cPositions = service.Positions;
        }
Пример #4
0
        /// <summary>
        ///   建構子
        /// </summary>
        /// <param name="service">AbstractOrderService 下單服務抽象類別</param>
        /// <param name="args">下單參數</param>
        internal OrderPriced(AbstractOrderService service, SOrderParameters args)
        {
            this.ID = System.Guid.NewGuid().GetHashCode();
            Contracts cContract = args.Lots;

            this.Info = new Order(args.Name, args.Action, OrderCategory.Limit, (cContract.IsDefault) ? service.DefaultContracts : args.Lots, false, args.ExitTypeInfo);

            __cEntrusts = (service as IOrderEntrust).Entrusts;

            __cSender    = service as IOrderSender;
            __cPositions = service.Positions;
        }
Пример #5
0
 public OrderController(IOrderManager orderManager, IOrderSender orderSender, IUserManager userManager)
 {
     _orderManager = orderManager;
     _orderSender  = orderSender;
     _userManager  = userManager;
 }
Пример #6
0
 public OrderManager(IOrderSender sender)
 {
     orderSender = sender;
 }
Пример #7
0
 public OrderProcessor(IOrderBatcher orderBatcher, IOrderSender orderSender, IOrderRecorder orderRecorder)
 {
     _orderBatcher = orderBatcher;
     _orderSender = orderSender;
     _orderRecorder = orderRecorder;
 }
Пример #8
0
 public OrdersController(IOrderSender orderSender, ICustomerService customerService)
 {
     _orderSender     = orderSender;
     _customerService = customerService;
 }