mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-08-14 09:52:53 +00:00
72 lines
2.1 KiB
C#
72 lines
2.1 KiB
C#
using System;
|
|
using System.Diagnostics;
|
|
|
|
namespace CryptoExchange.Net.SharedApis
|
|
{
|
|
/// <summary>
|
|
/// Position history
|
|
/// </summary>
|
|
[DebuggerDisplay("[{Timestamp}] {Symbol,nq} {PositionSide}: {RealizedPnl}")]
|
|
public record SharedPositionHistory : SharedSymbolModel
|
|
{
|
|
/// <summary>
|
|
/// The side of the position
|
|
/// </summary>
|
|
public SharedPositionSide PositionSide { get; set; }
|
|
/// <summary>
|
|
/// Average open price
|
|
/// </summary>
|
|
public decimal AverageOpenPrice { get; set; }
|
|
/// <summary>
|
|
/// Average close price
|
|
/// </summary>
|
|
public decimal AverageClosePrice { get; set; }
|
|
/// <summary>
|
|
/// Position size
|
|
/// </summary>
|
|
public decimal Quantity { get; set; }
|
|
/// <summary>
|
|
/// Realized profit/loss
|
|
/// </summary>
|
|
public decimal RealizedPnl { get; set; }
|
|
/// <summary>
|
|
/// Timestamp the position was closed
|
|
/// </summary>
|
|
public DateTime Timestamp { get; set; }
|
|
/// <summary>
|
|
/// Position id
|
|
/// </summary>
|
|
public string? PositionId { get; set; }
|
|
/// <summary>
|
|
/// Leverage of the position
|
|
/// </summary>
|
|
public decimal? Leverage { get; set; }
|
|
/// <summary>
|
|
/// Id of the order that closed the position
|
|
/// </summary>
|
|
public string? OrderId { get; set; }
|
|
|
|
/// <summary>
|
|
/// ctor
|
|
/// </summary>
|
|
public SharedPositionHistory(
|
|
SharedSymbol? sharedSymbol,
|
|
string symbol,
|
|
SharedPositionSide side,
|
|
decimal openPrice,
|
|
decimal closePrice,
|
|
decimal quantity,
|
|
decimal realizedPnl,
|
|
DateTime timestamp)
|
|
: base(sharedSymbol, symbol)
|
|
{
|
|
PositionSide = side;
|
|
AverageOpenPrice = openPrice;
|
|
AverageClosePrice = closePrice;
|
|
Quantity = quantity;
|
|
RealizedPnl = realizedPnl;
|
|
Timestamp = timestamp;
|
|
}
|
|
}
|
|
}
|