Trading bot in golang that makes few trades with low risk management

How it works

In every price chart you can find what they call resistances and supports, especially in crypto charts. Those are special levels in which the price gets trapped, once the price gets over or under one key level we can expect that it will grow or fall to the next level.


Take profit and stop loss

In order to lower the risk, before opening a position, the bot set a takeprofit and a stoploss

  • The TAKEPROFIT is set to the next key level the price could go.

  • The STOPLOSS is set to the current level the price gets over/under

In this way we can limit the losses and maximize the profit!

So how to determine those areas and key levels?

We can observe the shadows of a group of candles and see if they shares a certain price area.


Another way to find interesting key levels is the Fibonacci retracement. (See

How to start the bot

The bot can be launched using the go run . [mode] command.

The mode can be:

  • live for predicting real time btc price and simulating LONG or SHORT positions

  • test to run a backtest and see the performance.

In the repo you can find the log.txt file that contains the test output of ~ 6 months of run. You can notice (searching for POSITION CLOSED) that the bot made few trades and only 1 of them resulted in a loss.


View Github