The Veles bot belongs to the category of DCA bots.
Dollar Cost Averaging is a method when you trade some asset (coin, or stock, or derivative) not as one action, but divide the total planned volume of purchase (or sale) into equal or unequal parts. This makes the average price of an asset purchased (or sold) more profitable for you.
For a Long deal it looks like “the price is falling, the position has negative PnL – and we are buying more”, as we are waiting for an upward turn (to execute the take profit order – sell everything purchased with profit). To average the price when it decreases, all our purchase orders are placed on the exchange in “steps”, that is, a grid. We also call all grid orders of the bot averaging orders, because it is the averaging that occurs when they are executed.
The deposit allocated to the bot for trading is multiplied by the leverage (if it is set so), and this amount is distributed between all the grid orders.
Let’s say that in your bot, the grid of averaging orders has 5 purchase orders placed at 20% of the coin price move downward. How many orders from the grid will be executed (one, two or all five) depends on the market. The more the price of a coin sinks down, the more orders it will achieve and execute.
A well-planned grid will be executed entirely only at the times of a sharp drop in the market. This means that the entire deposit will not be used in most cases.
An insufficiently secure grid (short one) will often be executed entirely, and the bot will regularly go to invest (a state where the bot’s deal is negative for a long time) – from where it may not return (or it will return unacceptably long, weeks and months).
Through the active deal card, you can always add additional averaging orders to the position, in addition to those already in the grid. This sometimes allows you to adjust the situation, exit the invest state, but requires a significant reserve of available funds.
At the same time, our bot can also be programmed for “normal” trading with one order, if there is such a desire (the trading mode is “Own”). Such trading just involves, for example, opening a long position in anticipation of a price increase (+ stop loss, which limits the loss if the price went wrong).
How is the average price calculated?
Let’s take the example of SOLUSDT (the Solana trading pair for USDT).
The user sets up the Long-bot with an overlap grid of 10%, including 3 orders.
At the current price of 143.65 USDT per SOL, we get:
- The first order will open at the price of 143.65 with a volume of 1.1 SOL (the upper green dash line)
- The second order will open at the price of 136.46 for a volume of 1.2 SOL (the middle green dash line)
- The third order will open at the price of 129.28 with a volume of 1.2 SOL (the lowest green dash line)
After executing all orders in the grid, the average price of a position (the blue dash line) with a volume of 3.5 SOL in this transaction will be 136.25 USDT per 1 SOL.
Now let’s change our bot – add 20% Martingale to the grid.
Our orders will be as follows (from the current price of 143.55):
- The first order will open at the price of 143.55 with a volume of 0.9 SOL
- The second order will open at the price of 136.37 for a volume of 1.2 SOL
- The third order will open at the price of 129.19 with a volume of 1.5 SOL
And due to the fact that each subsequent order is larger than the previous one (by 20%), after executing the entire purchase grid, we will have a 3.6 SOL position with an average price of 135.17 USDT. That is, we get more coin in a deal, and its average price is lower. And the point where we can profitably sell this coin will also be lower.
Averaging with Martingale and Logarithm
Martingale – increases the volume of each subsequent order in the grid. At the same time, the first orders come out smaller, since the total volume of the deal should not exceed the deposit set in the bot.
With this tool, deals are executed faster, because a smaller price rebound is needed to make a profit. But, if the deal does not collect all the orders in the grid, it brings a slightly lower profit, since only a part of the deposit is involved in it.
Logarithm – is a parameter that controls the indents of orders in the automatic grid. When the value is “>1” at the beginning of the grid orders are placed more densely, and with each executed order the distance between them increases more and more. Due to the fact that the number of orders at the beginning of the grid is greater, it is possible to gain a bigger position. When the value is “<1”, the orders are shifted to the end of the overlap, that is, the picture is mirrored – the further away from the entrance, the denser the orders are.
Manual position averaging – allows you to flexibly manage your deals if the grid turned out to be unsuitable. In this case, you can add any number of manual orders to the deal.
You can use this function when the grid has ended, or the distance between orders is too large – and the price does not reach either the grid order or take profit for a long time, and it becomes necessary to add volume to the transaction even before the grid is executed.