-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathindex.html
80 lines (79 loc) · 4.43 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
<!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">
<link rel="stylesheet" href="pricelist.css">
<link rel="shortcut icon" type="image/x-icon" href="https://saxobank.github.io/openapi-samples-js/favicon.ico">
<!--
ProtoBuf versions: https://github.com/protobufjs/protobuf.js/tags
CDNs: - https://cdnjs.com/libraries/protobufjs
- https://cdn.jsdelivr.net/npm/protobufjs/dist/
- https://unpkg.com/browse/protobufjs/dist/
-->
<script type="text/javascript" src="protobuf-lib/protobuf.js/protobuf.min.js" defer></script>
<script type="text/javascript" src="protobuf-lib/protobuf-saxo.js" defer></script>
<script type="text/javascript" src="../../assets/js/boilerplate.js" defer></script>
<script type="text/javascript" src="instrumentcell.js" defer></script>
<script type="text/javascript" src="instrumentrow.js" defer></script>
<script type="text/javascript" src="pricesubscriptionhelper.js" defer></script>
<script type="text/javascript" src="demo.js" defer></script>
<title>Demo for retrieving realtime quotes</title>
</head>
<body>
<section class="page-header">
<h1 class="project-name">Streaming quotes sample</h1>
<h2 class="project-tagline">Example on showing streaming quote updates</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/sample-apps/realtime-quotes" 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>Streaming quotes for a group of instruments</h1>
This is a demo on showing price updates. The app is made the primary one (entitled for realtime quotes, if customer has a subscription) and this state is monitored.
<br />
On SIM, only prices for FxSpot are available, unless you <a href="https://www.developer.saxo/openapi/appmanagement#/connectlive" target="_blank">connect your SIM account with your Live account</a>.
<br />
When testing on live, you might need to <a href="https://www.saxotrader.com/d/myAccount" target="_blank">enable OpenApi DataAccess</a> in your account in order to get prices.
<br />
More info about prices can be found in <a href="https://www.developer.saxo/openapi/learn/pricing" target="_blank">the learn section</a>.
<br />
<br />
<label>Instrument name/ISIN: <input type="text" class="text-field" id="idInstrumentName" value="usd" placeholder="Enter instrument name.."></label>
<label>
Asset type: <select class="selector" id="idCbxAssetType">
<option value="FxSpot">FxSpot</option>
</select> (FxSpot has realtime prices on SIM)
</label>
<label>Exchange: <select class="selector" id="idCbxExchange">
<option value="-">No filter on exchange</option>
<option value="-" selected>Click "Get exchanges" to populate</option>
</select></label>
<br />
<br />
<input type="button" class="action-button" value="Get exchanges" id="idBtnGetExchanges" />
<input type="button" class="action-button" value="Find instrument(s)" id="idBtnFind" />
<br />
<br />
Search results: <pre class="code-block" id="idInstrumentsList">
<span class="instrumentName">Instrument</span><span class="price">Last</span><span class="price">Bid</span><span class="price">Ask</span><span class="price">High</span><span class="price">Low</span><span class="price">Open</span><span class="price">Close</span><span class="price">Volume</span><span class="dateTime">Time</span>
</pre>
<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>