Show / Hide Table of Contents

    Class Position

    Represents trading information about related position

    Namespace: TradingPlatform.BusinessLayer
    Syntax
    public class Position : TradingObject, IConnectionBindedObject, IUniqueID, ITradingObject, IMessageBuilder<MessageOpenPosition>

    Properties

    CurrentPrice

    The market price obtainable from your broker.

    Declaration
    public double CurrentPrice { get; }
    Property Value
    Type Description
    System.Double

    Fee

    Gets fee amount for the position.

    Declaration
    public PnLItem Fee { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.PnLItem

    GrossPnL

    Gets Profit/loss (without swaps or commissions) all calculated based on the current broker's price. For open position it shows the profit/loss you would make if you close the position at the current price. If position closed, this parameter show profit/loss what trader have after closing this position.

    Declaration
    public PnLItem GrossPnL { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.PnLItem

    GrossPnLTicks

    Returns ticks amount between open and current price.

    Declaration
    public double GrossPnLTicks { get; }
    Property Value
    Type Description
    System.Double

    LiquidationPrice

    Declaration
    public double LiquidationPrice { get; }
    Property Value
    Type Description
    System.Double

    NetPnL

    Gets Profit/loss calculated based on the current broker's price. For open position it shows the profit/loss you would make if you close the position at the current price. If position closed, this parameter show profit/loss what trader have after closing this position.

    Declaration
    public PnLItem NetPnL { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.PnLItem

    OpenPrice

    Gets position open order price

    Declaration
    public double OpenPrice { get; }
    Property Value
    Type Description
    System.Double

    OpenTime

    Gets position openning time

    Declaration
    public DateTime OpenTime { get; }
    Property Value
    Type Description
    DateTime

    Quantity

    Gets position quantity value

    Declaration
    public double Quantity { get; }
    Property Value
    Type Description
    System.Double

    StopLoss

    Gets StopLoss order which belongs to the position

    Declaration
    public Order StopLoss { get; }
    Property Value
    Type Description
    Order

    Swaps

    Gets PnL swaps

    Declaration
    public PnLItem Swaps { get; }
    Property Value
    Type Description
    TradingPlatform.BusinessLayer.PnLItem

    TakeProfit

    Gets TakeProfit order which belongs to the position

    Declaration
    public Order TakeProfit { get; }
    Property Value
    Type Description
    Order

    Methods

    BuildMessage()

    Declaration
    public MessageOpenPosition BuildMessage()
    Returns
    Type Description
    TradingPlatform.BusinessLayer.Integration.MessageOpenPosition

    Close(Double)

    Closes position if quantity is not specified else - uses partial closing operation.

    Declaration
    public virtual TradingOperationResult Close(double closeQuantity = null)
    Parameters
    Type Name Description
    System.Double closeQuantity
    Returns
    Type Description
    TradingPlatform.BusinessLayer.TradingOperationResult

    ForceRecalculatePnl()

    Declaration
    public void ForceRecalculatePnl()

    Events

    Updated

    Will be triggered on each TradingPlatform.BusinessLayer.Position.UpdateByMessage(TradingPlatform.BusinessLayer.Integration.MessageOpenPosition) and TradingPlatform.BusinessLayer.Position.UpdatePnl(TradingPlatform.BusinessLayer.PnL) invocation

    Declaration
    public event Action<Position> Updated
    Event Type
    Type Description
    Action<Position>
    Back to top Copyright QUANTOWER LLC. © 2017-2021. All rights reserved.