Skip to main content

Portfolio overview with position, performance history and trade orders

Query

query PortfolioOverview {
  portfolio(id: 340224) {
    client: primaryContact {
      name
    }
    portfolioName: name
    portfolioReport: portfolioReport(
      calculateExpectedAmountBasedOpenTradeOrders: true) {
      marketValue: positionMarketValue
      cashBalance: accountBalance
      netAssetValue: marketValue
      investments: portfolioReportItems {
        security {
          name
          securityCode
        }
        amount
        amountAfterOpenTradeOrders
        purchaseValue:purchaseTradeAmount
        positionValue: marketTradeAmount
        changePercent: valueChangeRelative
      }
    }
    graph:analytics(withoutPositionData:true,
      parameters: {
        paramsSet: {
          timePeriodCodes:"GIVEN"
          includeData:true
          drilldownEnabled:false
          limit: 0
        },
        includeDrilldownPositions:false
      }) {
      dailyValues:grouppedAnalytics(key:"1") {
        dailyValue:indexedReturnData {
          date
          portfolioMinus100:indexedValue
          benchmarkMinus100:benchmarkIndexedValue
        }
      }
    }
    tradeOrders {
      orderStatus
      securityCode
      securityName
      amount
      tradeOrderType
      typeName
      orderStatus
      orderDate:transactionDate
    }
  }
}  

Result

{
  "data": {
    "portfolio": {
      "client": {
        "name": "Aaron Chan"
      },
      "portfolioName": "Investment portfolio",
      "portfolioReport": {
        "marketValue": 994682.9,
        "cashBalance": 30678361.61,
        "netAssetValue": 31673044.51,
        "investments": [
          {
            "security": {
              "name": "Vincit Oyj",
              "securityCode": "VINCIT.HE"
            },
            "amount": 155,
            "amountAfterOpenTradeOrders": 155,
            "purchaseValue": 11185.49,
            "positionValue": 9020.73,
            "changePercent": -0.193532871604194
          },
          {
            "security": {
              "name": "Corem Property Group AB (publ)",
              "securityCode": "CORE-PREF.ST"
            },
            "amount": 2913,
            "amountAfterOpenTradeOrders": 2913,
            "purchaseValue": 473344.2,
            "positionValue": 961290,
            "changePercent": 1.030847742509573
          },
          {
            "security": {
              "name": "Outokumpu Oyj",
              "securityCode": "OUT1V.HE"
            },
            "amount": 666,
            "amountAfterOpenTradeOrders": 666,
            "purchaseValue": 1898.1,
            "positionValue": 15115.03,
            "changePercent": 6.963242189557979
          },
          {
            "security": {
              "name": "PledPharma AB",
              "securityCode": "PLED.ST"
            },
            "amount": 1801,
            "amountAfterOpenTradeOrders": 1801,
            "purchaseValue": 57746,
            "positionValue": 9257.14,
            "changePercent": -0.839692099885706
          },
          {
            "security": {
              "name": "AB CALIFORNIA PORTFOLIO CLASS B",
              "securityCode": "ALCBX.NMFQS"
            },
            "amount": 0,
            "amountAfterOpenTradeOrders": 1000,
            "purchaseValue": 0,
            "positionValue": 0,
            "changePercent": 0
          }
        ]
      },
      "graph": {
        "dailyValues": {
          "dailyValue": [
            {
              "date": "2014-06-03",
              "portfolioMinus100": 100,
              "benchmarkMinus100": 100
            },
            {
              "date": "2014-06-04",
              "portfolioMinus100": 99.66609551425685,
              "benchmarkMinus100": 100
            },
            {
              "date": "2014-06-05",
              "portfolioMinus100": 99.166337155661,
              "benchmarkMinus100": 100
            },
            ...
            {
              "date": "2020-10-11",
              "portfolioMinus100": 115.96240832271533,
              "benchmarkMinus100": 100
            },
            {
              "date": "2020-10-12",
              "portfolioMinus100": 115.96240832271533,
              "benchmarkMinus100": 100
            },
            {
              "date": "2020-10-13",
              "portfolioMinus100": 115.96240832271533,
              "benchmarkMinus100": 100
            }
          ]
        }
      },
      "tradeOrders": [
        {
          "orderStatus": "1",
          "securityCode": "ALCBX.NMFQS",
          "securityName": "AB CALIFORNIA PORTFOLIO CLASS B",
          "amount": 1000,
          "tradeOrderType": 2,
          "typeName": "Buy",
          "orderDate": "2020-09-01"
        }
      ]
    }
  }
}