Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1055

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
this is all clear, but how do you calculate the difference of 2 prices in whole points correctly?
This is where rounding can be applied. It's up to you to decide which way, or just to a whole number.
And this is correct? In the order loop, would SymbolInfoDouble(OrderSymbol(), SYMBOL_POINT); be recalculated each time, becauseOrderSymbol() will be different each time?
The problem there is slightly different - the total profit in pips for all symbols.
This is where rounding can be applied. It's up to you to decide which way, or just to a whole number.
well yes, forgot such constructions, in Kim's lot calculation functions there was correct roundingSo the task there is slightly different - the total profit in points for all symbols.
OK, but why const - how the compiler behaves if the loop will change const ?
PS: code is readable, but need to check, never used this
OK, but why const - how does the compiler behave if const is changed in the loop ?
PS: code is readable, but need to check, never used this
At each step a variable will be created. const - at this step it is not planned to change anywhere.
Each step will create a variable. const - there are no plans to change anywhere in this step.
is the step an iteration of the loop?
It is still not clear how such a construction will behave, we need a script to check
So the objective is slightly different there - total profit in pips across all symbols.
Well, then it's like this
I calculate profits in pips of one position, but I think it won't be a problem to apply it to myself
a step is an iteration of a cycle?
Yes.
it's still not clear how such a construction will behave, we need a script to check
Here is an example of a convenient use of the life of a variable
Forum on trading, automated trading systems and strategy testing
Discussion on "LifeHack for trader: mixing ForEach on defines (#define)"
fxsaber, 2018.02.14 10:54
Performance measurement
Result
Forum on Trading, Automated Trading Systems and Strategy Tests
FAQ from Beginners MQL5 MT5 MetaTrader 5
Konstantin Nikitin, 2019.06.04 19:58
Well then
I calculate profits in pips of one position but I think I have no problem applying it to myself
This is called conversion of profit with costs into TRUE (not at close) pips.
This is called a cost profit transfer into CURRENT (not at the time of closing) points.
This is how he needs to translate the profit into points. When calculating the closed ones, you still need to take the point value as a basis. The profit in pips does not have to be equal to the difference in pips between the open and close prices. and closing prices.
So he needs to translate the profit into points.
Sometimes they think that profit = OrderProfit().
When calculating a closed symbol, you should still use the pip value as a basis. The pip value of the profit does not have to be equal to the difference in pips between the open and close price.
The point value at close is not equal to the point value at the time of calculation. Moreover, at the time of calculation the symbol might simply not be in the Market Watch.
That is why both values of points and their value at the moment of closing are calculated.