StockSharp
187 строк · 6.2 Кб
1namespace StockSharp.BusinessEntities2{
3using System;4using System.Collections.Generic;5
6using Ecng.Common;7
8using StockSharp.Messages;9
10/// <summary>11/// Transactional operations provider interface.12/// </summary>13public interface ITransactionProvider : IPortfolioProvider, IPositionProvider14{15/// <summary>16/// Transaction id generator.17/// </summary>18IdGenerator TransactionIdGenerator { get; }19
20/// <summary>21/// Own trade received.22/// </summary>23event Action<MyTrade> NewMyTrade;24
25/// <summary>26/// Order received.27/// </summary>28event Action<Order> NewOrder;29
30/// <summary>31/// Order changed (cancelled, matched).32/// </summary>33event Action<Order> OrderChanged;34
35/// <summary>36/// <see cref="EditOrder"/> success result event.37/// </summary>38event Action<long, Order> OrderEdited;39
40/// <summary>41/// Order registration error event.42/// </summary>43event Action<OrderFail> OrderRegisterFailed;44
45/// <summary>46/// Order cancellation error event.47/// </summary>48event Action<OrderFail> OrderCancelFailed;49
50/// <summary>51/// <see cref="EditOrder"/> error result event.52/// </summary>53event Action<long, OrderFail> OrderEditFailed;54
55/// <summary>56/// Mass order cancellation event.57/// </summary>58event Action<long> MassOrderCanceled;59
60/// <summary>61/// Mass order cancellation event.62/// </summary>63event Action<long, DateTimeOffset> MassOrderCanceled2;64
65/// <summary>66/// Mass order cancellation errors event.67/// </summary>68event Action<long, Exception> MassOrderCancelFailed;69
70/// <summary>71/// Mass order cancellation errors event.72/// </summary>73event Action<long, Exception, DateTimeOffset> MassOrderCancelFailed2;74
75/// <summary>76/// Failed order status request event.77/// </summary>78[Obsolete("Use SubscriptionFailed event.")]79event Action<long, Exception> OrderStatusFailed;80
81/// <summary>82/// Failed order status request event.83/// </summary>84[Obsolete("Use SubscriptionFailed event.")]85event Action<long, Exception, DateTimeOffset> OrderStatusFailed2;86
87/// <summary>88/// Stop-order registration error event.89/// </summary>90[Obsolete("Use OrderRegisterFailed event.")]91event Action<OrderFail> StopOrderRegisterFailed;92
93/// <summary>94/// Stop-order cancellation error event.95/// </summary>96[Obsolete("Use OrderCancelFailed event.")]97event Action<OrderFail> StopOrderCancelFailed;98
99/// <summary>100/// Stop-order received.101/// </summary>102[Obsolete("Use NewOrder event.")]103event Action<Order> NewStopOrder;104
105/// <summary>106/// Stop order state change event.107/// </summary>108[Obsolete("Use OrderChanged event.")]109event Action<Order> StopOrderChanged;110
111/// <summary>112/// Lookup result <see cref="PortfolioLookupMessage"/> received.113/// </summary>114event Action<PortfolioLookupMessage, IEnumerable<Portfolio>, Exception> LookupPortfoliosResult;115
116/// <summary>117/// Lookup result <see cref="PortfolioLookupMessage"/> received.118/// </summary>119event Action<PortfolioLookupMessage, IEnumerable<Portfolio>, IEnumerable<Portfolio>, Exception> LookupPortfoliosResult2;120
121/// <summary>122/// Register new order.123/// </summary>124/// <param name="order">Registration details.</param>125void RegisterOrder(Order order);126
127/// <summary>128/// Edit the order.129/// </summary>130/// <param name="order">Order.</param>131/// <param name="changes">Order changes.</param>132void EditOrder(Order order, Order changes);133
134/// <summary>135/// Reregister the order.136/// </summary>137/// <param name="oldOrder">Cancelling order.</param>138/// <param name="newOrder">New order to register.</param>139void ReRegisterOrder(Order oldOrder, Order newOrder);140
141/// <summary>142/// Cancel the order.143/// </summary>144/// <param name="order">The order which should be canceled.</param>145void CancelOrder(Order order);146
147/// <summary>148/// Cancel orders by filter.149/// </summary>150/// <param name="isStopOrder"><see langword="true" />, if cancel only a stop orders, <see langword="false" /> - if regular orders, <see langword="null" /> - both.</param>151/// <param name="portfolio">Portfolio. If the value is equal to <see langword="null" />, then the portfolio does not match the orders cancel filter.</param>152/// <param name="direction">Order side. If the value is <see langword="null" />, the direction does not use.</param>153/// <param name="board">Trading board. If the value is equal to <see langword="null" />, then the board does not match the orders cancel filter.</param>154/// <param name="security">Instrument. If the value is equal to <see langword="null" />, then the instrument does not match the orders cancel filter.</param>155/// <param name="securityType">Security type. If the value is <see langword="null" />, the type does not use.</param>156/// <param name="transactionId">Order cancellation transaction id.</param>157void CancelOrders(bool? isStopOrder = null, Portfolio portfolio = null, Sides? direction = null, ExchangeBoard board = null, Security security = null, SecurityTypes? securityType = null, long? transactionId = null);158
159/// <summary>160/// Subscribe on the portfolio changes.161/// </summary>162/// <param name="portfolio">Portfolio for subscription.</param>163[Obsolete("Use Subscribe method.")]164void RegisterPortfolio(Portfolio portfolio);165
166/// <summary>167/// Unsubscribe from the portfolio changes.168/// </summary>169/// <param name="portfolio">Portfolio for unsubscription.</param>170[Obsolete("Use UnSubscribe method.")]171void UnRegisterPortfolio(Portfolio portfolio);172
173/// <summary>174/// Determines the specified order can be edited by <see cref="EditOrder"/>.175/// </summary>176/// <param name="order">Order.</param>177/// <returns><see langword="true"/> if the order is editable, <see langword="false"/> order cannot be changed, <see langword="null"/> means no information.</returns>178bool? IsOrderEditable(Order order);179
180/// <summary>181/// Determines the specified order can be replaced by <see cref="ReRegisterOrder"/>.182/// </summary>183/// <param name="order">Order.</param>184/// <returns><see langword="true"/> if the order is replaceable, <see langword="false"/> order cannot be replaced, <see langword="null"/> means no information.</returns>185bool? IsOrderReplaceable(Order order);186}187}