Ventures of an ex indie game developer

Robotnics

Since my last post, 20 days ago, BitCoin is up 92%. My alt-currency trading robot is live since a couple of days, but I only understood and fixed some important settings yesterday. One idea I had was for the bot to be "greedy," i.e. to allow for various currencies to overdraw their part of the money pool. That might have been a good idea for non-volatile instruments, but when the base asset ("what you're comparing to") is BTC and BTC skyrockets, you get problems as everyone sells the alt-currencies to get their money back into BitCoin.

I've done all the coding and devopsing, but a friend of mine has invested 50% of the money and found a really good trading concept. And it's so much more fun doing projects together!

Since I corrected the last settings, this is the funds development (counted in BitCoins):


If this continues to work as normal, we're going to be back up at the top of the hill before the evening!

This is my advice to anyone interested in building a simple alt-currency trading bot:

  • Build everything quick and hackish. You're going to tweak it to pieces. I used Python and caching of files on disk to really kick things off with a trajectory. Don't go C and DB, you'll need more agility to get things rolling in a couple of weeks.
  • Spend 2 hours of manual trading per day for three-four days, so you learn the basics. I gained 50% BTC in a couple of days (mostly from luck).
  • Start by downloading historic data for a bunch of coins. I recommend using 15 minute resolution intervals; in my experience that pace is optimal. Manually pick a dozen or so which seem interesting.
  • Create a simulation, so you'll know if your idea works. The first iterations I recommend using simple MA, EMA, envelopes, thresholds and the like, and not use any AI. That way you'll both know the cause of any problems, and you'll have a baseline to compare with if you're going convolutional later on. I am still using traditional algos, and no AI yet.
  • Simulate your settings over time, use random values for all your parameters and search until you've found a good, hopefully global, maximum.
  • Simulate all currencies at once, so you find a commonality between the currencies which work for many scenarios.
  • Don't rate your settings based on maximum profit, as that could cause extreme fluctuations and also seems to make your fitting too close to what has happened in the past, and not work to well with what's coming in the future. Instead I recommend using some combination of profits and Sharpe ratio-ish. Also don't optimize for a single alt-currency, but spread your risks among a dozen, and optimize for the median. Here is a simulation optimization example for those versed in Python and Pandas:
# Last funds calculation as part of start funds value, and make sure to include a
# little bit of shakiness. Number 2 just picked from thin air.
sharpe_ratio_ish = lambda funds: funds.iloc[-1] / (funds[0] * (funds.std() + 2))
settings = Settings(optimize=np.median, fund_value=sharpe_ratio_ish)
currencies = ['metal', 'komodo', 'funfair', 'etherparty']
best_result = [-100] * len(currencies)
for _ in range(100):
    result = []
    for currency in currencies:
        df = load_currency(currency, now-60*days, now)
        simulate(df, settings)
        result += [settings.fund_value(df['funds'])]
    if settings.optimize(result) > settings.optimize(best_result):
        best_result = res
        best_settings = dict(settings)
    settings[some_key] = some_random_value # create new settings by randomizing here
  • Split your wallet so every alt-currency gets a chunk of it's own. I split it equal. Don't use a pool which can flow between alt-currencies, as you might rapidly increase your risk if most of your eggs flow into a few baskets.
  • Don't buy/sell 100% at once of any given currency. Keep it small (and possibly incremental).
  • Go where the simulation tells you: what coins to use, how to invest, how to mitigate drops, etc. Then follow that direction religiously.
  • Place the orders you think is best - and leave them be. Don't start chasing after buys or sells as they diverge from your simulation. There'll be more opportunities.
  • Keep it simple stupid.
  • Start the bot and lean back.
If you follow these straightforward rules, you'll probably be as rich as I soon am - good luck! :)

About the author

Mitt foto
Gothenburg, Sweden