1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "symbols": [
12 "AAPL",
13 "MSFT",
14 "NVDA"
15 ],
16 "rule": {
17 "name": "Daily KD golden cross + weekly KD crossing",
18 "entry": {
19 "all": [
20 {
21 "tf": "D",
22 "ind": "kd",
23 "params": {
24 "n": 9
25 },
26 "event": "cross_above",
27 "a": "K",
28 "b": "D",
29 "within": 1
30 },
31 {
32 "tf": "W",
33 "ind": "kd",
34 "params": {
35 "n": 9
36 },
37 "event": "cross_above_or_approaching",
38 "a": "K",
39 "b": "D",
40 "within": 2,
41 "pre_bars": 3
42 }
43 ]
44 }
45 },
46 "fundamentalDelaySeconds": 0.3
47};
48
49
50const run = await client.actor("yzy001/technical-stock-screener").call(input);
51
52
53console.log('Results from dataset');
54console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
55const { items } = await client.dataset(run.defaultDatasetId).listItems();
56items.forEach((item) => {
57 console.dir(item);
58});
59
60