Ventures of an ex indie game developer

Building a cryptocurrency trading bot tutorial, step 5/4

All the measures are belong to me right now, and as a result I've discovered some general guidelines in the alt-coin trading world:
  • Currencies which do well in the long term are mostly in the lower price range. So are unfortunately the currencies which do poorly as well, but not to the same extent.
  • The 1-minute "low" kline is a lot better indicator than the 1-minute "close" kline on future price development.
  • A mean over time of the volume as well as the "taker buy base asset volume" kline (as supplied by Binance) are both positively correlated with long term profits, and negatively with losses.
  • The "quote asset volume" and the "taker buy quote asset volume" are however only correlated with poor coins; negatively with respect to profit.

Thus the advice for the manual trader is: buy coins with low prices and high volumes. Only look at the lows in you candle graphs (sorta like Heikin-Ashi, but throwing away 75% of the information).

Ok, so let's test my claims; do they hold up in practice - or at least did they up until now? This is where it gets interesting, and the results caught me aback, let's see if you feel the same.

So let's fetch some month-old data and check (the dates are a few days back, as I have everything stashed on disk so I don't need to fetch more right now). If you follow my tuts in this blog, you could easily write your own loading function.
# load into pandas' dataframes
dfs = load_currencies(currencies, start_t='2018-03-19', end_t='2018-04-18', cache=True)
I load the 111 coins that were active in Binance a month ago.

Now we want to find the best candidates, which means we need to normalize price, volume and buy base asset volume so we can weight them. So we loop through our coins and pick out the mean of price, volume and so forth.
df_gather = pd.DataFrame()
for df in dfs:
    price    = df.loc[1000:2000,'lo'].mean()
    volume   = df.loc[1000:2000,'volume'].mean()
    buy_base = df.loc[1000:2000,'buy_base'].mean()
    df_gather = df_gather.append([{'price': price, 'volume':volume, 'buy_base':buy_base}])
Now we're ready to setup our weights. Let's say we think that price is four times a important as either of the other ones (feel free to pick your own magic number depending on what correlation you find with other values).
df_stats = df_gather.describe()
price_weight    = 4 / df_stats.loc['mean', 'price']
volume_weight   = 1 / df_stats.loc['mean', 'volume']
buy_base_weight = 1 / df_stats.loc['mean', 'buy_base']
In order to find the best ones, we want to sort according to those weights, so join our currency name and data together, type in our sorting algorithm and sort.
# join names and data, so we can keep track of it when sorting
data = list(zip(currencies,dfs))
# sorting function takes weights into account
def srt(e):
    currency,df = e
    price    = df.loc[1000:2000,'lo'].mean()
    vol      = df.loc[1000:2000,'volume'].mean()
    buy_base = df.loc[1000:2000,'buy_base'].mean()
    return price*price_weight + volume*volume_weight + buy_base*buy_base_weight
# go ahead and figure out which coin is best
data = sorted(data, key=srt)
All that remains is printing out our probable winners and loosers:
print('best 10:')
for currency,df in data[:10]:
    profit_percent = 100 * df['close'].iloc[-1] / df['close'].iloc[1000] - 100
    print('  %s %+i%%' % (currency, profit_percent))
print('worst 10:')
for currency,df in data[-10:]:
    profit_percent = 100 * df['close'].iloc[-1] / df['close'].iloc[1000] - 100
    print('  %s %+i%%' % (currency, profit_percent))
And interestingly the result is this:
best 10:
  sonm/btc +36%
  singulardtv/btc +58%
  yoyow/btc +44%
  agrello/btc +34%
  oax/btc +27%
  basic-attention/btc +57%
  bread/btc +40%
  bluzelle/btc +67%
  poa/btc +93%
  loopring/btc +123%
worst 10:
  bitcoin-gold/btc -5%
  neo/btc +8%
  nucleus-vision/btc +38%
  litecoin/btc -10%
  monero/btc +8%
  zcash/btc +3%
  tron/btc +48%
  digixdao/btc -28%
  dash/btc +5%
  bitconnect/btc -9%
Aha! If or you'd have bet Ƀ0.1 on each those coins you'd be Ƀ0.579 richer today. A monthly interest of 58% sounds crazy, but even more so when you note that the market cap (or "index" if you will) went up by less than 11% in that period.

Given that this is true for the next month too, what coins should you bet on? With some slight modifications of the script you'll come up with these:
  • airswap
  • app-coin
  • bitshares
  • decentraland
  • request-network
  • singulardtv
  • sonm
  • tierion
  • vibe
  • wings
The golden days of alt-coins is back for now, and while financial institutions will keep on hitting hard, this market is here to stay. The genie is out of the box, and too true to die. And too lucrative.

About the author

Mitt foto
Gothenburg, Sweden