Gekko CLI users – it’s the TOML to JSON translator you’ve all be waiting for

As the Gekko community has grown more and more strategies are appearing which is super awesome. What can be a little frustrating is that most of these strategies provide TOML files (for using the Gekko UI). This seems like a small thing to translate right?

Well yes, if you’re downloading 1 strategy file, but what if you’re downloading one of the big strategy strategy repos such as  Gekko Strategies. There are at least 40 strategies in there and an installer (made by the owner of the original repo xFFFFF), and who wants to trawl through 40+ TOML files and rewrite them into JSON and add them to their config. Enter the TOML to JSON translator you’ve all been waiting for!

So what does this TOML to JSON config converter do?

It takes all the TOML files, converts them all into JSON that Gekko needs, then appends them to your Gekko config file meaning all you then need to do is change the config.tradingAdvisor.method to the new Strategy of choice and away you go, it will run in immediately without any hassle.

Added to the Bruteforce repo, the Gekko TOML to JSON converter script is pretty straight forward to use. Grab the Bruteforce repo and install it.

Before doing anything open the the file “toml-config-converter.js” and go to line 22 which looks like:

var strategiesFolder = ‘../gekko/config/strategies/’;
var configFile = ‘../gekko/config-new.js’;
var outputConfigFile = ‘../gekko/config-ready-to-use.js’;

This is the important part.

strategiesFolder is where all your TOML files are, this doesn’t have to be your Gekko/config/strategies file, it could be someones installed repo.

configFile is your default config file, typically it is from the vanilla Gekko install with your database and other base settings updated.

outputConfigFile is the new config that is generated by the TOML to JSON converter.

Note: do not make configFile and outputConfigFile the same file. I have no idea what will happen but I imagine nobody will hear your screams.

I should add that any TOML references to strategies with hyphens in (“-“) will be discarded and not copied across.




Gekko Nodejs Bruteforce backtester app

Do you want to run backtests against multiple candle sizes, coins, history sizes and store the data for every single run?

If the answer is yet then read on…

After getting a little bored of running backtests manually I wrote a new bruteforce backtester application for Gekko in Nodejs.  It’s pretty straight forward to setup, and writes everything you backtest into a nice and neat csv file that allows you to sort to find the most profitable settings. This is what it can do:

  1. Set multiple history periods
  2. Set multiple candle sizes
  3. Set multiple strategies
  4. Set multiple exchange and trading pairs
  5. Set random ranges for each strategy config
  6. Writes all outputs and strategy configs out into a csv so you can review what strat and related settings are going to make you the most cold hard crypto

I’ve put it on the Gekkowarez github and you can find all the install instructions there.

I guess there is an obvious question to answer; why use this instead of the Gekko Genetic Algorithm ?

Well it’s a fair question. I use this after having just built or come across a new trading strategy and I don’t know basics like;

What’s the right candle size?

What’s the right history setting?

What type of trading pair is this best for – high volume, usd or btc currency?

I can do a certain amount of optimization with the brute force approach as well. Ultimately, in about 10 minutes I’ve got a pretty clear picture of whether a trading strategy will work – and that’s a big win for me!

Of course, I will then turn to the GA when it’s time to get really optimal!

Example csv output can be found here:

Gekko Bruteforce backtester example output