ReportSource
Report data source that allows external code to add information and supports aggregation.
Implements: IReportSource
Constructors
public ReportSource()
reportSource = ReportSource()
Initializes a new instance of the ReportSource.
Properties
public TimeSpan AggregationInterval { get; set; }
value = reportSource.AggregationInterval
reportSource.AggregationInterval = value
Time interval for aggregation. Orders/trades within the same interval are grouped together. Default is 1 hour. Set to Zero to disable time-based grouping (items will be aggregated by count only when threshold is exceeded).
public decimal? Commission { get; set; }
value = reportSource.Commission
reportSource.Commission = value
Total commission.
public TimeSpan? Latency { get; set; }
value = reportSource.Latency
reportSource.Latency = value
Total latency.
public int MaxOrdersBeforeAggregation { get; set; }
value = reportSource.MaxOrdersBeforeAggregation
reportSource.MaxOrdersBeforeAggregation = value
Maximum number of orders before automatic aggregation is triggered. Default is 10000. Set to 0 to disable automatic aggregation.
public int MaxTradesBeforeAggregation { get; set; }
value = reportSource.MaxTradesBeforeAggregation
reportSource.MaxTradesBeforeAggregation = value
Maximum number of trades before automatic aggregation is triggered. Default is 10000. Set to 0 to disable automatic aggregation.
public string Name { get; set; }
value = reportSource.Name
reportSource.Name = value
Strategy name.
public IEnumerable<ReportOrder> Orders { get; }
value = reportSource.Orders
Orders collection.
public IEnumerable<ReportTrade> OwnTrades { get; }
value = reportSource.OwnTrades
Own trades collection.
public IEnumerable<ValueTuple<string, object>> Parameters { get; }
value = reportSource.Parameters
Get strategy parameters as name-value pairs.
public decimal PnL { get; set; }
value = reportSource.PnL
reportSource.PnL = value
Total profit-loss.
public decimal Position { get; set; }
value = reportSource.Position
reportSource.Position = value
Current position.
public IEnumerable<ReportPosition> Positions { get; }
value = reportSource.Positions
Position round-trips collection.
public decimal? Slippage { get; set; }
value = reportSource.Slippage
reportSource.Slippage = value
Total slippage.
public IEnumerable<ValueTuple<string, object>> StatisticParameters { get; }
value = reportSource.StatisticParameters
Statistic parameters as name-value pairs.
public TimeSpan TotalWorkingTime { get; set; }
value = reportSource.TotalWorkingTime
reportSource.TotalWorkingTime = value
The total time of strategy operation.
Methods
public ReportSource AddOrder(long? id, long transactionId, SecurityId securityId, Sides side, DateTime time, decimal price, OrderStates? state, decimal? balance, decimal? volume, OrderTypes? type)
result = reportSource.AddOrder(id, transactionId, securityId, side, time, price, state, balance, volume, type)
Add an order with individual parameters.
public ReportSource AddOrder(ReportOrder order)
result = reportSource.AddOrder(order)
Add an order.
- order
- Order to add.
Returns: This instance for chaining.
public ReportSource AddOrders(IEnumerable<ReportOrder> orders)
result = reportSource.AddOrders(orders)
Add multiple orders.
- orders
- Orders to add.
Returns: This instance for chaining.
public ReportSource AddParameter(string name, object value)
result = reportSource.AddParameter(name, value)
Add a parameter.
- name
- Parameter name.
- value
- Parameter value.
Returns: This instance for chaining.
public ReportSource AddParameters(IEnumerable<ValueTuple<string, object>> parameters)
result = reportSource.AddParameters(parameters)
Add multiple parameters.
- parameters
- Parameters to add.
Returns: This instance for chaining.
public ReportSource AddPosition(ReportPosition position)
result = reportSource.AddPosition(position)
Add a position round-trip.
- position
- Position round-trip to add.
Returns: This instance for chaining.
public ReportSource AddPositions(IEnumerable<ReportPosition> positions)
result = reportSource.AddPositions(positions)
Add multiple position round-trips.
- positions
- Positions to add.
Returns: This instance for chaining.
public ReportSource AddStatisticParameter(string name, object value)
result = reportSource.AddStatisticParameter(name, value)
Add a statistic parameter.
- name
- Parameter name.
- value
- Parameter value.
Returns: This instance for chaining.
public ReportSource AddStatisticParameters(IEnumerable<ValueTuple<string, object>> parameters)
result = reportSource.AddStatisticParameters(parameters)
Add multiple statistic parameters.
- parameters
- Parameters to add.
Returns: This instance for chaining.
public ReportSource AddTrade(long? tradeId, long orderTransactionId, SecurityId securityId, DateTime time, decimal tradePrice, decimal orderPrice, decimal volume, Sides side, long? orderId, decimal? slippage, decimal? pnl, decimal? position)
result = reportSource.AddTrade(tradeId, orderTransactionId, securityId, time, tradePrice, orderPrice, volume, side, orderId, slippage, pnl, position)
Add a trade with individual parameters.
public ReportSource AddTrade(ReportTrade trade)
result = reportSource.AddTrade(trade)
Add a trade.
- trade
- Trade to add.
Returns: This instance for chaining.
public ReportSource AddTrades(IEnumerable<ReportTrade> trades)
result = reportSource.AddTrades(trades)
Add multiple trades.
- trades
- Trades to add.
Returns: This instance for chaining.
public ReportSource AggregateOrders(TimeSpan interval)
result = reportSource.AggregateOrders(interval)
Manually trigger orders aggregation.
- interval
- Time interval for grouping. Use Zero for no time grouping.
Returns: This instance for chaining.
public ReportSource AggregateTrades(TimeSpan interval)
result = reportSource.AggregateTrades(interval)
Manually trigger trades aggregation.
- interval
- Time interval for grouping. Use Zero for no time grouping.
Returns: This instance for chaining.
public ReportSource Clear()
result = reportSource.Clear()
Clear all data.
Returns: This instance for chaining.
public ReportSource ClearOrders()
result = reportSource.ClearOrders()
Clear all orders.
Returns: This instance for chaining.
public ReportSource ClearParameters()
result = reportSource.ClearParameters()
Clear all parameters.
Returns: This instance for chaining.
public ReportSource ClearPositions()
result = reportSource.ClearPositions()
Clear all positions.
Returns: This instance for chaining.
public ReportSource ClearStatisticParameters()
result = reportSource.ClearStatisticParameters()
Clear all statistic parameters.
Returns: This instance for chaining.
public ReportSource ClearTrades()
result = reportSource.ClearTrades()
Clear all trades.
Returns: This instance for chaining.