1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-12 00:43:03 +00:00
Files
CryptoExchange.Net/CryptoExchange.Net/SharedApis/ResponseModels/SharedPosition.cs
T
Jan Korf 74e5cf6fc9 Feature/userdata tracker (#271)
Added user data tracking logic
Added LastReceiveTime, SocketStatus and SubscriptionStatus properties to UpdateSubscription
Added SharedTransferStatus Enum and property to SharedDeposit
Added PositionMode property to SharedPosition model
Added IsZero property to SharedQuantity
Renamed IWebSocket LastActionTime to LastReceiveTime
Updated CryptoExchangeWebsocketClient LastReceiveTime logic
Updated Subscription status change event handler to run sync instead of separate task
2026-02-05 16:05:13 +01:00

66 lines
2.1 KiB
C#

using System;
namespace CryptoExchange.Net.SharedApis
{
/// <summary>
/// Position info
/// </summary>
public record SharedPosition : SharedSymbolModel
{
/// <summary>
/// Position id
/// </summary>
public string? Id { get; set; }
/// <summary>
/// Current size of the position
/// </summary>
public decimal PositionSize { get; set; }
/// <summary>
/// Side of the position
/// </summary>
public SharedPositionSide PositionSide { get; set; }
/// <summary>
/// Whether the position is one way mode
/// </summary>
public SharedPositionMode PositionMode { get; set; }
/// <summary>
/// Average open price
/// </summary>
public decimal? AverageOpenPrice { get; set; }
/// <summary>
/// Current unrealized profit/loss
/// </summary>
public decimal? UnrealizedPnl { get; set; }
/// <summary>
/// Liquidation price
/// </summary>
public decimal? LiquidationPrice { get; set; }
/// <summary>
/// Leverage
/// </summary>
public decimal? Leverage { get; set; }
/// <summary>
/// Last update time
/// </summary>
public DateTime? UpdateTime { get; set; }
/// <summary>
/// Stop loss price for the position. Not available in all API's so might be empty even though stop loss price is set
/// </summary>
public decimal? StopLossPrice { get; set; }
/// <summary>
/// Take profit price for the position. Not available in all API's so might be empty even though stop loss price is set
/// </summary>
public decimal? TakeProfitPrice { get; set; }
/// <summary>
/// ctor
/// </summary>
public SharedPosition(SharedSymbol? sharedSymbol, string symbol, decimal positionSize, DateTime? updateTime)
: base(sharedSymbol, symbol)
{
PositionSize = positionSize;
UpdateTime = updateTime;
}
}
}