@oanda/labs-sentiment-widget 1.0.66 → 1.0.68
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/CHANGELOG.md +516 -0
- package/dist/main/SentimentWidget/Tool.js +11 -4
- package/dist/main/SentimentWidget/Tool.js.map +1 -1
- package/dist/main/SentimentWidget/Widget.js +15 -5
- package/dist/main/SentimentWidget/Widget.js.map +1 -1
- package/dist/main/constant.js +2 -1
- package/dist/main/constant.js.map +1 -1
- package/dist/main/gql/getInstrumentSentiment.js +1 -1
- package/dist/main/gql/getInstrumentSentiment.js.map +1 -1
- package/dist/main/gql/getSentimentList.js +1 -1
- package/dist/main/gql/getSentimentList.js.map +1 -1
- package/dist/main/gql/types/gql.js +2 -2
- package/dist/main/gql/types/gql.js.map +1 -1
- package/dist/main/gql/types/graphql.js +55 -1
- package/dist/main/gql/types/graphql.js.map +1 -1
- package/dist/main/translations/sources/en.json +3 -1
- package/dist/main/translations/sources/zh_TW.json +3 -1
- package/dist/module/SentimentWidget/Tool.js +13 -6
- package/dist/module/SentimentWidget/Tool.js.map +1 -1
- package/dist/module/SentimentWidget/Widget.js +17 -7
- package/dist/module/SentimentWidget/Widget.js.map +1 -1
- package/dist/module/constant.js +2 -1
- package/dist/module/constant.js.map +1 -1
- package/dist/module/gql/getInstrumentSentiment.js +1 -1
- package/dist/module/gql/getInstrumentSentiment.js.map +1 -1
- package/dist/module/gql/getSentimentList.js +1 -1
- package/dist/module/gql/getSentimentList.js.map +1 -1
- package/dist/module/gql/types/gql.js +2 -2
- package/dist/module/gql/types/gql.js.map +1 -1
- package/dist/module/gql/types/graphql.js +54 -0
- package/dist/module/gql/types/graphql.js.map +1 -1
- package/dist/module/translations/sources/en.json +3 -1
- package/dist/module/translations/sources/zh_TW.json +3 -1
- package/dist/types/SentimentWidget/utils.d.ts +1 -0
- package/dist/types/constant.d.ts +2 -1
- package/dist/types/gql/types/gql.d.ts +4 -4
- package/dist/types/gql/types/graphql.d.ts +92 -15
- package/package.json +3 -3
- package/src/SentimentWidget/Tool.tsx +21 -4
- package/src/SentimentWidget/Widget.tsx +35 -23
- package/src/constant.ts +3 -1
- package/src/gql/getInstrumentSentiment.ts +1 -0
- package/src/gql/getSentimentList.ts +1 -0
- package/src/gql/types/gql.ts +4 -4
- package/src/gql/types/graphql.ts +108 -20
- package/src/translations/sources/en.json +3 -1
- package/src/translations/sources/zh_TW.json +3 -1
- package/test/Widget.test.tsx +4 -4
- package/test/sortData.test.ts +42 -12
package/src/gql/types/graphql.ts
CHANGED
|
@@ -22,6 +22,46 @@ export type AssetClass = {
|
|
|
22
22
|
name?: Maybe<Scalars['String']['output']>;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
export enum BookType {
|
|
26
|
+
Order = 'ORDER',
|
|
27
|
+
Position = 'POSITION'
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export enum CurrencyName {
|
|
31
|
+
Aud = 'AUD',
|
|
32
|
+
Cad = 'CAD',
|
|
33
|
+
Chf = 'CHF',
|
|
34
|
+
Eur = 'EUR',
|
|
35
|
+
Gbp = 'GBP',
|
|
36
|
+
Jpy = 'JPY',
|
|
37
|
+
Nzd = 'NZD',
|
|
38
|
+
Usd = 'USD'
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type CurrencyPower = {
|
|
42
|
+
__typename?: 'CurrencyPower';
|
|
43
|
+
/** UTC Timestamp */
|
|
44
|
+
point: Scalars['String']['output'];
|
|
45
|
+
price: Scalars['Float']['output'];
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type CurrencyPowerBalance = {
|
|
49
|
+
__typename?: 'CurrencyPowerBalance';
|
|
50
|
+
currency: CurrencyName;
|
|
51
|
+
power: Array<CurrencyPower>;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export enum CurrencyPowerBalanceTimeUnit {
|
|
55
|
+
CurrentDay = 'CURRENT_DAY',
|
|
56
|
+
H4 = 'H4',
|
|
57
|
+
H8 = 'H8',
|
|
58
|
+
H24 = 'H24',
|
|
59
|
+
M1 = 'M1',
|
|
60
|
+
M3 = 'M3',
|
|
61
|
+
PreviousDay = 'PREVIOUS_DAY',
|
|
62
|
+
W1 = 'W1'
|
|
63
|
+
}
|
|
64
|
+
|
|
25
65
|
export enum DataSource {
|
|
26
66
|
Ny4 = 'NY4',
|
|
27
67
|
Ty3 = 'TY3'
|
|
@@ -57,7 +97,7 @@ export type OrderPositionData = {
|
|
|
57
97
|
buckets: Array<Maybe<OrderPositionBucket>>;
|
|
58
98
|
dataSource?: Maybe<Scalars['String']['output']>;
|
|
59
99
|
instrument: Scalars['String']['output'];
|
|
60
|
-
price
|
|
100
|
+
price?: Maybe<Scalars['Float']['output']>;
|
|
61
101
|
region?: Maybe<Scalars['String']['output']>;
|
|
62
102
|
time: Scalars['String']['output'];
|
|
63
103
|
unixTime: Scalars['Int']['output'];
|
|
@@ -66,13 +106,15 @@ export type OrderPositionData = {
|
|
|
66
106
|
export type Query = {
|
|
67
107
|
__typename?: 'Query';
|
|
68
108
|
assetClasses?: Maybe<Array<Maybe<AssetClass>>>;
|
|
69
|
-
|
|
70
|
-
|
|
109
|
+
currencyPowerBalance?: Maybe<Array<CurrencyPowerBalance>>;
|
|
110
|
+
orderPositionBooks: Array<Maybe<OrderPositionData>>;
|
|
71
111
|
sentiment?: Maybe<Array<SentimentInstrument>>;
|
|
72
112
|
sentimentList?: Maybe<Array<SentimentInstrument>>;
|
|
73
113
|
topicalInstruments?: Maybe<Array<TopicalInstrument>>;
|
|
74
114
|
topicalInstrumentsCharts?: Maybe<Array<TopicalInstrumentChart>>;
|
|
75
115
|
topicalInstrumentsTotalCount: Scalars['Int']['output'];
|
|
116
|
+
volatilityChart?: Maybe<Array<Maybe<VolatilityChart>>>;
|
|
117
|
+
volatilityChartAssetClasses?: Maybe<Array<VolatilityChartAssetClass>>;
|
|
76
118
|
};
|
|
77
119
|
|
|
78
120
|
|
|
@@ -81,15 +123,13 @@ export type QueryAssetClassesArgs = {
|
|
|
81
123
|
};
|
|
82
124
|
|
|
83
125
|
|
|
84
|
-
export type
|
|
85
|
-
|
|
86
|
-
instrument: Scalars['String']['input'];
|
|
87
|
-
recentHours?: InputMaybe<Scalars['Int']['input']>;
|
|
88
|
-
region?: InputMaybe<Region>;
|
|
126
|
+
export type QueryCurrencyPowerBalanceArgs = {
|
|
127
|
+
timeUnit: CurrencyPowerBalanceTimeUnit;
|
|
89
128
|
};
|
|
90
129
|
|
|
91
130
|
|
|
92
|
-
export type
|
|
131
|
+
export type QueryOrderPositionBooksArgs = {
|
|
132
|
+
bookType: BookType;
|
|
93
133
|
dataSource?: InputMaybe<DataSource>;
|
|
94
134
|
instrument: Scalars['String']['input'];
|
|
95
135
|
recentHours?: InputMaybe<Scalars['Int']['input']>;
|
|
@@ -128,6 +168,19 @@ export type QueryTopicalInstrumentsTotalCountArgs = {
|
|
|
128
168
|
sort: TopicalSort;
|
|
129
169
|
};
|
|
130
170
|
|
|
171
|
+
|
|
172
|
+
export type QueryVolatilityChartArgs = {
|
|
173
|
+
division?: InputMaybe<Division>;
|
|
174
|
+
instrument: Scalars['String']['input'];
|
|
175
|
+
timeSpan: VolatilityChartTimeSpan;
|
|
176
|
+
timeUnit: VolatilityChartTimeUnit;
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
export type QueryVolatilityChartAssetClassesArgs = {
|
|
181
|
+
division?: InputMaybe<Division>;
|
|
182
|
+
};
|
|
183
|
+
|
|
131
184
|
export enum Region {
|
|
132
185
|
Amer = 'AMER',
|
|
133
186
|
Apac = 'APAC',
|
|
@@ -145,6 +198,7 @@ export type SentimentInstrument = {
|
|
|
145
198
|
displayName: Scalars['String']['output'];
|
|
146
199
|
name: Scalars['String']['output'];
|
|
147
200
|
sentiment: Sentiment;
|
|
201
|
+
updatedAt: Scalars['String']['output'];
|
|
148
202
|
};
|
|
149
203
|
|
|
150
204
|
export enum Sort {
|
|
@@ -156,7 +210,7 @@ export type TopicalInstrument = {
|
|
|
156
210
|
__typename?: 'TopicalInstrument';
|
|
157
211
|
displayName: Scalars['String']['output'];
|
|
158
212
|
name: Scalars['String']['output'];
|
|
159
|
-
sentiment:
|
|
213
|
+
sentiment: Sentiment;
|
|
160
214
|
updatedAt: Scalars['String']['output'];
|
|
161
215
|
};
|
|
162
216
|
|
|
@@ -166,12 +220,6 @@ export type TopicalInstrumentChart = {
|
|
|
166
220
|
name: Scalars['String']['output'];
|
|
167
221
|
};
|
|
168
222
|
|
|
169
|
-
export type TopicalInstrumentSentiment = {
|
|
170
|
-
__typename?: 'TopicalInstrumentSentiment';
|
|
171
|
-
longPercent: Scalars['Float']['output'];
|
|
172
|
-
shortPercent: Scalars['Float']['output'];
|
|
173
|
-
};
|
|
174
|
-
|
|
175
223
|
export enum TopicalSort {
|
|
176
224
|
Bearish = 'BEARISH',
|
|
177
225
|
Bullish = 'BULLISH',
|
|
@@ -180,21 +228,61 @@ export enum TopicalSort {
|
|
|
180
228
|
Volatile = 'VOLATILE'
|
|
181
229
|
}
|
|
182
230
|
|
|
231
|
+
export type VolatilityChart = {
|
|
232
|
+
__typename?: 'VolatilityChart';
|
|
233
|
+
pips: Scalars['Float']['output'];
|
|
234
|
+
/** Time point - hour in format hh:mm, Date in UTC, Week in format 'Mo' */
|
|
235
|
+
point: Scalars['String']['output'];
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
export type VolatilityChartAssetClass = {
|
|
239
|
+
__typename?: 'VolatilityChartAssetClass';
|
|
240
|
+
instruments: Array<VolatilityChartInstrument>;
|
|
241
|
+
name: Scalars['String']['output'];
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export type VolatilityChartInstrument = {
|
|
245
|
+
__typename?: 'VolatilityChartInstrument';
|
|
246
|
+
displayName: Scalars['String']['output'];
|
|
247
|
+
name: Scalars['String']['output'];
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
export enum VolatilityChartTimeSpan {
|
|
251
|
+
/** Valid for: H */
|
|
252
|
+
D5 = 'D5',
|
|
253
|
+
/** Valid for: H */
|
|
254
|
+
D10 = 'D10',
|
|
255
|
+
/** Valid for: D */
|
|
256
|
+
M1 = 'M1',
|
|
257
|
+
/** Valid for: D */
|
|
258
|
+
M3 = 'M3',
|
|
259
|
+
/** Valid for: W */
|
|
260
|
+
W5 = 'W5',
|
|
261
|
+
/** Valid for: W */
|
|
262
|
+
W10 = 'W10'
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export enum VolatilityChartTimeUnit {
|
|
266
|
+
D = 'D',
|
|
267
|
+
H = 'H',
|
|
268
|
+
W = 'W'
|
|
269
|
+
}
|
|
270
|
+
|
|
183
271
|
export type GetInstrumentSentimentQueryVariables = Exact<{
|
|
184
272
|
name: Scalars['String']['input'];
|
|
185
273
|
division?: InputMaybe<Division>;
|
|
186
274
|
}>;
|
|
187
275
|
|
|
188
276
|
|
|
189
|
-
export type GetInstrumentSentimentQuery = { __typename?: 'Query', sentiment?: Array<{ __typename?: 'SentimentInstrument', name: string, displayName: string, sentiment: { __typename?: 'Sentiment', shortPercent: number, longPercent: number } }> | null };
|
|
277
|
+
export type GetInstrumentSentimentQuery = { __typename?: 'Query', sentiment?: Array<{ __typename?: 'SentimentInstrument', name: string, displayName: string, updatedAt: string, sentiment: { __typename?: 'Sentiment', shortPercent: number, longPercent: number } }> | null };
|
|
190
278
|
|
|
191
279
|
export type GetSentimentListQueryVariables = Exact<{
|
|
192
280
|
division?: InputMaybe<Division>;
|
|
193
281
|
}>;
|
|
194
282
|
|
|
195
283
|
|
|
196
|
-
export type GetSentimentListQuery = { __typename?: 'Query', sentimentList?: Array<{ __typename?: 'SentimentInstrument', name: string, displayName: string, sentiment: { __typename?: 'Sentiment', shortPercent: number, longPercent: number } }> | null };
|
|
284
|
+
export type GetSentimentListQuery = { __typename?: 'Query', sentimentList?: Array<{ __typename?: 'SentimentInstrument', name: string, displayName: string, updatedAt: string, sentiment: { __typename?: 'Sentiment', shortPercent: number, longPercent: number } }> | null };
|
|
197
285
|
|
|
198
286
|
|
|
199
|
-
export const GetInstrumentSentimentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetInstrumentSentiment"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"division"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Division"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sentiment"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"Argument","name":{"kind":"Name","value":"division"},"value":{"kind":"Variable","name":{"kind":"Name","value":"division"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"sentiment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"shortPercent"}},{"kind":"Field","name":{"kind":"Name","value":"longPercent"}}]}}]}}]}}]} as unknown as DocumentNode<GetInstrumentSentimentQuery, GetInstrumentSentimentQueryVariables>;
|
|
200
|
-
export const GetSentimentListDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSentimentList"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"division"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Division"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sentimentList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"division"},"value":{"kind":"Variable","name":{"kind":"Name","value":"division"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"sentiment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"shortPercent"}},{"kind":"Field","name":{"kind":"Name","value":"longPercent"}}]}}]}}]}}]} as unknown as DocumentNode<GetSentimentListQuery, GetSentimentListQueryVariables>;
|
|
287
|
+
export const GetInstrumentSentimentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetInstrumentSentiment"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"name"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"division"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Division"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sentiment"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"name"},"value":{"kind":"Variable","name":{"kind":"Name","value":"name"}}},{"kind":"Argument","name":{"kind":"Name","value":"division"},"value":{"kind":"Variable","name":{"kind":"Name","value":"division"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"sentiment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"shortPercent"}},{"kind":"Field","name":{"kind":"Name","value":"longPercent"}}]}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<GetInstrumentSentimentQuery, GetInstrumentSentimentQueryVariables>;
|
|
288
|
+
export const GetSentimentListDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSentimentList"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"division"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Division"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sentimentList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"division"},"value":{"kind":"Variable","name":{"kind":"Name","value":"division"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"sentiment"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"shortPercent"}},{"kind":"Field","name":{"kind":"Name","value":"longPercent"}}]}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<GetSentimentListQuery, GetSentimentListQueryVariables>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"data_unavailable": "Data unavailable",
|
|
3
|
+
"last_updated": "Last updated",
|
|
3
4
|
"net_long": "Net-long",
|
|
4
5
|
"net_short": "Net-short",
|
|
5
|
-
"pagination_entries_range": "{{firstItemOnPage}}-{{lastItemOnPage}} of {{itemCount}} entries"
|
|
6
|
+
"pagination_entries_range": "{{firstItemOnPage}}-{{lastItemOnPage}} of {{itemCount}} entries",
|
|
7
|
+
"today": "Today"
|
|
6
8
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"data_unavailable": "沒有數據",
|
|
3
|
+
"last_updated": "最後更新",
|
|
3
4
|
"net_long": "淨長倉",
|
|
4
5
|
"net_short": "淨短倉",
|
|
5
|
-
"pagination_entries_range": "{{itemCount}}个挂单中的{{firstItemOnPage}}-{{lastItemOnPage}}"
|
|
6
|
+
"pagination_entries_range": "{{itemCount}}个挂单中的{{firstItemOnPage}}-{{lastItemOnPage}}",
|
|
7
|
+
"today": "今日"
|
|
6
8
|
}
|
package/test/Widget.test.tsx
CHANGED
|
@@ -26,8 +26,8 @@ const mocks = [
|
|
|
26
26
|
longPercent: 34,
|
|
27
27
|
shortPercent: 66,
|
|
28
28
|
},
|
|
29
|
-
|
|
30
|
-
],
|
|
29
|
+
updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
30
|
+
}],
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
},
|
|
@@ -51,8 +51,8 @@ const zeroPercentMocks = [
|
|
|
51
51
|
longPercent: 0,
|
|
52
52
|
shortPercent: 0,
|
|
53
53
|
},
|
|
54
|
-
|
|
55
|
-
],
|
|
54
|
+
updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
55
|
+
}],
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
58
|
},
|
package/test/sortData.test.ts
CHANGED
|
@@ -10,6 +10,7 @@ const data = {
|
|
|
10
10
|
longPercent: 20,
|
|
11
11
|
shortPercent: 80,
|
|
12
12
|
},
|
|
13
|
+
updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
13
14
|
},
|
|
14
15
|
{
|
|
15
16
|
name: 'GBP/USD',
|
|
@@ -18,6 +19,7 @@ const data = {
|
|
|
18
19
|
longPercent: 30,
|
|
19
20
|
shortPercent: 70,
|
|
20
21
|
},
|
|
22
|
+
updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
21
23
|
},
|
|
22
24
|
{
|
|
23
25
|
name: 'USD/CHF',
|
|
@@ -26,6 +28,7 @@ const data = {
|
|
|
26
28
|
longPercent: 15,
|
|
27
29
|
shortPercent: 85,
|
|
28
30
|
},
|
|
31
|
+
updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
29
32
|
},
|
|
30
33
|
{
|
|
31
34
|
name: 'EUR/USD',
|
|
@@ -34,6 +37,7 @@ const data = {
|
|
|
34
37
|
longPercent: 60,
|
|
35
38
|
shortPercent: 40,
|
|
36
39
|
},
|
|
40
|
+
updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
37
41
|
},
|
|
38
42
|
{
|
|
39
43
|
name: 'US30/USD',
|
|
@@ -42,6 +46,7 @@ const data = {
|
|
|
42
46
|
longPercent: 55,
|
|
43
47
|
shortPercent: 45,
|
|
44
48
|
},
|
|
49
|
+
updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
45
50
|
},
|
|
46
51
|
{
|
|
47
52
|
name: 'XAU/USD',
|
|
@@ -50,6 +55,7 @@ const data = {
|
|
|
50
55
|
longPercent: 90,
|
|
51
56
|
shortPercent: 10,
|
|
52
57
|
},
|
|
58
|
+
updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
53
59
|
},
|
|
54
60
|
],
|
|
55
61
|
};
|
|
@@ -59,24 +65,48 @@ describe('sortData function', () => {
|
|
|
59
65
|
const path = sortData(data, Sort.Bullish);
|
|
60
66
|
|
|
61
67
|
expect(path).toEqual([
|
|
62
|
-
{
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
{
|
|
69
|
+
name: 'XAU/USD', displayName: 'XAU/USD', sentiment: { longPercent: 90, shortPercent: 10 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'EUR/USD', displayName: 'EUR/USD', sentiment: { longPercent: 60, shortPercent: 40 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'US30/USD', displayName: 'US30/USD', sentiment: { longPercent: 55, shortPercent: 45 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'GBP/USD', displayName: 'GBP/USD', sentiment: { longPercent: 30, shortPercent: 70 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'AUD/CAD', displayName: 'AUD/CAD', sentiment: { longPercent: 20, shortPercent: 80 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'USD/CHF', displayName: 'USD/CHF', sentiment: { longPercent: 15, shortPercent: 85 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
85
|
+
},
|
|
68
86
|
]);
|
|
69
87
|
});
|
|
70
88
|
it('should return data sorted by bearish', () => {
|
|
71
89
|
const path = sortData(data, Sort.Bearish);
|
|
72
90
|
|
|
73
91
|
expect(path).toEqual([
|
|
74
|
-
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
{
|
|
78
|
-
|
|
79
|
-
|
|
92
|
+
{
|
|
93
|
+
name: 'USD/CHF', displayName: 'USD/CHF', sentiment: { longPercent: 15, shortPercent: 85 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'AUD/CAD', displayName: 'AUD/CAD', sentiment: { longPercent: 20, shortPercent: 80 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'GBP/USD', displayName: 'GBP/USD', sentiment: { longPercent: 30, shortPercent: 70 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: 'US30/USD', displayName: 'US30/USD', sentiment: { longPercent: 55, shortPercent: 45 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'EUR/USD', displayName: 'EUR/USD', sentiment: { longPercent: 60, shortPercent: 40 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'XAU/USD', displayName: 'XAU/USD', sentiment: { longPercent: 90, shortPercent: 10 }, updatedAt: '2023-12-02T10:00:08.509215576Z',
|
|
109
|
+
},
|
|
80
110
|
]);
|
|
81
111
|
});
|
|
82
112
|
});
|