In general, the right direction has been set: if you want to see profits, deal with losses and costs in detail.
The line of change of dates by server and rollover as an indicator is highly debatable - there are too many purely technological (not market) components.
To the author - pay more attention to margins in your next article. As if it is more important than floating profit/loss, but most people don't know about it and don't know how to calculate it.
In general, the right direction has been set: if you want to see profits, deal with losses and costs, in detail.
The line of change of dates by server and rollover as an indicator is highly debatable - there are too many purely technological (not market) components.
To the author - pay more attention to margins in your next article. As if it is more important than floating profit/loss, but most people don't know about it and don't know how to calculate it.
I will try, but margin is not very difficult to calculate at first glance, there are not many calculations there at all, it is not enough for one article, we need something else
Thank you to the author.
I was always puzzling with crosses, but here everything is all explained and translated into code. Take it, use it, don't break your head)))))
Well no, Point is _Point I have it right/ TickSize is a bit different, it is the size of the minimum price change. On some instruments it can be TickSize = 5*_Point, for example. It's just a number from which all other values in the spec are derived. It is hard to provide all the nuances, especially in such an article, but if it is important, you should correct it of course. I tried to convey the essence first of all. As for "_Point", it can be anything, it is not the point. For example, if you take USDJPY, your formula will not be correct because the rate goes beyond a hundred, you will have to multiply it by another 100. If you take pairs like EURUSD USDGBP, then yes. Point is a free value. Of course, it is not equal to something, but it is approximately equal to the average price movement on the instrument for say one second or five seconds....
- PrBuy = Lot * TickValue * [ ( PE - PS )/Point ] - profit for the buy order
-- here TickSize is correct -- well, and further on in the text

I have everything correct, otherwise the calculations would not add up. I made a short script. It is not for you personally, but for everyone. These values are different and you should understand their difference. I'll think how to correct it. But in this case, everything is correct. There is no need to cross out.
I would like to point out that there is a major flaw regarding the calculations of profit/loss in this article.
You are using Tick Value and Point Size together. That is incorrect. You should be using Tick Value with Tick Size, not Point Size.
Also the Point Size is not the smallest change in price. That would be the Tick Size. Point Size is the smallest numerical resolution required to represente the price quote, not the smallest price change.
Here are examples of symbols with different point and tick sizes ...
Forum on trading, automated trading systems and testing trading strategies
Fernando Carreiro, 2022.06.02 01:14
Here are two examples from AMP Global (Europe):
- Micro E-mini S&P 500 (Futures): point size = 0.01, tick size = 0.25, tick value = $1.25
- EURO STOXX Banks (Stock Index): point size = 0.01, tick size = 0.05, tick value = €2.50
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use

New article Market math: profit, loss and costs has been published:
In this article, I will show you how to calculate the total profit or loss of any trade, including commission and swap. I will provide the most accurate mathematical model and use it to write the code and compare it with the standard. Besides, I will also try to get on the inside of the main MQL5 function to calculate profit and get to the bottom of all the necessary values from the specification.
To develop an efficient trading system, first of all, it is necessary to understand how the profit or loss of each order is calculated. We are all able to calculate our profits and losses somehow to maintain our money management system. Someone does that intuitively, someone performs rough estimations, but almost any EA has the necessary calculations of all the necessary quantities.
The image below develops the idea further making it easier to understand. It shows opening and closing two types of market orders:
Author: Evgeniy Ilin