Crunch Series is a platform that ties into CoinBase to offer a suite of algorithmic trading tools. Our framework enables you to write a trading bot and get an in-depth realtime analysis on its performance in historical and realtime simulations.
In simulation mode, CoinBase's APIs offer accurate estimations of what you'd expect to pay for a transaction. In Back Test mode you can specify a transaction fee and an average market spread in the settings to help approximate the true performance of your bot.
Bellow is a silly example bot
bot.setInit(function (context) {
/* context persists through the life of the bot */
context.count = 0;
});
/* data = {
price: $,
time: millisecond epoch timestamp,
balance: {usd: $, btc: B⃦},
orderResult: {
usdDelta: #,
btcDelta: #,
estimatedPrice: #,
realPrice: #
}
}
*/
bot.useStat(function (data, stats, context) {
stats.halfPrice = data.price / 2;
stats.combined = {
rand: Math.random() * data.price,
price: data.price
};
});
bot.useStat(function (data, stats, context) {
if (stats.combined.rand > 5) context.count += 1;
});
// ...
bot.useStat(function (data, stats, context) {
stats.silly = stats.halfPrice * context.count;
});
bot.setStrategy(function (data, stats, context) {
if (stats.silly > 20) bot.buy(1); // buy 1 btc
if (stats.combined.rand > 4) bot.sell(1); // sell 1 btc
});
The framework displays every statistic, those nested in a dictionary share a chart.
Log in or sign up for Devpost to join the conversation.