@quotemedia.com/streamer 2.33.0 → 2.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,134 +1,158 @@
1
- # Quotemedia Streaming Data Service JavaScript Client
2
-
3
- Javascript library responsible to connect to the Quotemedia Streaming Service.
4
-
5
- ### Requirements
6
-
7
- ````
8
- 1. Quotemedia Credentials
9
- ````
10
-
11
- ### Usage
12
- Include the javascript file (qmci-streamer-2.33.0.min.js) in your html page.
13
-
14
- ````
15
- <script src="qmci-streamer-2.33.0.min.js"></script>
16
- ````
17
-
18
- After this, you should be able to use the Streamer object. It will allow you to authenticate, subscribe and unsubscribe
19
- symbols. More details in the enduser-example.html, enterprise-token-example.html, wmid-example.html and subscription-example.html.
20
-
21
- ### Authentication
22
-
23
- ````
24
- Streamer.login({
25
- host: 'https://app.quotemedia.com/auth',
26
- credentials: {
27
- wmid: "YourWebmasterID",
28
- username: "YourUsername",
29
- password: "YourPassword"
30
- }
31
- }
32
- ````
33
- When using the login method this will generate a SID which then can be used to open a Streamer connection. You can also authenticate using different methods like:
34
- - Credentials
35
- - SID Token
36
- - Enterprise token
37
- - Webmaster ID
38
- - Datatool token
39
-
40
-
41
-
42
- ### Open
43
-
44
- Set rejectExcessiveConnection:true to reject new connections when limit is reached. If not specified or value is false,
45
- first open connection will be closed instead.
46
-
47
- If needed, there is ability to specify conflation value per connection. When conflation value is null
48
- or not specified, default conflation is used.
49
-
50
- Set format value to 'application/qitch' to use this binary protocol.
51
- Please note that although QITCH protocol uses less bandwidth it can cause significant performance degradation.
52
- In case if no format was specified JSON will be used by default.
53
-
54
- if and SID was previously generated using the login() funtion, it will be used to open the connection, otherwise a WMID and/or token will be required for opening (please see the wmid-example.html and the enterprise-token.html)
55
-
56
- ````
57
- Streamer.open({
58
- host: 'https://app.quotemedia.com/cache',
59
- cors: true,
60
- rejectExcessiveConnection: false,
61
- conflation: null,
62
- format: 'application/json',
63
- credentials: { sid: sid }
64
- }, then(function(stream) {
65
- // After successfully opening the stream,
66
- // listen for its events.
67
- ...
68
- }));
69
- ````
70
-
71
- After a connection was open, make sure to add the different event listeners required for the different events that the streamer object may trigger (please see more of this events on any of the examples).
72
-
73
- ### Subscription
74
-
75
- The different datatypes that you can subscribe to are:
76
- - Streamer.dataTypes.QUOTE
77
- - Streamer.dataTypes.PRICEDATA
78
- - Streamer.dataTypes.MMQUOTE
79
- - Streamer.dataTypes.ORDERBOOK
80
- - Streamer.dataTypes.INTERVAL
81
- - Streamer.dataTypes.NETHOUSEPOSITION
82
- - Streamer.dataTypes.LASTSALE
83
- - Streamer.dataTypes.LIMITUPLIMITDOWN
84
- - Streamer.dataTypes.BOOKORDER
85
- - Streamer.dataTypes.BOOKDELETE
86
- - Streamer.dataTypes.PURGEBOOK
87
- - Streamer.dataTypes.IVGREEKS
88
- - Streamer.dataTypes.IMBALANCESTATUS
89
- - Streamer.dataTypes.TRADE
90
-
91
- Some of this datatypes required different entitlements so make sure that you do have entitlements for the required datatype.
92
-
93
- An optional options object can also be passed in. Current available options include:
94
- - skipHeavyInitialLoad: whether to skip initial heavy loads (e.g., previous trades and intervals), defaults to false.
95
- - conflation: Override default connection conflation, default to null. A matching conflation must be supplied when unsubscribing.
96
-
97
- ````
98
- stream.subscribe(["GOOG"], [Streamer.dataTypes.PRICEDATA], { skipHeavyInitialLoad: false }, then(function(result) {
99
- ...
100
- }
101
- ````
102
-
103
- The subscription result will include the successful subscriptions as well as the unentitled and rejected subscriptions and invalid symbols.
104
-
105
- ### Exchange subscription
106
- ##### NOTE:
107
- This type of subscription will only work if you are entitled to exchange subscription data.
108
- Subscription to an exchange to receive stock status messages containing data such as halt, resume, regSHO.
109
-
110
- ````
111
- stream.subscribeExchange("NYE", then(function(result) {
112
- ...
113
- }
114
- ````
115
-
116
- ### Unsubscription
117
- ````
118
- stream.unsubscribe(["GOOG"], [Streamer.dataTypes.PRICEDATA], {}, then(function(result) {
119
- ...
120
- }
121
- ````
122
-
123
- Unsubscribe for symbols and data types. These can be either single strings or arrays of strings. An optional options object can also be passed in. Current available options include:
124
- - conflation: Override default connection conflation, default to null. Should match a subscribe conflation.
125
-
126
- ### Retrieve available number of symbols and connections, number of currently open connections and subscribed symbols.
127
- ````
128
- stream.getSessionStats();
129
- ...
130
- }
131
- ````
132
-
133
- ## Quotemedia Contact
1
+ # Quotemedia Streaming Data Service JavaScript Client
2
+
3
+ Javascript library responsible to connect to the Quotemedia Streaming Service.
4
+
5
+ ### Requirements
6
+
7
+ ````
8
+ 1. Quotemedia Credentials
9
+ ````
10
+
11
+ ### Usage
12
+ Include the javascript file (qmci-streamer-2.39.0.min.js) in your html page.
13
+
14
+ ````
15
+ <script src="qmci-streamer-2.39.0.min.js"></script>
16
+ ````
17
+
18
+ After this, you should be able to use the Streamer object. It will allow you to authenticate, subscribe and unsubscribe
19
+ symbols. More details in the enduser-example.html, enterprise-token-example.html, wmid-example.html and subscription-example.html.
20
+
21
+ ### Authentication
22
+
23
+ ````
24
+ Streamer.login({
25
+ host: 'https://app.quotemedia.com/auth',
26
+ credentials: {
27
+ wmid: "YourWebmasterID",
28
+ username: "YourUsername",
29
+ password: "YourPassword"
30
+ }
31
+ }
32
+ ````
33
+ When using the login method this will generate a SID which then can be used to open a Streamer connection. You can also authenticate using different methods like:
34
+ - Credentials
35
+ - SID Token
36
+ - Enterprise token
37
+ - Webmaster ID
38
+ - Datatool token
39
+
40
+
41
+
42
+ ### Open
43
+
44
+ Set rejectExcessiveConnection:true to reject new connections when limit is reached. If not specified or value is false,
45
+ first open connection will be closed instead.
46
+
47
+ If needed, there is ability to specify conflation value per connection. When conflation value is null
48
+ or not specified, default conflation is used.
49
+
50
+ Set format value to 'application/qitch' to use this binary protocol.
51
+ Please note that although QITCH protocol uses less bandwidth it can cause significant performance degradation.
52
+ In case if no format was specified JSON will be used by default.
53
+
54
+ if and SID was previously generated using the login() funtion, it will be used to open the connection, otherwise a WMID and/or token will be required for opening (please see the wmid-example.html and the enterprise-token.html)
55
+
56
+ ````
57
+ Streamer.open({
58
+ host: 'https://app.quotemedia.com/cache',
59
+ cors: true,
60
+ rejectExcessiveConnection: false,
61
+ conflation: null,
62
+ format: 'application/json',
63
+ credentials: { sid: sid }
64
+ }, then(function(stream) {
65
+ // After successfully opening the stream,
66
+ // listen for its events.
67
+ ...
68
+ }));
69
+ ````
70
+
71
+ After a connection was open, make sure to add the different event listeners required for the different events that the streamer object may trigger (please see more of this events on any of the examples).
72
+
73
+ ### Subscription
74
+
75
+ The different subscriptionTypes that you can subscribe to are:
76
+ - Streamer.subscriptionTypes.QUOTE
77
+ - Streamer.subscriptionTypes.PRICEDATA
78
+ - Streamer.subscriptionTypes.TRADE
79
+ - Streamer.subscriptionTypes.MMQUOTE
80
+ - Streamer.subscriptionTypes.ORDERBOOK
81
+ - Streamer.subscriptionTypes.INTERVAL
82
+ - Streamer.subscriptionTypes.NETHOUSEPOSITION
83
+ - Streamer.subscriptionTypes.LASTSALE
84
+ - Streamer.subscriptionTypes.LIMITUPLIMITDOWN
85
+ - Streamer.subscriptionTypes.IVGREEKS
86
+ - Streamer.subscriptionTypes.IMBALANCESTATUS
87
+
88
+ Some of this subscriptionTypes required different entitlements so make sure that you do have entitlements for the required datatype.
89
+
90
+ Then the different market data response types that can be received from the server are:
91
+ - Streamer.marketDataTypes.QUOTE
92
+ - Streamer.marketDataTypes.PRICEDATA
93
+ - Streamer.marketDataTypes.TRADE
94
+ - Streamer.marketDataTypes.INTERVAL
95
+ - Streamer.marketDataTypes.NETHOUSEPOSITION
96
+ - Streamer.marketDataTypes.MMQUOTE
97
+ - Streamer.marketDataTypes.BOOKORDER
98
+ - Streamer.marketDataTypes.PURGEBOOK
99
+ - Streamer.marketDataTypes.BOOKDELETE
100
+ - Streamer.marketDataTypes.SYMBOLINFO
101
+ - Streamer.marketDataTypes.SYMBOLSTATUS
102
+ - Streamer.marketDataTypes.DERIVATIVEINFO
103
+ - Streamer.marketDataTypes.LASTSALE
104
+ - Streamer.marketDataTypes.LIMITUPLIMITDOWN
105
+ - Streamer.marketDataTypes.IVGREEKS
106
+ - Streamer.marketDataTypes.IMBALANCESTATUS
107
+ - Streamer.marketDataTypes.ALERT
108
+ - Streamer.marketDataTypes.NEWS
109
+ - Streamer.marketDataTypes.TRADENOTIFICATION
110
+ - Streamer.marketDataTypes.NEWSCMDFILTER
111
+ - Streamer.marketDataTypes.NEWSERROR
112
+ - Streamer.marketDataTypes.DIVIDEND
113
+
114
+ You can check which types of market data message you are receiving by using the method:
115
+ ``Streamer.marketDataTypes.get(msg)``
116
+
117
+ An optional options object can also be passed in. Current available options include:
118
+ - skipHeavyInitialLoad: whether to skip initial heavy loads (e.g., previous trades and intervals), defaults to false.
119
+ - conflation: Override default connection conflation, default to null. A matching conflation must be supplied when unsubscribing.
120
+
121
+ ````
122
+ stream.subscribe(["GOOG"], [Streamer.dataTypes.PRICEDATA], { skipHeavyInitialLoad: false }, then(function(result) {
123
+ ...
124
+ }
125
+ ````
126
+
127
+ The subscription result will include the successful subscriptions as well as the unentitled and rejected subscriptions and invalid symbols.
128
+
129
+ ### Exchange subscription
130
+ ##### NOTE:
131
+ This type of subscription will only work if you are entitled to exchange subscription data.
132
+ Subscription to an exchange to receive stock status messages containing data such as halt, resume, regSHO.
133
+
134
+ ````
135
+ stream.subscribeExchange("NYE", then(function(result) {
136
+ ...
137
+ }
138
+ ````
139
+
140
+ ### Unsubscription
141
+ ````
142
+ stream.unsubscribe(["GOOG"], [Streamer.dataTypes.PRICEDATA], {}, then(function(result) {
143
+ ...
144
+ }
145
+ ````
146
+
147
+ Unsubscribe for symbols and data types. These can be either single strings or arrays of strings. An optional options object can also be passed in. Current available options include:
148
+ - conflation: Override default connection conflation, default to null. Should match a subscribe conflation.
149
+
150
+ ### Retrieve available number of symbols and connections, number of currently open connections and subscribed symbols.
151
+ ````
152
+ stream.getSessionStats();
153
+ ...
154
+ }
155
+ ````
156
+
157
+ ## Quotemedia Contact
134
158
  https://www.quotemedia.com/