EN fortrader
10 May, 2026

The Averaging Algorithm: Beating the Market

Belyaov

There are countless mechanical trading systems for financial trading, but each has what is called a “Achilles’ heel”: when a negative situation develops on the exchange, the system fails. This is not surprising, since each of these systems assumes that the market will move in a direction opposite to the open positions, estimating the maximum distance the rate will likely travel almost “by eye.” Such an assumption cannot be correct. It is natural, as it is impossible to predict movement, its intensity, speed, and the expected correction in principle. Attempts have been made, but none have achieved a definitive success. Errors occur frequently and sometimes lead to catastrophic consequences for traders.

You can read the PDF version of the article in the ForTraders.org journal

Averaging algorithm on forex

Technical Analysis – Not Recommended!

The current state of technical analysis consists of following a set of rules considered dogma, aimed at guessing the further course movement. However, the choice of an indicator on which subsequent market entry and exit is based implies a trader’s skeptical attitude towards its use.

Indeed, when recommended input parameters or investment horizon change, the entry point changes significantly. Subsequently, a game begins according to the first (simple) attractor, which can only bring a local gain, but consistently brings a small loss of about 1-2% per transaction. Using the second (cyclic) attractor in market activities inevitably leads to averaging, which is not even considered by most traders as a guide to action. The reason is the impossibility of choosing the necessary volume for opening the next deal at this price level. Nevertheless, it is quite possible, although when developing a mechanical trading system based on conventional technical analysis, it is practically impossible to account for the impact of all negative factors that will inevitably arise.

Existing classical technical analysis can be described in a few sentences. Using trend indicators (e.g., moving averages), we determine the direction of the course movement, then find the assumed entry point, determine the amount we can allocate for the game, taking into account the possible loss, set a stop-loss and take-profit. That is all our active actions. We can do nothing more, and we just have to wait.

If technical analysis worked, everyone would be satisfied, constantly winning, especially since it is within the power of almost anyone who has basic math knowledge up to the multiplication table. However, this does not happen; on the contrary, motivated by previous wins, the trader starts to take more risks and eventually loses their deposit. Thus, modern technical analysis cannot in any way be called a reliable tool and should not be recommended for use in the process of working on the exchange.

Our task is not to criticize technical analysis. Life realities have already proven it well. Therefore, to develop a truly functional trading system, it is necessary first of all to give up technical analysis as a discipline, and secondly, to stop trying to predict the direction of the course movement, i.e., to understand for yourself the entire impossibility and even the destructiveness of such an attempt. Of course, for some time, it may just go well, forming both monetary gains and a good mood for the trader. However, the final loss is inevitable. It’s just a matter of time.

Averaging: How Does It Work?

The question arises: is constant winning possible at all? L. Angel and B. Boyd in their book “How to Buy Stocks” give an answer to this question. The only way to beat the market is averaging. Let’s try to figure out what averaging is.

Take the simplest example. Suppose we bought 5 apples for 10 rubles each, spending 50 rubles. Both the price and the product name (apples) were taken for illustration purposes only. However, later there was an opportunity to buy more apples at a lower price. Say, 7 rubles, and we bought 12 apples, spending 84 rubles. Thus, we became happy owners of 17 apples, spending 134 rubles on their purchase. Therefore, each apple cost us 7.88 rubles. This is averaging. We lowered the price from 10 rubles to 7.88 rubles by buying another batch of apples. If we express these actions in algebraic form, the general formula for averaging will look like this.

P(N+n) = (N*PN + n*Pn)/(N + n), where

P(N+n) – the total price at which we bought the full quantity of apples;
PN – the price at which we bought the initial quantity of apples;
N – the number of apples bought initially at price PN;
Pn – the price at which we bought the next batch of apples;
– the number of apples bought the second time.

As can be seen, using this rather simple formula, we can only find the overall, i.e., average price of our combined purchase. At the same time, the number of apples intended for purchase is not defined in either case. As for the price, we cannot determine it, since it automatically becomes an objective value, independent of our calculations. This example illustrates the purchase of apples, but it can be successfully applied to trading on the exchange, replacing the price of apples with the price of stocks, and the number of apples with the number of shares.

“Extra Shares” – A Gift from the Market to the Trader

It is easy to make a general conclusion regarding the number of shares involved in both cases. It is necessary to calculate the numerical value of this immediate purchase (sale), naturally, when the price reaches a certain value. This problem can only be solved by considering the amount of money the trader has, i.e., the deposit. Until we link the numerical value of the next opening and the available deposit, the game itself will be a very risky operation. Therefore, the task before us can be considered formally defined, since we know what we need to calculate, namely the number of shares we can afford to buy, taking into account the funds we have. The task is to calculate , assuming that N is already defined and is some finite value. The method of calculating N will be shown below.

Let D be the deposit we have. The price of this asset is at point PN. At this point, we buy N shares. Then the cost in money will be N*PN. The remaining amount in money will then be (D – N*PN), and in shares it will be (D – N*PN)/PN.

Indeed, at point PN, the deposit allows us to buy D/PN shares, but we only buy N shares. I again draw your attention to the fact that N is not defined, we will deal with it later. Since we played upwards, buying shares, if the price moves in our direction, we win, and there is no sense in considering this scenario. Therefore, we assume that the price will move in the opposite direction, i.e., downward, and reach the level Pn, at which we should buy some number of shares n. However, the numerical value of n is unknown. It remains to calculate it.

To begin with, let’s

FAQ

What is the main problem with mechanical trading systems?

They assume market movement in a predictable way, which is not reliable and can lead to failure during negative market situations.

Why is technical analysis not recommended?

It relies on guesswork and fixed rules that cannot account for all market variables, often leading to small losses per transaction.

How does averaging work in trading?

Averaging involves buying more of an asset at lower prices to reduce the overall cost, calculated using a formula that combines initial and additional purchases.

Belyaov

Belyaov

Author

Subscribe to us on Facebook

Fortrader contentUrl Suite 11, Second Floor, Sound & Vision House, Francis Rachel Str. Victoria Victoria, Mahe, Seychelles +7 10 248 2640568

Recent educational articles

All articles

Editor recommends

All articles