Table of Contents

Class Portfolio

Namespace
ATAS.DataFeedsCore
Assembly
ATAS.DataFeedsCore.dll

Represents a portfolio entity with various properties related to account balance, Profit and Loss (PnL), permissions, trading options, and more.

public class Portfolio : IEntity
Inheritance
object
Portfolio
Implements
Extension Methods

Constructors

Portfolio()

Initializes a new instance of the Portfolio class with default values.

public Portfolio()

Properties

AccountID

Gets or sets the account ID associated with the portfolio.

public string AccountID { get; set; }

Property Value

string

AccountKind

Kind of this account when the connector tells its accounts apart (IB paper vs live, NinjaTrader Sim, CQG demo brokerage). Null means "as the connection", see IConnectorSettings.AccountKind.

Not in ATAS 8.0.15 yet: available from the next version.

[Browsable(false)]
public AccountKind? AccountKind { get; set; }

Property Value

AccountKind?

Accounts

Gets a list of portfolio groups associated with the portfolio.

[Browsable(false)]
public List<PortfolioGroup> Accounts { get; }

Property Value

List<PortfolioGroup>

ActiveOrders

Gets or sets the number of active orders associated with the portfolio.

[Browsable(false)]
public int ActiveOrders { get; set; }

Property Value

int

AtasId

Gets or sets the ATAS ID associated with the portfolio.

[Browsable(false)]
public int AtasId { get; set; }

Property Value

int

Balance

Gets or sets the total available funds that the user can use right now to make an order.

public decimal Balance { get; set; }

Property Value

decimal

Remarks

It includes the blocked margin. Represents the gross balance of the portfolio.

BalanceAvailable

Gets or sets the balance excluding the BlockedMargin.

public decimal? BalanceAvailable { get; set; }

Property Value

decimal?

Remarks

It is the amount of money that the user can use to open a new order right now.

BalancePower

Gets or sets the balance according to the leverage (on leverage x2, it will be two times bigger).

[Browsable(false)]
public decimal BalancePower { get; set; }

Property Value

decimal

Remarks

Use 0 when leverage is not applicable to the whole portfolio.

BlockedMargin

Gets or sets the amount of funds that are blocked by current open positions and not included in the BalanceAvailable.

[Browsable(false)]
public decimal BlockedMargin { get; set; }

Property Value

decimal

BrokerInfo

Gets or sets the raw broker attribution (FCM and IB levels) reported by the connector. Used by telemetry.

Not in ATAS 8.0.15 yet: available from the next version.

[Browsable(false)]
public PortfolioBrokerInfo? BrokerInfo { get; set; }

Property Value

PortfolioBrokerInfo

ClosedPnL

Gets or sets the closed Profit and Loss (PnL) of the portfolio. The closed PnL represents the realized gains or losses from closed positions.

[Browsable(false)]
public decimal ClosedPnL { get; set; }

Property Value

decimal

ClosedPnlDate

Gets or sets the date of the closed profit and loss (PnL).

[Browsable(false)]
public DateTime ClosedPnlDate { get; set; }

Property Value

DateTime

Commission

Gets or sets the commission value for the portfolio.

[Browsable(false)]
public decimal Commission { get; set; }

Property Value

decimal

CommissionRulesGroup

Gets or sets the commission rules group associated with the portfolio. The commission rules group is represented by an object of the CommissionRulesGroup class. This property is not visible in the user interface (Browsable(false)).

[Browsable(false)]
public CommissionRulesGroup CommissionRulesGroup { get; set; }

Property Value

CommissionRulesGroup

CommissionState

Gets or sets the state of the commission for the portfolio.

[Browsable(false)]
public string CommissionState { get; set; }

Property Value

string

ConnectionState

Gets or sets the connection state of the portfolio.

[Browsable(false)]
public ConnectionStates? ConnectionState { get; set; }

Property Value

ConnectionStates?

Currency

Gets or sets the currency associated with the portfolio.

public Currencies? Currency { get; set; }

Property Value

Currencies?

Data

Gets or sets additional data associated with the portfolio.

[Browsable(false)]
public object Data { get; set; }

Property Value

object

DepoName

Gets or sets the name of the deposit for the portfolio.

[Browsable(false)]
public string DepoName { get; set; }

Property Value

string

EntityType

[Browsable(false)]
public EntityType EntityType { get; }

Property Value

EntityType

Remarks

Gets the entity type, which is Portfolio.

ExtendedInfo

Gets or sets the extended portfolio information specific to the connector. Each connector can provide its own implementation with unique parameters.

Added in ATAS 8.0.15.

[Browsable(false)]
public IPortfolioExtendedInfo? ExtendedInfo { get; set; }

Property Value

IPortfolioExtendedInfo

FcmId

Gets or sets the FCM ID (Futures Commission Merchant ID) associated with the portfolio.

[Browsable(false)]
public string FcmId { get; set; }

Property Value

string

IbId

Gets or sets the IB ID (Introducing Broker ID) associated with the portfolio.

[Browsable(false)]
public string IbId { get; set; }

Property Value

string

IsAdviserPortfolio

Gets or sets a flag indicating whether the portfolio is associated with an adviser portfolio.

[Browsable(false)]
public bool IsAdviserPortfolio { get; set; }

Property Value

bool

IsLocked

Gets or sets a value indicating whether the trading options are locked.

public bool IsLocked { get; set; }

Property Value

bool

IsRealAccount

Gets or sets a flag indicating whether the portfolio is associated with a real account.

[Browsable(false)]
public bool IsRealAccount { get; set; }

Property Value

bool

IsSuspended

Gets or sets a value indicating whether the trading options are suspended.

public bool IsSuspended { get; set; }

Property Value

bool

Leverage

Gets or sets the leverage of the portfolio.

[Browsable(false)]
public decimal Leverage { get; set; }

Property Value

decimal

MaxEquityValue

Gets or sets the maximum equity value of the portfolio. The maximum equity value represents the highest value of the portfolio's equity over time.

[Browsable(false)]
public decimal MaxEquityValue { get; set; }

Property Value

decimal

OpenPnL

Gets or sets the opened Profit and Loss (PnL) of the portfolio. The opened PnL represents the unrealized gains or losses from currently open positions.

[Browsable(false)]
public decimal OpenPnL { get; set; }

Property Value

decimal

ProcessedTradeTime

Gets or sets the date and time when the trades for the portfolio were last processed.

[Browsable(false)]
public DateTime? ProcessedTradeTime { get; set; }

Property Value

DateTime?

StatisticsUrl

Url to get trading statistics for this account.

[Browsable(false)]
public string? StatisticsUrl { get; set; }

Property Value

string

TPlusLimit

Gets or sets the T+ limits for the portfolio.

[Browsable(false)]
public TPlusLimits? TPlusLimit { get; set; }

Property Value

TPlusLimits?

TotalClosedPnL

Gets or sets the total closed Profit and Loss (PnL) of the portfolio. The total closed PnL is the cumulative realized gains or losses from all closed positions.

[Browsable(false)]
public decimal TotalClosedPnL { get; set; }

Property Value

decimal

TotalPnL

Gets the total Profit and Loss (PnL) of the portfolio. The total PnL is the sum of both the opened PnL and the total closed PnL.

[Browsable(false)]
public decimal TotalPnL { get; }

Property Value

decimal

TradingOptions

Gets or sets the trading options associated with the portfolio.

[Browsable(false)]
public TradingOptions TradingOptions { get; set; }

Property Value

TradingOptions

TradingOptionsId

Gets or sets the ID of the associated trading options for the portfolio.

[Browsable(false)]
public long? TradingOptionsId { get; set; }

Property Value

long?

User

Gets or sets the user associated with the portfolio.

public User? User { get; set; }

Property Value

User

UserId

Gets or sets the ID of the user associated with the portfolio.

[Browsable(false)]
public long UserId { get; set; }

Property Value

long

Viewers

Gets the list of portfolio viewers associated with the portfolio.

[Browsable(false)]
public List<PortfolioViewer> Viewers { get; }

Property Value

List<PortfolioViewer>

Methods

Clone()

Creates a new instance of the Portfolio class that is a shallow copy of the current instance.

public Portfolio Clone()

Returns

Portfolio

A shallow copy of the current instance.

OnPropertyChanged(string)

Raises the PropertyChanged event with the specified property name.

protected void OnPropertyChanged(string name)

Parameters

name string

The name of the property that changed.

ToString()

Returns a string representation of the portfolio group, including various account-related information.

public override string ToString()

Returns

string

A string representation of the portfolio group.

Events

PropertyChanged

Occurs when a property value changes.

Added in ATAS 8.0.15.

public event PropertyChangedEventHandler? PropertyChanged

Event Type

PropertyChangedEventHandler