Try,
StringToDouble();
double GetPriceVal(string symbol,ENUM_TIMEFRAMES timeframe, string s) { double retval = -1; //signal failure string res[]; string param; int index; int numstrings = StringSplit(s,'[',res); if (numstrings==2) { param= res[0]; numstrings = StringSplit(res[1],']',res); if (numstrings==2) { index = StrToInteger(res[0]); // Print (param," ",index); if (StringCompare(param,"high",false)==0) { double doubleval[]; if (CopyHigh(symbol,timeframe,index,1,doubleval)==1) retval= doubleval[0]; } } } return(retval); }
Something like this... (just a quick coding for MQL4... ;)
call it, if positive result, its a real value
Print(GetPriceVal(Symbol(),0,"High[1]"));
thank you guys
I will try to explain exactly what I am thinking about:
I have an indicator, I protected by DLL file. I need to protected it to one account number.
if I wright in MQ4 the function of AccountNumber() maybe somebody will decompile the EX4 to MQ4 and replace the word AccountNumber() and put the real number that the indicator working with.
so I need to send from my DLL string "AccountNumber()" and converted in MQ4 to AccountNumber() to get the real account number. even if the user decompile the code cannot send any fake number to the DLL.
I hope I explain it good.
thank you again.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi there
I wondering if I can find an way to my question, mt point is:
can I make the MQL4 Or 5 read the string as a code? example:
this string "High[1]" can I make the program read it as High[1] and return the High of Bar 1 for me???
thank you.