Discussion of article "The Optimal Method for Calculation of Total Position Volume by Specified Magic Number" - page 3

 
Because mt5 will always have only one position of a symbol, can we just use PositionGetDouble(POSITION_VOLUME) to  obtain the current volum of the position?
Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Position Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Position Properties - Documentation on MQL5
 
Yes, certainly.
 
BlinGoblin:

I didn't understand the last sentence, Integer, if it's not too much trouble, explain what you meant to say

I guess you suggest replacing PositionGetDouble(), POSITION_COMMISSION, POSITION_SWAP, POSITION_PROFIT. with HistoryDealGetDouble(), DEAL_COMMISSION, DEAL_SWAP, DEAL_PROFIT.

.

No, don't replace them. Use these functions to collect the profit for the entire history. Select the history, go through all deals and summarise their profit, swap, commission.
 
NIKOLIA:

HOW TO WITHDRAW MONEY FROM FOREX, OR HOW TO TRANSFER IT TO WEBMANI.

How much?
 
good i learn very much.
 

the following has been noticed: when many Expert Advisors work on one account (FORTS, Otkritie), the aggregate position can be equal to 0, while the Expert Advisors are in positions.

accordingly, the point of zero position may change to a new, current point of zero aggregate position, but then the experts using the class lose their positions.


it seems that it is necessary not only to find the point of cumulative zero position, but also to check that any expert on this symbol and in this point does not have a position.

But the question arises, for example, what if some expert has been removed and his pose is covered with his hands?

 
So the point is to find the aggregate position of each expert, and the total aggregate position is already known in the terminal.
 

Good afternoon.

Help me to understand how these classes and OOP work. Let's say we have connected this class to an Expert Advisor, is it executed only when accessing it from the Expert Advisor? Or it works in parallel and gives only results on request?

 
file cannot be compiled.
 

the following warnings and errors were noticed during compilation in mql5: possible loss of data due to type conversion from 'long' to 'int' eposvoltest.mq5 426 20 , possible loss of data due to type conversion from 'long' to 'datetime' eposvoltest.mq5 439 32, possible loss of data due to type conversion from 'long' to 'int' eposvoltest.mq5 456 26, possible loss of data due to type conversion from 'long' to 'int' eposvoltest.mq5 491 23, return value of 'OrderSend' should be checked eposvoltest.mq5 236 4, return value of 'OrderSend' should be checked eposvoltest.mq5 268 4, '-' - expression not boolean eposvoltest.mq5 279 14, 'MQL5_TESTING' is deprecated, use 'MQL_TESTER' instead eposvoltest.mq5 335 23, 'MQL5_TESTING' is deprecated, use 'MQL_TESTER' instead of eposvoltest.mq5 346 23

10.09.2025