openapi: 3.0.1
info:
title: Services.AutoTrading Account Values Historical Report Data - Closed positions API
description: 'The AutoTrading service group provides endpoints for interacting with Saxo Bank''s SaxoSelect offering.Through these interfaces a client application can get Saxo Select trade leaders, portfolios and investments. Portfolio investments can be created and modifed.
Note: This service is subject to special licensing agreements and not generally available to all OpenAPI applications.
'
version: 2.4.138+710c760591
x-framework-version: 38.0.2+439c5b0ec3
x-machine: SIMOAWEB11-DK2
servers:
- url: https://gateway.saxobank.com/sim/openapi
tags:
- name: Historical Report Data - Closed positions
description: Closed Positions Report Data.
paths:
/cs/v1/reports/closedPositions/{ClientKey}/{FromDate}/{ToDate}:
get:
tags:
- Historical Report Data - Closed positions
description: Get all closed positions between two dates
operationId: ClosedPositionGet
parameters:
- name: $skip
in: query
description: The number of entries to skip from the beginning of the collection
schema:
minimum: 0
type: integer
format: int32
example: 1
- name: $top
in: query
description: The number of entries to return from the beginning of the collection
schema:
minimum: 0
type: integer
format: int32
default: 0
example: 1
- name: AccountGroupKey
in: query
description: The key of the account group to which the resource belongs.
schema:
title: The key of the account group to which the resource belongs.
minLength: 1
type: string
x-type-name: AccountGroupKey
example: stringValue
- name: AccountKey
in: query
description: The key of the account to which the resource belongs.
schema:
title: The key of the account to which the resource belongs.
minLength: 1
type: string
x-type-name: AccountKey
example: 01b64edf-da03-4145-bf33-ae21527d4c86
- name: ClientKey
in: path
description: The key of the client to which the resource belongs.
required: true
schema:
title: The key of the client to which the resource belongs.
minLength: 1
type: string
x-type-name: ClientKey
example: 493b43a5-fe85-4d1f-9071-dd4a9d4e42a4
- name: FromDate
in: path
description: From date
required: true
schema:
type: string
format: date
x-type-name: Date
example: '2016-10-10'
- name: ToDate
in: path
description: To date
required: true
schema:
type: string
format: date
x-type-name: Date
example: '2017-10-10'
responses:
'200':
description: Indicates that the request was performed correctly.
content:
application/json:
schema:
$ref: '#/components/schemas/ClosedPositionListResult'
example:
__next: /openapi/....../?$top=1&$skip=1
Data:
- AccountCurrency: USD
AccountCurrencyDecimals: 2
AccountId: 169236INET2
Amount: 400
AmountClose: -700
AmountOpen: 400
AssetType: Stock
ClosePositionId: '112428055'
ClosePrice: 3.1
ExchangeDescription: NASDAQ
InstrumentDescription: Central European Media Enterprise Ltd
InstrumentSectorName: Broadcasting & Entertainment
InstrumentSectorTypeId: 640
InstrumentSymbol: CETV:xnas
OpenPositionId: '642405794'
OpenPrice: 3.6126
PnLAccountCurrency: 228.64
PnLClientCurrency: 2614.90455108964
PnLUSD: -228.64
RootInstrumentSectorName: Consumer Service
RootInstrumentSectorTypeId: 506
TotalBookedOnClosingLegAccountCurrency: 2154.95
TotalBookedOnClosingLegClientCurrency: 54083.2750759607
TotalBookedOnClosingLegUSD: 2154.95
TotalBookedOnOpeningLegAccountCurrency: -1460.04
TotalBookedOnOpeningLegClientCurrency: -28289.824063745
TotalBookedOnOpeningLegUSD: -1406.04
TradeDate: '2017-04-07'
TradeDateClose: '2017-04-07'
TradeDateOpen: '2013-08-19'
UnderlyingInstrumentDescription: Central European Media Enterprise Ltd
UnderlyingInstrumentSymbol: CETV:xnas
'400':
description: Bad Request
content:
application/json:
schema:
required:
- ErrorCode
- Message
type: object
properties:
ErrorCode:
enum:
- BadRequestError
type: string
example: None
x-enum-descriptions:
BadRequestError: Bad request.
Message:
type: string
ModelState:
$ref: '#/components/schemas/ModelStateDictionary'
'401':
$ref: '#/components/responses/Unauthorized'
'503':
$ref: '#/components/responses/ServiceUnavailable'
'429':
$ref: '#/components/responses/TooManyRequests'
security:
- OpenApiOAuthSecurityScheme: []
- OpenApiJWTSecurityScheme: []
x-required-permissions:
personal: Read
components:
schemas:
ModelStateDictionary:
type: object
additionalProperties:
type: array
items:
type: string
AssetType:
title: The possible AssetTypes for which you can get a quote or place an order or a trade.
enum:
- Bond
- Cash
- CertificateBonus
- CertificateCappedBonus
- CertificateCappedCapitalProtected
- CertificateCappedOutperformance
- CertificateConstantLeverage
- CertificateDiscount
- CertificateExpress
- CertificateTracker
- CertificateUncappedCapitalProtection
- CertificateUncappedOutperformance
- CfdIndexOption
- CfdOnCompanyWarrant
- CfdOnEtc
- CfdOnEtf
- CfdOnEtn
- CfdOnFund
- CfdOnFutures
- CfdOnIndex
- CfdOnRights
- CfdOnStock
- CompanyWarrant
- ContractFutures
- Etc
- Etf
- Etn
- Fund
- FuturesOption
- FuturesStrategy
- FxBinaryOption
- FxForwards
- FxKnockInOption
- FxKnockOutOption
- FxNoTouchOption
- FxOneTouchOption
- FxSpot
- FxVanillaOption
- GuaranteeNote
- IpoOnStock
- ManagedFund
- MiniFuture
- MutualFund
- PortfolioNote
- Rights
- SrdOnEtf
- SrdOnStock
- Stock
- StockIndex
- StockIndexOption
- StockOption
- Warrant
- WarrantDoubleKnockOut
- WarrantKnockOut
- WarrantOpenEndKnockOut
- WarrantSpread
type: string
example: FxForwards
x-enum-descriptions:
FxSpot: Forex Spot.
FxForwards: Forex Forward.
FxVanillaOption: Forex Vanilla Option.
FxKnockInOption: Forex Knock In Option.
FxKnockOutOption: Forex Knock Out Option.
FxBinaryOption: Forex Binary Option.
FxOneTouchOption: Forex One Touch Option.
FxNoTouchOption: Forex No Touch Option.
ContractFutures: Contract Futures.
FuturesStrategy: Futures Strategy.
Stock: Stock.
StockOption: Stock Option.
Bond: Bond.
FuturesOption: Futures Option.
StockIndexOption: Stock Index Option.
ManagedFund: 'Obsolete: Managed Fund.'
Cash: Cash. Not tradeable!
CfdOnStock: Cfd on Stock.
CfdOnIndex: Cfd on Stock Index.
CfdOnFutures: Cfd on Futures.
StockIndex: Stock Index.
MutualFund: Mutual Fund.
CfdIndexOption: Cfd Index Option.
CfdOnEtf: Cfd on Etf
CfdOnEtc: Cfd on Etc
CfdOnEtn: Cfd on Etn
CfdOnFund: Cfd on Fund
CfdOnRights: Cfd on Rights
CfdOnCompanyWarrant: Cfd on unlisted warrant issued by a corporation.
Etf: Exchange traded fund.
Etc: Etc
Etn: Etn
Fund: Fund
Rights: Rights
Warrant: Warrant
MiniFuture: MiniFuture.
WarrantSpread: Warrant with built-in spread.
WarrantKnockOut: Warrant with a knock-out barrier.
WarrantOpenEndKnockOut: Knock-out Warrant with no expiry.
WarrantDoubleKnockOut: Warrant with two knock-out barriers.
CertificateUncappedCapitalProtection: Guarantees a percentage increase of the underlying asset's value above the issue price at expiry/maturity. Max loss is the amount invested multiplied by the CapitalProtection percentage.
CertificateCappedCapitalProtected: Guarantees a capped percentage increase of the underlying asset's value above the issue price at expiry/maturity. Max loss is the amount invested multiplied by the CapitalProtection percentage.
CertificateDiscount: Yields a capped return if the underlying asset's value is above the specified cap level at expiry. If the underlying's value is below the strike at expiry, the investor received the underlying or equivalent value. Offers direct exposure in underlying at a lower price (discount) with a capped potential profit and limited loss.
CertificateCappedOutperformance: Capped Outperformance Certificate.
CertificateCappedBonus: Certificate Capped Bonus.
CertificateExpress: Certificate Express kick out.
CertificateTracker: A certificate that mirrors the price movement of the underlying instrument. Often used to trade movements in indicies. Movements can be a fixed ratio of the underlying and can be inverted for bearish/short speculation. Risk is equivalent to owning the underlying.
CertificateUncappedOutperformance: Provides leveraged returns when the underlying price exceeds the threshold strike price. The amount leverage is defined by the Participation %. When the underlying is below the strike price, the certificate mirrors the underlying price 1:1.
CertificateBonus: Mirrors the price movement of the underlying only if and when the underlying price exceeds the defined barrier. If the certificate expires below the barrier, it offers partial protection/return of investment.
CertificateConstantLeverage: Certificate Constant Leverage.
SrdOnStock: SRD. (Service de Règlement Différé) on Stock.
SrdOnEtf: SRD. (Service de Règlement Différé) on Etf.
IpoOnStock: IPO on Stock
CompanyWarrant: Unlisted warrant issued by a corporation, often physically settled.
PortfolioNote: Danish pooled investment scheme (“Pulje”). Not online tradeable.
GuaranteeNote: Danish investment scheme (“Grantbevis”). Not online tradeable.
ClosedPosition:
title: The closed position.
type: object
properties:
AccountCurrency:
title: The account currency
type: string
example: stringValue
AccountCurrencyDecimals:
title: The amount of decimals used by the account currency
type: integer
format: int32
example: 99
AccountId:
title: AccountId
type: string
example: stringValue
Amount:
title: The amount bought or sold
type: number
example: 10
AmountClose:
title: The total traded amount for the Closing trade
type: number
example: 10
AmountOpen:
title: The total traded amount for the opening trade
type: number
example: 10
AssetType:
title: AssetType
allOf:
- $ref: '#/components/schemas/AssetType'
ClientCurrency:
title: Client Currency
type: string
example: stringValue
CloseIndexRatio:
title: Close Index Ratio
type: number
example: 10
ClosePositionId:
title: Close position Id
type: string
example: stringValue
ClosePrice:
title: Close price of position
type: number
example: 10
ExchangeDescription:
title: Description of exchange
type: string
example: stringValue
InstrumentCurrency:
title: Instrument Currency
type: string
example: stringValue
InstrumentDescription:
title: Instrument
type: string
example: stringValue
InstrumentSectorName:
title: Sector name of the instrument
type: string
example: stringValue
InstrumentSectorTypeId:
title: Sector type Id of instrument
type: integer
format: int32
example: 99
InstrumentSymbol:
title: The instrument code
type: string
example: stringValue
OpenIndexRatio:
title: Open Index Ratio
type: number
example: 10
OpenPositionId:
title: Open position Id
type: string
example: stringValue
OpenPrice:
title: Open price of position
type: number
example: 10
PnLAccountCurrency:
title: Profit and Loss in account currency
type: number
example: 10
PnLClientCurrency:
title: Profit and Loss in client currency
type: number
example: 10
PnLUSD:
title: Profit and Loss in USD
type: number
example: 10
RootInstrumentSectorName:
title: Top Level Sector name of the instrument
type: string
example: stringValue
RootInstrumentSectorTypeId:
title: Top Level Sector Id of the instrument
type: integer
format: int32
example: 99
TotalBookedOnClosingLegAccountCurrency:
title: Total booked on closing leg in account currency
type: number
example: 10
TotalBookedOnClosingLegClientCurrency:
title: Total booked on closing in client currency
type: number
example: 10
TotalBookedOnClosingLegUSD:
title: Total booked on closing in USD
type: number
example: 10
TotalBookedOnOpeningLegAccountCurrency:
title: Total booked on opening leg in account currency
type: number
example: 10
TotalBookedOnOpeningLegClientCurrency:
title: Total booked on opening leg in client currency
type: number
example: 10
TotalBookedOnOpeningLegUSD:
title: Total booked on opening leg in USD
type: number
example: 10
TradeDate:
title: Date of Trade
type: string
format: date
x-type-name: Date
TradeDateClose:
title: Tradedate for closing trade
type: string
format: date
x-type-name: Date
TradeDateOpen:
title: Tradedate for opening trade
type: string
format: date
x-type-name: Date
UnderlyingInstrumentDescription:
title: Description of underlying instrument
type: string
example: stringValue
UnderlyingInstrumentSymbol:
title: Symbol of underlying instrument
type: string
example: stringValue
additionalProperties: false
example:
AccountCurrency: stringValue
AccountCurrencyDecimals: 99
AccountId: stringValue
Amount: 10
AmountClose: 10
AmountOpen: 10
AssetType: FxBinaryOption
ClientCurrency: stringValue
CloseIndexRatio: 10
ClosePositionId: stringValue
ClosePrice: 10
ExchangeDescription: stringValue
InstrumentCurrency: stringValue
InstrumentDescription: stringValue
InstrumentSectorName: stringValue
InstrumentSectorTypeId: 99
InstrumentSymbol: stringValue
OpenIndexRatio: 10
OpenPositionId: stringValue
OpenPrice: 10
PnLAccountCurrency: 10
PnLClientCurrency: 10
PnLUSD: 10
RootInstrumentSectorName: stringValue
RootInstrumentSectorTypeId: 99
TotalBookedOnClosingLegAccountCurrency: 10
TotalBookedOnClosingLegClientCurrency: 10
TotalBookedOnClosingLegUSD: 10
TotalBookedOnOpeningLegAccountCurrency: 10
TotalBookedOnOpeningLegClientCurrency: 10
TotalBookedOnOpeningLegUSD: 10
TradeDate: '0001-01-01'
TradeDateClose: '0001-01-01'
TradeDateOpen: '0001-01-01'
UnderlyingInstrumentDescription: stringValue
UnderlyingInstrumentSymbol: stringValue
ClosedPositionListResult:
type: object
properties:
Data:
type: array
items:
$ref: '#/components/schemas/ClosedPosition'
description: The collection of entities for this feed.
MaxRows:
type: number
description: The maximum number of rows that can be returned (if applicable).
__count:
type: number
description: The total count of items in the feed.
__next:
type: string
description: The link for the next page of items in the feed.
additionalProperties: false
example:
__next: /openapi/....../?$top=1&$skip=1
Data:
- AccountCurrency: USD
AccountCurrencyDecimals: 2
AccountId: 169236INET2
Amount: 400
AmountClose: -700
AmountOpen: 400
AssetType: Stock
ClosePositionId: '112428055'
ClosePrice: 3.1
ExchangeDescription: NASDAQ
InstrumentDescription: Central European Media Enterprise Ltd
InstrumentSectorName: Broadcasting & Entertainment
InstrumentSectorTypeId: 640
InstrumentSymbol: CETV:xnas
OpenPositionId: '642405794'
OpenPrice: 3.6126
PnLAccountCurrency: 228.64
PnLClientCurrency: 2614.90455108964
PnLUSD: -228.64
RootInstrumentSectorName: Consumer Service
RootInstrumentSectorTypeId: 506
TotalBookedOnClosingLegAccountCurrency: 2154.95
TotalBookedOnClosingLegClientCurrency: 54083.2750759607
TotalBookedOnClosingLegUSD: 2154.95
TotalBookedOnOpeningLegAccountCurrency: -1460.04
TotalBookedOnOpeningLegClientCurrency: -28289.824063745
TotalBookedOnOpeningLegUSD: -1406.04
TradeDate: '2017-04-07'
TradeDateClose: '2017-04-07'
TradeDateOpen: '2013-08-19'
UnderlyingInstrumentDescription: Central European Media Enterprise Ltd
UnderlyingInstrumentSymbol: CETV:xnas
responses:
Unauthorized:
description: Indicates that the request was rejected because the 'Authorization' header was missing in the request or contained an invalid security token.
ServiceUnavailable:
description: Service Unavailable.
TooManyRequests:
description: The request was rejected due to rate limit being exceeded.
securitySchemes:
OpenApiJWTSecurityScheme:
type: http
scheme: bearer
bearerFormat: JWT
OpenApiOAuthSecurityScheme:
type: oauth2
flows:
authorizationCode:
authorizationUrl: https://sim.logonvalidation.net/authorize
tokenUrl: https://sim.logonvalidation.net/token
scopes: {}