MetaEditor Compiler Error: Standard library function 'symbolInfo.VolumeStep()' not recognized after reinstall

 

I am writing to report a persistent issue I am experiencing when compiling MQL5 code in MetaEditor.

Problem Description: When compiling code that calls the symbolInfo.VolumeStep() method from the CSymbolInfo class (included via <Trade/SymbolInfo.mqh>), I consistently receive the errors 'VolumeStep' - undeclared identifier and ')' - expression expected.

Reproducing the Issue: This problem occurs not only in complex EAs but also in the following minimal test code, which only includes the problematic function call:

//+------------------------------------------------------------------+
//| SymbolInfo Test EA                                               |
//+------------------------------------------------------------------+
#property copyright "Test"
#property version   "1.0"
#property strict

#include <Trade/SymbolInfo.mqh> // Include SymbolInfo library

CSymbolInfo symbolInfo; // Declare CSymbolInfo object

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   // Initialize symbol info
   if(!symbolInfo.Name(_Symbol))
     {
      Print("ERROR: Failed to initialize SymbolInfo for ", _Symbol);
      return(INIT_FAILED);
     }

   // Test the problematic VolumeStep() method call
   double step = symbolInfo.VolumeStep(); // <--- Error occurs on this line

   // Print result (appears in Experts tab if compilation succeeds)
   Print("INFO: Volume Step for ", _Symbol, " is: ", step);

   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   // Nothing needed in OnTick for this test
  }
//+------------------------------------------------------------------+

Troubleshooting Steps Taken:

I have attempted the following steps to resolve the issue, but the same errors persist:

  1. Verified the code uses the correct method call ( symbolInfo.VolumeStep()).

  2. Deleted the compiled .ex5 file, restarted MetaEditor, and recompiled.

  3. Created a completely new .mq5 file, pasted the code, and compiled.

  4. Performed a full reinstallation of the MetaTrader 5 platform using the latest version. (Specify if you checked "Delete personal data": e.g., "Personal data was also deleted during uninstall." or "Personal data was kept during uninstall.")

Documentation on MQL5: Language Basics / Preprocessor / Program Properties (#property)
Documentation on MQL5: Language Basics / Preprocessor / Program Properties (#property)
  • www.mql5.com
Every mql5-program allows to specify additional specific parameters named #property that help client terminal in proper servicing for programs...
 

There is no VolumeStep method in the CSymbolInfo documentation: https://www.mql5.com/en/docs/standardlibrary/tradeclasses/csymbolinfo

I don't know if this has always been the case (I don't use CSymbolInfo), but no such method exists now

[edit] Looks like that method never existed and was invented by an AI. Out of curiosity, I found some code from 2019 in the codebase that uses CSymbolInfo and there is no VolumeStep().
 


If you miss it, you just have to create one more method.
The system constant exists, it may not be difficult to do
 
Gerard William G J B M Dinh Sy #:
If you miss it, you just have to create one more method.
The system constant exists, it may not be difficult to do

If the topic starter prefers to use CSymbolInfo, then there is already a method that returns SYMBOL_VOLUME_STEP

double            LotsStep(void)     const { return(m_lots_step);     }
bool CSymbolInfo::Refresh(void)
  {
   //...
   if(!SymbolInfoDouble(m_name,SYMBOL_VOLUME_STEP,m_lots_step))
      return(false);
   //...
  }
 
I can't find the method in the doc
 
Gerard William G J B M Dinh Sy #:
I can't find the method in the doc

https://www.mql5.com/en/docs/standardlibrary/tradeclasses/csymbolinfo/csymbolinfolotsstep

 
Thx