Exemple #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;
		}
Exemple #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;
		}
		/// <summary>
		///   建立限價買賣模式(送出使用者指定的價格的委託單)
		/// </summary>
		/// <param name="orderParams">下單參數</param>
		/// <returns>返回值: IOrderPriced介面</returns>
		public IOrderPriced Limit(SOrderParameters orderParams) {
			return new OrderPriced(this, orderParams);
		}
		/// <summary>
		///   建立停損限價單模式(觸發到停損點後,以使用者指定的價格送出委託單)
		/// </summary>
		/// <param name="orderParams">下單參數</param>
		/// <returns>返回值: IOrderStopLimit介面</returns>
		public IOrderStopLimit StopLimit(SOrderParameters orderParams) {
			return null;
		}
		/// <summary>
		///   建立停損模式(觸發到停損點後,以市價送出委託單)
		/// </summary>
		/// <param name="orderParams">下單參數</param>
		/// <returns>返回值: IOrderPriced介面</returns>
		public IOrderPriced Stop(SOrderParameters orderParams) {
			return null;
		}
		/// <summary>
		///   建立市價買賣模式(立即以市價送出委託單)
		/// </summary>
		/// <param name="orderParams">下單參數</param>
		/// <returns>返回值: IOrderMarket介面</returns>
		public IOrderMarket MarketThisBar(SOrderParameters orderParams) {
			return new OrderMarket(this, orderParams, false);
		}
		/// <summary>
		///   建立市價買賣模式(在下一根 Bars 建立之後以市價送出委託單)
		/// </summary>
		/// <param name="orderParams">下單參數</param>
		/// <returns>返回值: IOrderMarket介面</returns>
		public IOrderMarket MarketNextBar(SOrderParameters orderParams) {
			return new OrderMarket(this, orderParams, true);
		}