-
Notifications
You must be signed in to change notification settings - Fork 1
Bot documentation
The bot requires an API key with at least READ INFO and TRADE LIMIT permission. I am currently testing the bot, use at your own risk.
./bittrex -a ~/apikey -b
The bot will first check the database connection and if it can't connect to DB, it will exit. Depending on your value of MAX_ACTIVE_MARKETS (5 by default), the bot will trade on the top 5 markets (in Volume on the last 24h).
The bot starts one thread / market and will throw every minutes on the console (stderr, consider redirecting this output to some file) some indicators (RSI: Wilder/Bechu and MACD). When the thread starts, the bot gathers 28 minutes of history to init arrays used for RSI and MACD. The bot will query your BTC available and will divide your available BTC by the number of active markets (5 by default). It will trade with 99% of available BTC (to have some extra BTC available for the fees when buying).
So for example if you have 1 BTC in your BTC wallet, the bot will use 0.2BTC / thread.
If some API calls failed, they will also be shown on the console. The bot will also show BUY and SELL orders and will warn you if it did buy something but no opportunity to sell was found and show the loss(buy when RSI 14, in minutes, is lower than 30 and if the RSI in hour is lower than 60 and sell when RSI(14, mn) is greater than 70 or sell if the gain is > 1% whatever the RSI is). When the bot sells it also show the gain (which includes the fees of bittrex at buy and sell, both are 0.25%).
When the sell order is complete, the bot check the rank of the market(coin) on bittrex to see if its rank (in volume) has decreased. In this case, the thread ends. Otherwise it will wait for another opportunity to buy. The bot does not check (yet) for RSI divergence so it might buy when it should not.
Example of output:
./bittrex -a ~/apikey -b
Connected to Database(OK)
checking market performance of last day and hour (markets selection), using BTCs markets only
Selected Markets: BTC-ADA BTC-NBT BTC-ETH BTC-NEO BTC-XEM
BTC available for bot: 0.00981889
Started bot for market: BTC-ADA
Started bot for market: BTC-NBT
Started bot for market: BTC-ETH
Started bot for market: BTC-NEO
Started bot for market: BTC-XEM
After one minute, indicators start to show up:
Market: BTC-NEO, Wilder RSI: 44.95359859, Bechu RSI: 38.36391123, MACD: -0.00003895
Market: BTC-NBT, Wilder RSI: 53.59220323, Bechu RSI: 52.44107744, MACD: -0.00000026
Market: BTC-XEM, Wilder RSI: 35.76987774, Bechu RSI: 37.27272727, MACD: -0.00000019
Market: BTC-ADA, Wilder RSI: 35.87040794, Bechu RSI: 36.90476190, MACD: -0.00000018
Market: BTC-ETH, Wilder RSI: 16.57069250, Bechu RSI: 13.85211032, MACD: -0.00037986
Bittrex api servers are not perfect so you should also see some messages like
Error proccessing request: https://bittrex.com/api/v2.0/pub/market/GetTicks?marketName=BTC-XEM&tickInterval=oneMin, result field(array) empty. Retrying
Buy orders are shown like this
BUY BTC-XEM at 0.00003246, quantity: 60.49839803 (BTC: 0.00196378), fees: 0.00000491
BUY BTC-ADA at 0.00001853, quantity: 105.97830545 (BTC: 0.00196378), fees: 0.00000491
Sell orders are shown like this
SELL BTC-ETH at 0.06600558, quantity: 0.02996728, Gain: 0.00000928
To exit the bot, type STOP in the CLI (and press Enter), after max one minute, the threads will exit. If one thread did buy a coin when stop is called, the thread will place a sell order (+1% of buy value) before exiting.