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.




Leave a Reply

Your email address will not be published. Required fields are marked *