devarztv
v1.1.0
Published
CLI to fetch TradingView candlestick data for multiple pairs and multiple timeframes at once (multi-TF), JSON output, modern boxed terminal display.
Maintainers
Readme
devarztv
CLI to fetch TradingView candlestick data for multiple pairs and multiple timeframes at once (multi-TF), with JSON output and a modern, boxed terminal display.
Built for SMC/ICT trading workflows that need multi-timeframe data (e.g. HTF for structural bias + LTF for entries) without manually opening charts one by one.
© devarz — all rights reserved.
Installation
Global (recommended, so the dtv command can be called from anywhere)
npm install -g devarztvOr run directly without installing (npx)
npx devarztvNote:
dtvis the short bin name for thedevarztvpackage. If your environment (e.g. Termux) already has another globaldtvcommand installed, there will be a name conflict — uninstall the old one first or run vianpx devarztv.
Usage
After a global install, simply run:
dtvThe CLI will interactively ask for:
- Exchange mode — choose between typing the full
EXCHANGE:SYMBOLyourself for every pair, or setting a default exchange prefix to use for short symbols. - Default exchange prefix (only if you chose the prefix mode) — type any exchange you want, e.g.
OANDA,FX,FOREXCOM,BINANCE,NASDAQ. Not limited to OANDA. - Pairs — comma-separated.
In default-prefix mode, you can still override the prefix for any individual pair by typing its own# Manual mode (full symbol typed yourself): FX:XAUUSD,BINANCE:BTCUSDT,NASDAQ:AAPL # Default-prefix mode (e.g. prefix set to FOREXCOM): XAUUSD,EURUSD,GBPJPYEXCHANGE:— your explicit prefix is always respected over the default. - Timeframes — pick one or more from the list (1, 3, 5, 15, 30, 60, 120, 240, D, W, M) using the spacebar to multi-select.
- Custom timeframes — optional, if you need a timeframe outside the listed options.
- Number of candles (bars) — how much history to fetch per pair/timeframe combination (manual entry, max 5000).
- Output file name — the resulting
.jsonfile name.
Example session
$ dtv
devarztv — Multi-Pair Multi-Timeframe TradingView Fetcher
© devarz
? Enter pairs: XAUUSD,EURUSD
? Select timeframe(s): 15, 60, 240
? Custom timeframe(s): (empty)
? Number of candles: 500
? Output file name: gold_eur_mtf.json
✔ OANDA:XAUUSD @ 15 -> 500 candles
✔ OANDA:XAUUSD @ 60 -> 500 candles
✔ OANDA:XAUUSD @ 240 -> 500 candles
✔ OANDA:EURUSD @ 15 -> 500 candles
✔ OANDA:EURUSD @ 60 -> 500 candles
✔ OANDA:EURUSD @ 240 -> 500 candles
[summary table]
[result box: saved file, duration, success/fail count]JSON output format
{
"generatedAt": "2026-06-21T07:00:00.000Z",
"pairs": ["OANDA:XAUUSD"],
"timeframes": ["15", "60"],
"barsRequested": 500,
"results": [
{
"symbol": "OANDA:XAUUSD",
"timeframe": "15",
"success": true,
"name": "GOLD",
"currency": "USD",
"count": 500,
"candles": [
{
"time": 1718870400,
"timeISO": "2026-06-20T08:00:00.000Z",
"open": 2345.5,
"high": 2348.1,
"low": 2344.0,
"close": 2346.7,
"volume": null
}
]
}
]
}Candles are sorted ascending (oldest → newest) within each pair/timeframe combination.
Using it as a library (optional)
Besides the CLI, the core fetcher module can also be used directly in Node.js code:
const { fetchMulti } = require('devarztv/src/fetcher');
(async () => {
const data = await fetchMulti({
pairs: ['OANDA:XAUUSD', 'OANDA:EURUSD'],
timeframes: ['15', '60'],
bars: 300,
});
console.log(data.results);
})();Troubleshooting
Permission denied when running dtv (especially on Termux/Android)
This package already includes a postinstall script that automatically sets executable permission on bin/dtv.js. But if you still hit this error (e.g. npm was run with --ignore-scripts, or permission got reset after a manual update), run:
chmod +x $(which dtv)or if you know the global install location:
chmod +x /data/data/com.termux/files/usr/bin/dtvinquirer.prompt is not a function or another error when the prompt starts
Run in debug mode to see the full error details:
DEBUG=1 dtvNotes
- TradingView's public data (no login required) is sufficient for most common forex/crypto pairs.
- For private/premium data access, set the
SESSIONandSIGNATUREenvironment variables (thesessionid&signaturecookies from a TradingView account) — this can be extended further as needed. - Candle data library:
@mathieuc/tradingview.
License
MIT © devarz
