Skip to content

Instantly share code, notes, and snippets.

@juanpabloaj
Last active December 9, 2021 12:19
Show Gist options
  • Save juanpabloaj/8fbfb3398ead388f7f8c14e71e58a50e to your computer and use it in GitHub Desktop.
Save juanpabloaj/8fbfb3398ead388f7f8c14e71e58a50e to your computer and use it in GitHub Desktop.
OHLC BTC
# pip install ohlc; apt install jq
# with other token, ohlcbtc ETHUSDT
ohlcbtc () {
token=${1:-BTCUSDT}
while true;
do
ohlc --pab --ha -n <( curl "https://api.binance.com/api/v3/klines?symbol=${token}&interval=1h" 2>/dev/null | jq -r '.[][1:5]|join(" ")' )
sleep 3600
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment