OpenAPI

The Account History Performance resource provide access to various historical metrics which you can use to measure aggregate performance of a client or account.

Performance is only calculated on days where the market is open, and is calculated during end of day.

As each endpoint belonging to this resource provides a broad set of datasets, FieldGroups filters can be utilized to reduce response body size, to provide only the metrics that will be used. See each endpoint's query parameters in the reference documentation for specific information.

Endpoints

NamePathResponseUse case

Performance Timeseries

/hist/v4/performance/timeseries

Timeseries containing client/account-wide historical performance metrics, such as account/client accumulated return, balances, value, PnL. Commonly provides data points for to render graphs & charts representing the requesting entity's performance.
Performance Summary

/hist/v4/performance/summary/

Summarized metrics specifying high level metrics on the client/account's trading habits, top traded instruments, trades per date, amount of win/loss trades, and more.Commonly used to to showcase a summary of the requesting entity's historical trading metrics.

See our sample code and live demo on GitHub!



For performance of specific closed trades and positions, see the Client Services resources available.


Example Scenario and Response


As a Client, I want to view my overall performance over time, so I make a request to the "Get account performance" endpoint, defining a date range of the past 9 days. I only want data related to my daily accumulated return, and the combined value of the accounts my client owns.

So I will make a requesting using my ClientKey, and FieldGroups "TimeWeighted_Accumulated" and "Balance_AccountValue" as query parameters. I therefore also expect all values to be returned as converted from specific account currencies in my Client's default currency.


Performance Timeseries Request
GET /hist/v4/performance/timeseries?ClientKey={YourClientKey}&FromDate=2022-05-08&ToDate=2022-05-17&FieldGroups=TimeWeighted_Accumulated,Balance_AccountValue
200 OK

{
  "Balance": {
    "AccountBalance": [],
    "AccountValue": [
      {
        "Date": "2022-05-09",
        "Value": 584.38769
      },
      {
        "Date": "2022-05-10",
        "Value": 587.34533
      },
      {
        "Date": "2022-05-11",
        "Value": 604.7866
      },
      {
        "Date": "2022-05-12",
        "Value": 604.24778
      },
      {
        "Date": "2022-05-13",
        "Value": 602.52531
      },
      {
        "Date": "2022-05-16",
        "Value": 609.04489
      },
      {
        "Date": "2022-05-17",
        "Value": 627.3202
      }
    ],
    "CashTransfer": [],
    "MonthlyProfitLoss": [],
    "SecurityTransfer": [],
    "YearlyProfitLoss": []
  },
  "Benchmark": [],
  "TimeWeighted": {
    "Accumulated": [
      {
        "Date": "2022-05-09",
        "Value": -0.040722987711162964
      },
      {
        "Date": "2022-05-10",
        "Value": -0.03586799827319934
      },
      {
        "Date": "2022-05-11",
        "Value": -0.007238015707818947
      },
      {
        "Date": "2022-05-12",
        "Value": -0.00812249299679379
      },
      {
        "Date": "2022-05-13",
        "Value": -0.010949941116649212
      },
      {
        "Date": "2022-05-16",
        "Value": -0.000247999014176013
      },
      {
        "Date": "2022-05-17",
        "Value": 0.02975106680367567
      }
    ],
    "MonthlyReturn": [],
    "YearlyReturn": []
  }
}
 


I also want to access some of the summary key metrics of my most active account in a longer, 100 day period. Specifically, the data provided by the field groups "TradeSummary


Performance Summary Request
GET /hist/v4/performance/timeseries?ClientKey={ClientKey}&FromDate=2022-05-08&ToDate=2022-05-17&FieldGroups=TradeSummary
200 OK  

{
  "From": "2022-02-09",
  "InceptionDay": "2015-03-03",
  "LastTradeDay": "2022-05-19",
  "Thru": "2022-05-19",
  "TotalCashBalance": 0,
  "TotalOpenPositionsValue": 0,
  "TradeSummary": {
    "Allocation": {
      "TradesPerAssetType": {
        "ClosedTradesAllocations": [
          {
            "AssetClassType": "Equity",
            "ReturnAttribution": -1,
            "TradeCount": 10,
            "TradePercent": 1
          }
        ]
      },
      "TradesPerInstrument": {
        "ClosedTradesAllocations": [
          {
            "AssetType": "CfdOnStock",
            "InstrumentDescription": "Japan 225",
            "InstrumentSymbol": "JP225.I",
            "InstrumentUic": 1405,
            "ReturnAttribution": -0.011337362455153436,
            "TradeCount": 4,
            "TradePercent": 0.4
          },
          {
            "AssetType": "Stock",
            "InstrumentDescription": "Land Securities Group Plc REIT",
            "InstrumentSymbol": "LAND:xlon",
            "InstrumentUic": 858,
            "ReturnAttribution": -1,
            "TradeCount": 3,
            "TradePercent": 0.3
          },
          {
            "AssetType": "StockIndexOption",
            "InstrumentDescription": "Twitter Inc. Mar2022 39 C",
            "InstrumentSymbol": "TWTR/25H22C39:xcbf",
            "InstrumentUic": 27239889,
            "ReturnAttribution": 0,
            "TradeCount": 1,
            "TradePercent": 0.1
          },
          {
            "AssetType": "StockIndexOption",
            "InstrumentDescription": "Twitter Inc. Mar2022 38.5 P",
            "InstrumentSymbol": "TWTR/25H22P38.5:xcbf",
            "InstrumentUic": 27885341,
            "ReturnAttribution": 0,
            "TradeCount": 1,
            "TradePercent": 0.1
          },
          {
            "AssetType": "CfdOnStock",
            "InstrumentDescription": "AbbVie Inc.",
            "InstrumentSymbol": "ABBV:xnys",
            "InstrumentUic": 1706153,
            "ReturnAttribution": 0.3863967678025021,
            "TradeCount": 1,
            "TradePercent": 0.1
          }
        ]
      }
    },
    "AverageTradeDurationInMinutes": 24219,
    "AverageTradesPerWeek": 0.7070707070707071,
    "NumberOfDaysTraded": 2635,
    "NumberOfLongTrades": 10,
    "NumberOfShortTrades": 0,
    "TopTradedInstruments": [
      "JP225.I",
      "LAND:xlon",
      "TWTR/25H22C39:xcbf",
      "TWTR/25H22P38.5:xcbf",
      "ABBV:xnys"
    ],
    "TradeActivity": {
      "TradesPerDay": [
        {
          "Date": "2022-03-25",
          "TradeCount": 4
        },
        {
          "Date": "2022-04-04",
          "TradeCount": 1
        },
        {
          "Date": "2022-04-05",
          "TradeCount": 1
        },
        {
          "Date": "2022-04-19",
          "TradeCount": 1
        },
        {
          "Date": "2022-05-04",
          "TradeCount": 2
        },
        {
          "Date": "2022-05-05",
          "TradeCount": 1
        }
      ]
    },
    "TradedInstruments": [
      "Stock",
      "CfdOnStock",
      "StockIndexOption"
    ],
    "TradesTotalCount": 10,
    "TradesWonCount": 3
  }
}