Example of creating a DCA trading bot to Crypton Exchange. The bot gains a position, gradually averages it, and then creates a Take Profit order. Here is a simple trading cycle that the bot implements.
Inspired by this article.
The finished compiled version can be found on the ⬇️ https://github.com/Sagleft/utopist-trader/releases page.
How DCA bots are useful:
- It is a simplification of the way to invest: there is no need to study and use technical indicators, there is no need for complicated analysis.
- No cost to run the bot. Runs on your computer.
- No routine activities.
- Allows you to reduce the average entry point to the market.
The bot can be used as the basis for creating your own trading bots.
Trading is divided into equal time intervals. Let's say we chose the strategy - to buy. Then we can choose a trading pair, for example crp_usdt
. We must have a balance in USDT. The bot will buy some coins in each of the intervals, and then place a Take Profit order to sell them. If the Take Profit order is closed, then the trading cycle is complete and a new cycle begins.
If the price changes, the bot calculates whether to buy more, less or do nothing. The more the price rises, the less the bot buys, the more the price falls, the more the bot will buy.
This strategy is suitable both for buying a coin at the lowest price in time, and for the gradual sale. Or you can just use the bot to make money on volatility.
Just fill config.json
file.
More about the fields:
strategy
-buy
orsell
.profitPercent
- what % the bot will place Take Profit orders.tradePair
- trading pair.deposit
- the maximum amount that will be used by the bot in the trading cycle.exchange
- data to connect to the exchange.intervalTimeoutSeconds
- timeout between intervals when the bot will act.intervalDepositMaxPercent
- what is the maximum % of the deposit a bot is allowed to use in one interval.noWait
- whether to execute the bot action immediately at startup.debug
- enabling/disabling detailed logs.
- Forum thread - an opportunity to ask questions and discuss this bot.
- UDocs - collection of all documentation about Utopia API.
- Crypton Exchange - the exchange we work with.
- CRP.IS API - API docs.
just run
git clone https://github.com/Sagleft/utopist-trader
cd utopist-trader
go build
& run after config.json
setup:
./bot
just run bash build.sh
- recording of statistics on trading cycles;
- offset support for sending new orders after completing a lap;
- perhaps write an AI to self-learn from collected statistics.