Rookie Awards 2024 - Open for Entries!
Crypto trading
Share

Crypto trading

by CallumHartley on 20 Apr 2022

Talking about Decision Making Mechanisms when implementing them in cryptocurrency trading robots.

0 552 0
Round of applause for our sponsors

Cryptocurrency robot decision-making mechanism

First, we need a variable that will store information about the current state of the bot. This is either BUY or SELL. A logical variable or an enumeration will be good for storing such data.

Then you need to specify threshold values for buying and selling operations. These values are expressed as percentage, they represent the increase or decrease of asset's price since the previous operation.

For example, if I bought something at $100, and the price is currently $102, we are dealing with a 2% price increase. If the threshold for a SELL operation is set to one percent price increase, then the bot will sell the asset when it sees this 2%, as it has already made a profit that exceeds the threshold we set.

In our case, such values will be constants. We will need 4 such values - 2 for each state of the bot.Building a cryptocurrency trading robot is a more complex undertaking. To get started, check out https://scammerwatch.com/ for an overview on trading robots to better understand algorithmic trading possibilities.

Thresholds for performing a BUY operation

DIP_THRESHOLD: the bot performs a buy operation if the price has decreased by a value greater than the DIP_THRESHOLD setting. The meaning of this is to implement a "buy low, sell high" strategy. That is, the bot will try to buy the asset at an undervalued price, waiting for the price to rise and the possibility of profitable sale of the asset.

UPWARD_TREND_THRESHOLD: The bot will buy the asset if the price has risen by more than the value set by this constant. This move contradicts the "buy low, sell high" philosophy. Its purpose is to detect an uptrend and not miss a buying opportunity before the price rises even more.

If we have executed a SELL operation at the time marked by the red SELL marker in the picture, the bot will then be guided by the DIP_THRESHOLD and UPWARD_TREND_THRESHOLD thresholds when making its BUY decision.

If price moves below the lower green line or above the upper green line, we will perform a BUY operation. In the situation shown in the picture, the price has moved above the upper limit. So we, using the UPWARD_TREND_THRESHOLD value, have performed a BUY operation.

Thresholds for performing an SELL operation 

PROFIT_THRESHOLD: The bot sells the asset if the price has become higher than the price calculated based on this value, as the asset was previously bought at a lower price. This is how we make a profit. We sell the asset at a price that is higher than the price at the time we bought it.

STOP_LOSS_THRESHOLD: In an ideal situation, we would like the bot to sell the asset only when the sale makes us a profit. But perhaps a strong market movement downwards has occurred. In such a situation, we would decide to exit the trade before incurring too big a loss and later buy the asset at a lower price. This threshold is used to close the position at a loss. The purpose of this operation is to prevent heavier losses.

This shows the situation where a BUY marker has been placed where a buy has been made. The price then reaches the limit set by PROFIT_THRESHOLD and we sell the asset at a profit. This is how bots make money.


Comments (0)

This project doesn't have any comments yet.