当前位置: 首页>>代码示例>>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;未经允许,请勿转载。