EN fortrader
10 May, 2026

The Averaging Algorithm is Now Applied on Forex

Belyaov

In previous publications, we considered only the stock market from a mathematical perspective. Let’s try to transfer the obtained analytical results to the forex market.

math-forex

Define Initial Conditions

For starters, let’s define which platform we will use. The most popular one is MetaTrader 4. It is not only the most popular, but also the most convenient. Its main advantage, which many simply do not notice, is the ability to trade in both directions simultaneously. MT5 does not provide anything similar, despite being widely advertised. Therefore, we will work only with the MT4 platform.

The second point to consider is the asset available to us. The asset can be any, but we will work with the EUR/USD pair. This pair has a spread of about 2 points, and this spread is often floating, i.e., changing during the movement of the rate depending on the overall market volume. It is also the minimum for all assets regardless of the broker you work with.

Opening Longs

Let’s first consider trading on the rise. All our actions should be reflected in Excel, so it is necessary to prepare tables for further use. The appearance of the tables will significantly change compared to the previous one. The first columns on the left will remain the same, while the following ones will change.

Fig. 1. Example of a table in Excel.
Fig. 1. Example of a table in Excel.

This is due to the following considerations. Each brokerage firm, when trading on the forex market, reserves ten times the volume of active deals. Thus, when opening a deal at a price, say, 1.2584, it doesn’t matter in which direction, the actual price will be ten times higher than the initial one, as that is what the broker reserves, and our deposit loses not 1.2584, but 12.584. Therefore, in further calculations, this price is used, not the one we see on the monitor. Naturally, this does not mean that we lose these funds. When closing the deal, they will return to the deposit, but during trading, this factor must be taken into account in the calculations. Therefore, the calculated price must be changed to the effective price, which for clarity is marked with the letter D.

Therefore, in the header, we add columns VAT, VAT, P(N+n)D. Correspondingly, in cell G2, we enter the value =10*B2, in cell H2, we also enter the tenfold amount =10*E2. We are left with cell K1 with the symbol (N+n)D. This cell shows us the average value of our open orders, but when filling cell K2, we must use only effective prices, so the calculation formula must be transformed as follows: (C2*G2+J2*H2)/(C2+J2). To return to the values of the prices we see on the screen, the resulting numerical value must again be converted. For this, we place the value K2/10 in cell L2. Now, we need to figure out cells F2, I2, and J2. They respectively contain , , . These symbolic values differ in color and writing. The purpose of this will be shown later.

In cell F2, which is under , we enter the original formula, but taking into account effective prices. It will look like this: ((A2-2*C2*G2)*(G2-H2))/(G2*H2*D2).

To understand , some calculations are needed, the necessity of which is not obvious at this stage. Nevertheless, it will be justified later. Studying the formula n=((D-2*N*PN)*(PN-Pn))/((PN*Pn)*2), we can easily notice that the maximum value of will only occur when N=0. Then the formula will take the form n=((D*(PN-Pn))/((PN*Pn)*2). Indeed, the first bracket of the numerator will be maximum only when the volume is zero, hence the result will be maximum. Based on this, cell I2 will contain the following formula (A2*(G2-H2))/(D2*G2*H2).

We are left with . Cell J2, located under this value, does not require any formulas and is only used for rounding previously obtained results. This is because in a number of brokerage firms (almost all of them), there is a limit on the volume placement. If the volume step is 0.1, the program will not allow you to set 0.08 or 1.25. In Excel, such a result can appear, and if it does, we will operate with its rounded value.

What to Do With Shorts

The obtained table relates only to the upward movement. When moving downward, the table differs only by one sign, based on the fact that when playing down, the volume of the placed order is negative.

Therefore, in cell F2, in the first bracket of the numerator, instead of subtracting the product of volume and price, we will add it to the deposit value. Thus, the total amount of free money will decrease, which was the desired result. The second bracket of the numerator determines only the distance between our average price and the current price, so we leave it unchanged.

The last thing I would like to draw your attention to is the only indicator that we will always use. This indicator is called iExposure. To find it, click Insert → Indicators → Custom → iExposure. Only one value will interest us in it – Net lots. It will show the difference between open orders. For example, we are trading 3 lots up and 5 lots down simultaneously. The indicator will show a difference of -2.

Continuation to follow…
Previous article in the series
“,
“excerpt”: “The averaging algorithm is now applied on Forex. Learn how to implement it in MetaTrader 4.”,
“slug”: “averaging-algorithm-forex”,
“faq_html”: “

FAQ

What is the averaging algorithm on Forex?

The averaging algorithm on Forex involves calculating the average price of open orders to manage risk and optimize trading strategies.

How do I apply the algorithm in MetaTrader 4?

To apply the algorithm, you need to adjust your Excel spreadsheets to reflect effective prices and use specific formulas to calculate average values and net lots.

Why is it important to consider effective prices?

Effective prices are crucial because they reflect the actual volume

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

More from this category

All articles

Recent educational articles

All articles

Editor recommends

All articles