-
-
Save rleons/a2ad2172f42c033ab72883763a9f5526 to your computer and use it in GitHub Desktop.
Use the Nefertiti crypto bot and trade on all market pairs of the specified quote with a single click.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Trade on all the market pairs of the specified quote currency. | |
| # Written by Stefan van As <[email protected]> | |
| # Example: ./ETH-XXX-2.sh --exchange=Bittrex --quote=ETH --price=0.05 --pushover-app-key=X --pushover-user-key=X | |
| for i in "$@" | |
| do | |
| case $i in | |
| --exchange=*) | |
| EXCHANGE="${i#*=}" | |
| shift # past argument=value | |
| ;; | |
| --quote=*) | |
| QUOTE="${i#*=}" | |
| shift # past argument=value | |
| ;; | |
| --price=*) | |
| PRICE="${i#*=}" | |
| shift # past argument=value | |
| ;; | |
| --pushover-app-key=*) | |
| PUSHOVER_APP_KEY="${i#*=}" | |
| shift # past argument=value | |
| ;; | |
| --pushover-user-key=*) | |
| PUSHOVER_USER_KEY="${i#*=}" | |
| shift # past argument=value | |
| ;; | |
| *) | |
| # unknown option | |
| ;; | |
| esac | |
| done | |
| if [ -z ${EXCHANGE+x} ]; then | |
| echo "missing argument: --exchange"; | |
| exit 1 | |
| fi | |
| if [ -z ${QUOTE+x} ]; then | |
| echo "missing argument: --quote"; | |
| exit 1 | |
| fi | |
| if [ -z ${PRICE+x} ]; then | |
| echo "missing argument: --price"; | |
| exit 1 | |
| fi | |
| if [ -z ${PUSHOVER_APP_KEY+x} ]; then | |
| echo "missing argument: --pushover-app-key"; | |
| exit 1 | |
| fi | |
| if [ -z ${PUSHOVER_USER_KEY+x} ]; then | |
| echo "missing argument: --pushover-user-key"; | |
| exit 1 | |
| fi | |
| MARKETS=$(./cryptotrader markets --exchange=$EXCHANGE) | |
| if [ $? != 0 ]; then | |
| echo $MARKETS | |
| exit $? | |
| fi | |
| SYMBOLS="" | |
| for MARKET in $(echo $MARKETS | jq -r --arg QUOTE "$QUOTE" '.[] | |
| | select(.name | endswith($QUOTE)) | .name'); do | |
| if [[ $SYMBOLS != "" ]]; then | |
| SYMBOLS+=, | |
| fi | |
| SYMBOLS+=$MARKET | |
| done | |
| osascript -e 'on run argv | |
| tell application "Terminal" | |
| activate | |
| set ct to do script ("cd " & item 1 of argv) | |
| delay 1 | |
| do script ("./cryptotrader buy" & " --exchange=" & item 2 of argv & " --market=" & item 3 of argv & " --price=" & item 4 of argv & " --pushover-app-key=" & item 5 of argv & " --pushover-user-key=" & item 6 of argv & " --top=2 --dca --repeat=4") in ct | |
| end tell | |
| end run' $PWD $EXCHANGE $SYMBOLS $PRICE $PUSHOVER_APP_KEY $PUSHOVER_USER_KEY |
Author
rleons
commented
Apr 6, 2021
- Included --quote argument in order to be able and use with any quote currency.
- SYMBOLS for loop was slow, since it initiated one cryptotrader instance for each market, modified loop by filtering markets with jq.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment