1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "data": {
12 "open": [
13 150,
14 152.5,
15 151,
16 153.5,
17 155,
18 154,
19 156,
20 158.5,
21 157,
22 159
23 ],
24 "high": [
25 153,
26 154,
27 153.5,
28 156,
29 157,
30 156.5,
31 159,
32 160,
33 159.5,
34 162
35 ],
36 "low": [
37 149,
38 151,
39 150,
40 152,
41 153.5,
42 152.5,
43 154.5,
44 157,
45 156,
46 158
47 ],
48 "close": [
49 152,
50 151.5,
51 153,
52 154.5,
53 154,
54 155.5,
55 158,
56 157.5,
57 159,
58 161.5
59 ],
60 "volume": [
61 1000,
62 1200,
63 1100,
64 1300,
65 1250,
66 1400,
67 1500,
68 1450,
69 1600,
70 1550
71 ]
72 },
73 "indicators": [
74 {
75 "name": "SMA",
76 "params": {
77 "timeperiod": 3
78 }
79 },
80 {
81 "name": "RSI",
82 "params": {
83 "timeperiod": 14
84 }
85 }
86 ]
87};
88
89
90const run = await client.actor("ozito/technical-analysis-calculator").call(input);
91
92
93console.log('Results from dataset');
94console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
95const { items } = await client.dataset(run.defaultDatasetId).listItems();
96items.forEach((item) => {
97 console.dir(item);
98});
99
100