This script uses a browser (via puppeteer) to log into your QuantData account, visit a specified page that has time sliders, and then step through intervals and screenshot the page at each interval.
This is useful to, for example, view exposure graphs as they evolve throughout the day.
This requires a page in QuantData, with tools that contain a time slider control. The script does not do any setup of your tools (dates, filters, etc), you should manually set up the page for the conditions that you want to see.
Node.js is required.
Download index.js
and package.json
to the same directory. Downloading the zip from this gist and extracting it somewhere should work well. Run npm install
from that directory to install the dependencies.
node index.js
will run the script.
Options:
Usage: index [options]
Options:
-u, --user <username> QuantData username
-p, --password <password> QuantData password
-q, --page <page> QuantData page to visit
-s, --start <start> Start minute (default: 510)
-e, --end <end> End minute (default: 960)
-i, --interval <interval> Interval (minutes) (default: 5)
-d, --delay <delay> Delay before screenshot (ms) (default: 1500)
-o, --output <output> Output directory (default: "2025-01-26T03-55-11")
-x, --display Display browser window (default: false)
-h, --help display help for command
The defaults are reasonable and will capture a time lapse of a full trading day in 5 minute intervals. It assumes you have eastern time zone selected in QD. If you are using a different time zone, you will have to adjust your --start
and --end
options accordingly.
--start
and --end
are minutes from 0 to 1440 (for a 24-hour day), and define a time frame for which screenshots are generated.
--page
is the full URL to a built-in or custom QuantData page.
--username
, --password
, and --page
are required.
Screenshots are saved to a directory with a default name that is the time when the script was started.
It is recommended to specify your own directory name, that identifies what it is you are investigating. For example, spx-2025-01-24
I have set up a page in QD with exposure graphs, and now I want to see how they evolved between noon and 2PM (ET) in 10 minute intervals
node index.js -u myuser -p mypassword --page https://v3.quantdata.us/page/built-in/exposure -s 720 -e 840 -i 10