當前位置: 首頁>>代碼示例>>C#>>正文


C# BusinessEntities.Order類代碼示例

本文整理匯總了C#中StockSharp.BusinessEntities.Order的典型用法代碼示例。如果您正苦於以下問題:C# Order類的具體用法?C# Order怎麽用?C# Order使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Order類屬於StockSharp.BusinessEntities命名空間,在下文中一共展示了Order類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Remove

				public void Remove(Order order)
				{
					if (order == null)
						throw new ArgumentNullException(nameof(order));

					_orders.Remove(order);
				}
開發者ID:RakotVT,項目名稱:StockSharp,代碼行數:7,代碼來源:MarketDepthQuote.cs

示例2: CancelOrderCommand

		public CancelOrderCommand(Order mask)
		{
			if (mask == null)
				throw new ArgumentNullException("mask");

			Mask = mask;
		}
開發者ID:reddream,項目名稱:StockSharp,代碼行數:7,代碼來源:CancelOrderCommand.cs

示例3: RegisterOrderCommand

		public RegisterOrderCommand(Order order)
		{
			if (order == null)
				throw new ArgumentNullException(nameof(order));

			Order = order;
		}
開發者ID:vikewoods,項目名稱:StockSharp,代碼行數:7,代碼來源:RegisterOrderCommand.cs

示例4: Add

				public void Add(Order order)
				{
					if (order == null)
						throw new ArgumentNullException(nameof(order));

					_orders.Add(order);
				}
開發者ID:RakotVT,項目名稱:StockSharp,代碼行數:7,代碼來源:MarketDepthQuote.cs

示例5: OnReRegisterOrder

		/// <summary>
		/// Перерегистрировать заявку на бирже.
		/// </summary>
		/// <param name="oldOrder">Заявка, которую нужно снять.</param><param name="newOrder">Новая заявка, которую нужно зарегистрировать.</param>
		protected override void OnReRegisterOrder(Order oldOrder, Order newOrder)
		{
			if (oldOrder.Security.Board.IsSupportAtomicReRegister)
			{
				var newOrderId1 = oldOrder.Id;
				var newOrderId2 = 0L;

				string res;
				var resCode = _slot.MoveOrders(1, ref newOrderId1, (double)newOrder.Price, (int)newOrder.Volume,
				                              newOrder.TransactionId.To<string>(), ref newOrderId2, 0, 0, "", out res);

				var exception = AlorExceptionHelper.GetException(resCode, res);

				if (exception != null)
				{
					RaiseOrderFailed(newOrder, exception);
					RaiseOrderFailed(oldOrder, exception);
				}

				newOrder.Messages.Add(res);
			}
			else
			{
				base.OnReRegisterOrder(oldOrder, newOrder);
			}
		}
開發者ID:reddream,項目名稱:StockSharp,代碼行數:30,代碼來源:AlorTraderControl.cs

示例6: OrderCommand

		public OrderCommand(Order order, OrderActions action)
		{
			if (order == null)
				throw new ArgumentNullException(nameof(order));

			Order = order;
			Action = action;
		}
開發者ID:RakotVT,項目名稱:StockSharp,代碼行數:8,代碼來源:OrderCommand.cs

示例7: ProcessChangedOrder

			public void ProcessChangedOrder(Order order)
			{
				var container = GetContainer(order);

				if (order.State == OrderStates.Done)
					container.Remove(order);

				container.RefreshTotals();
			}
開發者ID:pantov,項目名稱:StockSharp,代碼行數:9,代碼來源:MarketDepthQuote.cs

示例8: ProcessNewOrder

			public void ProcessNewOrder(Order order)
			{
				var container = GetContainer(order);

				if (order.State == OrderStates.Active)
				{
					container.Add(order);
					container.RefreshTotals();
				}
			}
開發者ID:RakotVT,項目名稱:StockSharp,代碼行數:10,代碼來源:MarketDepthQuote.cs

示例9: ReRegisterOrderCommand

		public ReRegisterOrderCommand(Order oldOrder, Order newOrder)
		{
			if (oldOrder == null)
				throw new ArgumentNullException(nameof(oldOrder));

			if (newOrder == null)
				throw new ArgumentNullException(nameof(newOrder));

			OldOrder = oldOrder;
			NewOrder = newOrder;
		}
開發者ID:vikewoods,項目名稱:StockSharp,代碼行數:11,代碼來源:ReRegisterOrderCommand.cs

示例10: OnRegisterOrder

		/// <summary>
		/// Зарегистрировать заявку на бирже.
		/// </summary>
		/// <param name="order">Заявка, содержащая информацию для регистрации.</param>
		protected override void OnRegisterOrder(Order order)
		{
			string exexCondition;

			switch (order.TimeInForce)
			{
				case TimeInForce.PutInQueue:
					exexCondition = " ";
					break;
				case TimeInForce.MatchOrCancel:
					exexCondition = "N";
					break;
				case TimeInForce.CancelBalance:
					exexCondition = "W";
					break;
				default:
					throw new ArgumentOutOfRangeException();
			}

			const string enterType = "P";
			const string splitFlag = "S";
			const string issueCode = "";

			var direction = order.Direction == OrderDirections.Buy ? "B" : "S";
			var extRef = order.TransactionId.To<String>();

			int resCode;
			string res;

			if (order.Type == OrderTypes.Conditional)
			{
				var condition = (AlorOrderCondition)order.Condition;
				resCode = _slot.AddStopOrder(order.Portfolio.Name, direction, order.Price == 0 ? "M" : "L", splitFlag,
				                            exexCondition, enterType, order.Security.Board.Code, order.Security.Code, issueCode,
				                            condition.Type.ToAlorConditionType(), order.ExpiryDate,
				                            (double)condition.StopPrice, (double)order.Price, (int)order.Volume, _slot.BrokerRef, extRef, out res);
			}
			else
			{

				resCode = _slot.AddOrder(order.Portfolio.Name, direction,
				                        order.Type == OrderTypes.Market ? "M" : "L", splitFlag, exexCondition, enterType, order.Security.Board.Code,
				                        order.Security.Code, issueCode, (double)order.Price, (int)order.Volume, _slot.BrokerRef, extRef, out res);
			}

			var exception = AlorExceptionHelper.GetException(resCode, res);
			if (exception != null)
				RaiseOrderFailed(order, exception);

			order.Messages.Add(res);
		}
開發者ID:reddream,項目名稱:StockSharp,代碼行數:55,代碼來源:AlorTraderControl.cs

示例11: OrderGrid_OnOrderReRegistering

		private void OrderGrid_OnOrderReRegistering(Order order)
		{
			var window = new OrderWindow
			{
				Title = LocalizedStrings.Str2976Params.Put(order.TransactionId),
				Connector = MainWindow.Instance.Trader,
				Order = order.ReRegisterClone(newVolume: order.Balance),
			};

			if (window.ShowModal(this))
			{
				MainWindow.Instance.Trader.ReRegisterOrder(order, window.Order);
			}
		}
開發者ID:reddream,項目名稱:StockSharp,代碼行數:14,代碼來源:OrdersWindow.xaml.cs

示例12: DeleteOrder

		private void DeleteOrder(Order order)
		{
			if (order != null)
			{
				try
				{
					Connector.CancelOrder(order);
				}
				catch (Exception g)
				{
					Debug.Print("{0}", g);
				}
			}
		}
開發者ID:dmDen,項目名稱:AlgoTools,代碼行數:14,代碼來源:SpeedTestStrategy.cs

示例13: OrderGrid_OnOrderReRegistering

		private void OrderGrid_OnOrderReRegistering(Order order)
		{
			var window = new OrderWindow
			{
				Title = LocalizedStrings.Str2976Params.Put(order.TransactionId),
				SecurityProvider = MainWindow.Instance.Trader,
				MarketDataProvider = MainWindow.Instance.Trader,
				Portfolios = new PortfolioDataSource(MainWindow.Instance.Trader),
				Order = order.ReRegisterClone(newVolume: order.Balance),
			};

			if (window.ShowModal(this))
			{
				MainWindow.Instance.Trader.ReRegisterOrder(order, window.Order);
			}
		}
開發者ID:kknet,項目名稱:StockSharp,代碼行數:16,代碼來源:StopOrdersWindow.xaml.cs

示例14: OnStarted

        protected override void OnStarted()
        {
            var order = new Order
            {
                Type = OrderTypes.Limit,
                Portfolio = Portfolio,
                Volume = 100,
                Price = price,
                Security = Security,
                Direction = sides
            };

            Connector.RegisterOrder(order);

            base.OnStarted();
        }     
開發者ID:AlexandrKalinovskiy,項目名稱:Quasar,代碼行數:16,代碼來源:LevelsStrategy.cs

示例15: OnOrderAdded

		/// <summary>
		/// The method is called when a new order added.
		/// </summary>
		/// <param name="order">Order.</param>
		protected override void OnOrderAdded(Order order)
		{
			if (order.Type != OrderTypes.Conditional)
				return;

			Type conditionType;

			lock (_conditionTypes.SyncRoot)
			{
				var condition = order.Condition;

				if (condition == null)
					return;

				conditionType = condition.GetType();

				if (_conditionTypes.Contains(conditionType))
					return;

				_conditionTypes.Add(conditionType);
			}

			GuiDispatcher.GlobalDispatcher.AddAction(() => AddColumns(conditionType));
		}
開發者ID:zjxbetter,項目名稱:StockSharp,代碼行數:28,代碼來源:OrderConditionalGrid.cs


注:本文中的StockSharp.BusinessEntities.Order類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。