Read Backtest
Portfolio
Request
Fetch the portfolio state of a backtest for the project Id and backtest Id. The /backtests/read/portfolio
API accepts requests in the following format:
ReadBacktestPortfolioRequest Model - Request to read the portfolio state from a backtest in a project. | |
---|---|
projectId | integer Id of the project from which to read the backtest. |
backtestId | string Id of the backtest from which to read the portfolio state. |
Example |
{ "projectId": 0, "backtestId": "string" } |
Responses
The /backtests/read/portfolio
API provides a response in the following format:
200 Success
BacktestPortfolioResponse Model - Contains holdings and cash of the backtest instance. | |
---|---|
portfolio | Portfolio object /. |
Example |
{ "portfolio": { "Holdings": { "Symbol": { "Value": "string", "ID": "string", "Permtick": "string" }, "Type": "Base", "CurrencySymbol": "$", "AveragePrice": 0, "Quantity": 0, "MarketPrice": 0, "ConversionRate": 0, "MarketValue": 0, "UnrealizedPnl": 0 }, "Cash": { "Symbol": "string", "Amount": 0, "ConversionRate": 0, "CurrencySymbol": , "ValueInAccountCurrency": 0 } } } |
Portfolio portfolio Model | |
---|---|
Holdings | Holding object Dictionary of algorithm holdings information. |
Cash | Cash object Represents a holding of a currency in cash. |
Example |
{ "Holdings": { "Symbol": { "Value": "string", "ID": "string", "Permtick": "string" }, "Type": "Base", "CurrencySymbol": "$", "AveragePrice": 0, "Quantity": 0, "MarketPrice": 0, "ConversionRate": 0, "MarketValue": 0, "UnrealizedPnl": 0 }, "Cash": { "Symbol": "string", "Amount": 0, "ConversionRate": 0, "CurrencySymbol": , "ValueInAccountCurrency": 0 } } |
Holding Model - Live results object class for packaging live result data. | |
---|---|
Symbol | Symbol object Represents a unique security identifier. This is made of two components, the unique SID and the Value. The value is the current ticker symbol while the SID is constant over the life of a security. |
Type | string Enum Type of tradable security / underlying asset. Options : ['Base', 'Equity', 'Option', 'Commodity', 'Forex', 'Future', 'Cfd', 'Crypto'] |
CurrencySymbol | string The currency symbol of the holding. |
AveragePrice | number Average Price of our Holding in the currency the symbol is traded in. |
Quantity | number Quantity of the Symbol we hold. |
MarketPrice | number Current Market Price of the Asset in the currency the symbol is traded in. |
ConversionRate | number Current market conversion rate into the account currency. |
MarketValue | number Current market value of the holding. |
UnrealizedPnl | number Current unrealized P/L of the holding. |
Example |
{ "Symbol": { "Value": "string", "ID": "string", "Permtick": "string" }, "Type": "Base", "CurrencySymbol": "$", "AveragePrice": 0, "Quantity": 0, "MarketPrice": 0, "ConversionRate": 0, "MarketValue": 0, "UnrealizedPnl": 0 } |
Symbol Model - Represents a unique security identifier. This is made of two components, the unique SID and the Value. The value is the current ticker symbol while the SID is constant over the life of a security. | |
---|---|
Value | string The current symbol for this ticker. |
ID | string The security identifier for this symbol. |
Permtick | string The current symbol for this ticker. |
Example |
{ "Value": "string", "ID": "string", "Permtick": "string" } |
SecurityType Model - Type of tradable security / underlying asset. | |
---|---|
SecurityType | string Enum Type of tradable security / underlying asset. Options : ['Base', 'Equity', 'Option', 'Commodity', 'Forex', 'Future', 'Cfd', 'Crypto'] |
Example |
{ "SecurityType": "Base" } |
Cash Model - Represents a holding of a currency in cash. | |
---|---|
Symbol | string Gets the symbol used to represent this cash. |
Amount | number Gets or sets the amount of cash held. |
ConversionRate | number The currency conversion rate to the account base currency. |
CurrencySymbol | object The symbol of the currency, such as $. |
ValueInAccountCurrency | number The value of the currency cash in the account base currency. |
Example |
{ "Symbol": "string", "Amount": 0, "ConversionRate": 0, "CurrencySymbol": , "ValueInAccountCurrency": 0 } |
401 Authentication Error
UnauthorizedError Model - Unauthorized response from the API. Key is missing, invalid, or timestamp is too old for hash. | |
---|---|
www_authenticate | string Header |