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

 

New article The Optimal Method for Calculation of Total Position Volume by Specified Magic Number is published:

The problem of calculation of total position volume of the specified symbol and magic number is considered in this article. The proposed method requests only the minimum necessary part of the deal's history, finds the closest time when the total position was equal to zero, and perform the calculations with the recent deals. The working with global variables of the client terminal is considered.

Author: Дмитрий

 
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.
 
file cannot be compiled.
Reason: