Documentation about bots

Bots will take decisions indicated by your strategy or perform the manual actions you have requested. There are three types of bots : backtests, real-time simulation bots and real-time bots.

Bot status

If a bot gets stuck in a state, feel free to contact the support at support@botcrypto.io !

Trading

In this part, we define elements which compose tradings part of our bots Don't hesitate to join us on discord if you have any questions

Orders

An order is a transaction (i.e. a trade). It's composed of the following attributes :

Asset quote/base

On the BTC/ETH market, the quote asset is BTC, the base asset is ETH. The order volume is always specified in the quote asset. On the BTC/ETH market, order volumes are always on BTC, i.e. we sell or buy BTC for ETH.

Trades

Orders taken by the bot are gathered on trades. Each orders are a part of a trade A trade is:

Necessarily, if the opening order is a buy order, the closing order is a sell order.

Gains

Gains are calculated as the following:

Current open orders Current trade - open order executed Finished trades - close order executed
Open order is a buying order
Gain in % - 100 * ( [market price / Executed buy price] * [1 - 2 * broker fees] - 1 ) 100 * ( [Executed sell price / Executed buy price] * [1 - 2 * broker fees] - 1 )
Asset quote gain 0 0 Executed buy volume - Executed sell volume
Less open order fees which are withdrawn on the quote asset
Base asset gain 0 0 Executed sell volume * Executed sell price - Executed buy volume * Executed buy price
Less open and close order fees which are withdrawn on the base asset
The open order is a sell order
Gain in % - 100 * ( [Executed sell Price / Market price] * [1 - 2 * broker fees] - 1 ) 100 * ( [Executed sell price / Executed buy price] * [1 - 2 * broker fees] - 1 )
Gain in quote asset 0 0 Executed buy volume - Executed sell volume
Less open and close order fees which are withdrawn on the quote asset
Gain on base asset 0 0 Executed sell volume * Executed sell price - Executed buy volume * Executed buy price
Less open and close order fees which are withdrawn on the base asset
The performance of a bot is the sum of the earnings of its trades.


Examples

On Kraken, broker fees are of 0.0024 (0.24%), we perform the next trade on ETH/EUR:

buy 1 @ 100 → sell 1 @ 110
(buy de 1 ETH at price of 100 and sell of 1 ETH at price of 110)
Current open order Current trade - open order executed Finished trade - closed order executed
Open order is a buy order
Gain in % - Hypothetical market price : 90
gain = 100 * ([90 / 100] * [1 - 2 * 0.0024] - 1)
gain = -10,432 %
gain = 100 * ([110 / 100] * [1 - 2 * 0.0024] - 1)
gain = 9,472 %
Quote asset gain 0 0 hypothétical fees of 0.0024 ETH
gain = 1 - 1 - 0.0024 ETH
gain = -0.0024 ETH
Base asset gain 0 0 hypothetical fees of 0.24 EUR
gain = 1 * 110 - 1 * 100 - 0.24 EUR
gain = 9.76 EUR

sell 1 @ 110 → buy 1 @ 100
(sell 1 ETH at a price of 110 and buy 1 ETH at a price of 100)
Current open order Current trade - open order executed Finished trade - closed order executed
The open order is a sell order
Gain in % - Hypothetical market price : 120
gain = 100 * ([110 / 120] * [1 - 2 * 0.0024] - 1)
gain = -8,77 %
gain = 100 * ([110 / 100] * [1 - 2 * 0.0024] - 1)
gain = 9,472 %
Quote asset gain 0 0 hypothetical fees of 0.0024 ETH
gain = 1 - 1 - 0.0024 ETH
gain = -0.0024 ETH
Base asset gain 0 0 hypothetical fees of 0.24 EUR
gain = 1 * 110 - 1 * 100 - 0.24 EUR
gain = 9.76 EUR


Engaged volumes

It's not possible for a bot to engage more volume that which is on it's API balance If a bot engage 100% of his available volume, we must ensure that he has enough volume to close the openned order. Take into account the broker fees applied during the execution of the closing order of the trade.

For example, I'm on kraken with 1 ETH and 0 EUR on my balance. I setup a bot on the ETH/EUR pair who dispose of 100% of the available volume.
If I sell at market price : sell 1 @ 100
My fees are 0.0024 ETH
My balance is now 0 ETH and 99.76 EUR
I cant' immediately close the trade with a requested volume of 1! My balance in EUR is not sufficient if the price is 100 ( I need 100,25 EUR to do that ).

That's why in a trade, volumes of open order and closed order slightly differs ! The bot take care of the fees applied during the opening order in the requested volume of the closing order It's possible for the bot to open and close immediately a trade.


Finally

Articles and advices to improve your results on blog.botcrypto.io school