-
Notifications
You must be signed in to change notification settings - Fork 25
/
index.html
142 lines (134 loc) · 6.88 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="ROBOTS" content="INDEX, FOLLOW" />
<meta name="VIEWPORT" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="https://saxobank.github.io/openapi-samples-js/assets/css/style.css">
<script type="text/javascript" src="../../assets/js/boilerplate.js" defer></script>
<script type="text/javascript" src="demo.js" defer></script>
<title>Demonstration of the performance endpoints</title>
</head>
<body>
<section class="page-header">
<h1 class="project-name">Performance</h1>
<h2 class="project-tagline">Performance</h2>
<a href="https://saxobank.github.io/openapi-samples-js" class="btn">← Back to main page</a>
<a href="https://github.com/SaxoBank/openapi-samples-js/tree/main/account-history/performance" class="btn">View on GitHub</a>
</section>
<section class="main-content">
<div class="highlight">
<label><span>Add token <a href="https://www.developer.saxo/openapi/token" target="_blank"
id="idHrefRetrieveToken">from here</a> to the box below:</span><br />
<input type="text" class="token-field" id="idBearerToken" value="" placeholder="Paste token here.."
autofocus /></label>
<input type="button" class="action-button" value="Validate" id="idBtnValidate" /><br />
<label>
Account: <select class="selector" id="idCbxAccount"><option value="-">Click Validate to populate</option></select>
</label>
</div>
<h1>Performance</h1>
<p>
Get historical, day by day, performance metrics relating to client or account value, and key metrics related to
trade performance. The amounts returned are in the primary currency of the requesting entity (Client or Account).
</p>
Read the <a href="https://www.developer.saxo/openapi/learn/performance" target="_blank">learn section</a>
and <a href="https://www.developer.saxo/openapi/referencedocs/hist/v4/performance" target="_blank">reference
documentation</a> for additional details.
<br />
<p class="note">
<strong>NOTE: </strong> The Simulation Environment only has limited mock data.<br />
Add the parameter "?env=live" to the url of this page, if you wish to use the live
environment.
</p>
<h1>Endpoints</h1>
<br />
<div class="row" style=" display: flex;">
<div class=" column" style="width:50%">
<h2>Timeseries</h2>
<h5>/hist/v4/performance/timeseries</h5>
<label>
<h4>Date Range:</h4>
<select class="selector" id="idCbxTimeseriesDateRange">
<option name="pastFiveDays" value="">Past 5 Days </option>
<option name="pastTenDays" value="">Past 10 Days </option>
<option value="&StandardPeriod=Month"> StandardPeriod.Month</option>
<option value="&StandardPeriod=Quarter"> StandardPeriod.Quarter</option>
<option value="&StandardPeriod=Year"> StandardPeriod.Year</option>
<option value="&StandardPeriod=AllTime"> StandardPeriod.AllTime</option>
</select><br />
<i style="font-size: 10px;">Date ranges can use either predefined StandardPeriod values, or a specfic date
range</i>
</label>
<br />
<label>
<h4>FieldGroups</h4>
<i style="font-size: 10px;">Hold control while clicking field groups, to select multiple field groups</i>
<select multiple class="selector" id="idCbxTimeseriesFieldGroups">
<option value="All"> All (Default)</option>
<option value="Balance"> Balance</option>
<option value="Balance_AccountBalance"> Balance_AccountBalance</option>
<option value="Balance_AccountValue"> Balance_AccountValue</option>
<option value="Balance_CashTransfer"> Balance_CashTransfer</option>
<option value="Balance_MonthlyProfitLoss"> Balance_MonthlyProfitLoss</option>
<option value="Balance_SecurityTransfer"> Balance_SecurityTransfer</option>
<option value="Balance_YearlyProfitLoss"> Balance_YearlyProfitLoss</option>
<option value="Benchmark"> Benchmark</option>
<option value="KeyFigures"> KeyFigures</option>
<option value="TimeWeighted"> TimeWeighted</option>
<option value="TimeWeighted_Accumulated"> TimeWeighted_Accumulated</option>
<option value="TimeWeighted_MonthlyReturn"> TimeWeighted_MonthlyReturn</option>
<option value="TimeWeighted_YearlyReturn"> TimeWeighted_YearlyReturn</option>
</select>
</label>
<br>
<input type="button" class="action-button" value="Get timeseries for Client"
id="idBtnGetClientTimeseries" /><br />
<input type="button" class="action-button" value="Get timeseries for Account" id="idBtnGetAccountTimeseries" />
<br />
</div>
<div class="column" style="width:50%">
<h2>Summary</h2>
<h5>/hist/v4/performance/summary</h5>
<label>
<h4>Date Range:</h4>
<select class="selector" id="idCbxSummaryDateRange">
<option name="pastFiveDays" value="">Past 5 Days </option>
<option name="pastTenDays" value="">Past 10 Days </option>
<option value="&StandardPeriod=Month"> StandardPeriod.Month</option>
<option value="&StandardPeriod=Quarter"> StandardPeriod.Quarter</option>
<option value="&StandardPeriod=Year"> StandardPeriod.Year</option>
<option value="&StandardPeriod=AllTime"> StandardPeriod.AllTime</option>
</select><br />
<i style="font-size: 10px;">Date ranges can use either predefined StandardPeriod values, or a specfic date
range</i>
</label>
<br />
<label>
<h4>FieldGroups</h4>
<i style="font-size: 10px;">Hold control while clicking field groups, to select multiple field groups</i>
<select multiple class="selector" id="idCbxSummaryFieldGroups">
<option value="All">All (Default)</option>
<option value="Allocation">Allocation</option>
<option value="BenchMark">BenchMark</option>
<option value="TradeActivity">TradeActivity</option>
<option value="TradeSummary">TradeSummary</option>
</select>
</label>
<br>
<input type="button" class="action-button" value="Get summary for Client" id="idBtnGetClientSummary" /><br />
<input type="button" class="action-button" value="Get summary for Account" id="idBtnGetAccountSummary" />
<br />
</div>
</div>
<br />
<br />
Response:
<pre class="highlight" id="idResponse">Click button to launch function.</pre>
<br />
JS code:
<pre class="code-block" id="idJavaScript">Click button to show code.</pre>
<footer class="site-footer"><span class="site-footer-credits" id="idFooter"></span></footer>
</section>
</body>
</html>