本文整理汇总了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);
}
示例2: CancelOrderCommand
public CancelOrderCommand(Order mask)
{
if (mask == null)
throw new ArgumentNullException("mask");
Mask = mask;
}
示例3: RegisterOrderCommand
public RegisterOrderCommand(Order order)
{
if (order == null)
throw new ArgumentNullException(nameof(order));
Order = order;
}
示例4: Add
public void Add(Order order)
{
if (order == null)
throw new ArgumentNullException(nameof(order));
_orders.Add(order);
}
示例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);
}
}
示例6: OrderCommand
public OrderCommand(Order order, OrderActions action)
{
if (order == null)
throw new ArgumentNullException(nameof(order));
Order = order;
Action = action;
}
示例7: ProcessChangedOrder
public void ProcessChangedOrder(Order order)
{
var container = GetContainer(order);
if (order.State == OrderStates.Done)
container.Remove(order);
container.RefreshTotals();
}
示例8: ProcessNewOrder
public void ProcessNewOrder(Order order)
{
var container = GetContainer(order);
if (order.State == OrderStates.Active)
{
container.Add(order);
container.RefreshTotals();
}
}
示例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;
}
示例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);
}
示例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);
}
}
示例12: DeleteOrder
private void DeleteOrder(Order order)
{
if (order != null)
{
try
{
Connector.CancelOrder(order);
}
catch (Exception g)
{
Debug.Print("{0}", g);
}
}
}
示例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);
}
}
示例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();
}
示例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));
}