Skip to content

Instantly share code, notes, and snippets.

Last active April 30, 2021 20:14
What would you like to do?
Dollar averaging buy 10 bitcoin in euro with kraken api and it's cli
set -e
# Install kraken cli ( and put this script in same path
# Make sure the following tools are installed: bc, jq
# To make a daily trade add this script in your cron
# Use offical pair, check them with ./ AssetPairs | jq
# Price to buy in your currency
CURRENT_PRICE=$(./ Ticker pair=$PAIR | jq .result.$PAIR.a[0] | bc -l)
VOLUME=$(echo "$BUY_PRICE / $CURRENT_PRICE" | bc -l)
./ AddOrder pair=$PAIR type=buy ordertype=market volume=$VOLUME
Copy link

mvanduijker commented Apr 30, 2021

add validate=true to last command to dry run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment