I expected this return "MajorFX" folder but it returns a blank string.
Same for all symbols.
I got: [ERROR] #4051: invalid function parameter value
Don't see where I'm wrong ?
. . . . you might want to post some complete test code and contact the Service Desk <---- follow instructions in the post in this link
Where is the error coming from ? do you ResetLastError() before calling SymbolInfoString() ?
Yes, I've added ResetLastError() before calling SymbolInfoString() and same issue (4051).
I'm sending to Service Desk the COMPLETE source code which is very small :
#include <stdlib.mqh> //------------------------------------------------------------------------------------------------------------------------------ void OnTick() //------------------------------------------------------------------------------------------------------------------------------ { string s; ResetLastError(); if(SymbolInfoString(Symbol(), SYMBOL_PATH, s)) Alert(Symbol()+" => "+s); else { int lastErr = GetLastError(); Alert("[ERROR] #"+lastErr+": "+ErrorDescription(lastErr)); } }
@Fx18 : thanks for import suggestion but this is not necessary.
ThanksI've added ResetLastError() and same issue.
@Fx18 : thanks for import suggestion but this is not necessary.
I'm sending to Service Desk the COMPLETE source code which is very small.
Thanks
Yes, this is just a workaround to test this.
If there is no compiler error after having imported the function declaration, then this means there is sure a problem that should be reported to Service Desk.
This sort of stuff is way above my comprehension level, but because I like to learn I looked up this function in the reference.
I have no idea what "Path in the symbol tree" means#include <stdlib.mqh> //------------------------------------------------------------------------------------------------------------------------------ void OnTick() //------------------------------------------------------------------------------------------------------------------------------ { string s; ResetLastError(); if(SymbolInfoString(Symbol(), SYMBOL_PATH, s)) Alert(Symbol()+" => "+s); else { int lastErr = GetLastError(); Alert("[ERROR] #"+lastErr+": "+ErrorDescription(lastErr)); } }
but I would think that the last parameter needs a value for the function to work properly.
string s is declared, but not initialised, does it not need a value for this function?
Sorry if I am just being ignorant.
This sort of stuff is way above my comprehension level, but because I like to learn I looked up this function in the reference.
I have no idea what "Path in the symbol tree" meansbut I would think that the last parameter needs a value for the function to work properly.
string s is declared, but not initialised, does it not need a value for this function?
Sorry if I am just being ignorant.
string s is passed by reference, the function saves the returned value to this string
There are two ways of using SymbolInfoString() . . . .
SymbolInfoString
Returns the corresponding property of a specified symbol. There are 2 variants of the function.
1. Immediately returns the property value.
string SymbolInfoString( |
2. Returns true or false, depending on the success of a function. If successful, the value of the property is placed in a placeholder variable passed by reference in the last parameter.
bool SymbolInfoString( |
In 2nd case, the string passed is just a placeholder to retrieve the value (a pointer like in C++), so it's initialization is not necessary (I guess). It just mean "we want the value in this target variable".
However with case 1 it is not working too (returned string is empty). I'm waiting info from Service Desk.
Much thanks for your help in this stuff.
This sort of stuff is way above my comprehension level, but because I like to learn I looked up this function in the reference.
I have no idea what "Path in the symbol tree" meansbut I would think that the last parameter needs a value for the function to work properly.
string s is declared, but not initialised, does it not need a value for this function?
Sorry if I am just being ignorant.
It returns the path of the symbol in Symbols window, for example : EURUSD => Forex\MajorFX\EURUSD

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I expected this return "MajorFX" folder but it returns a blank string.
Same for all symbols.