Download MetaTrader 5
To add comments, please log in or register
Publish your programs in the Market. Make money with your knowledge!
Piotr
1255
Piotr 2015.05.04 09:01 

Hi,



I need to read The base currency. So I would like to read only first 3 chars of current Symbol() and paste it to the other string parameter in MQL4 code.

For example if current Symbol() is EURUSD I need to read only EUR value (first 3 characters from left).


Has anybody any idea how to resolve this little problem in simple way?



Regards,

Demos Stogios
184
Demos Stogios 2015.05.04 09:20  
StringFormat("%.3s",Symbol())

You can also check that page http://www.cprogramming.com/tutorial/printf-format-strings.html 

I can imagine most of them, if not all, work in MQL

best regards 

Keith Watford
Moderator
7906
Keith Watford 2015.05.04 09:22  
StringSubstr()
Piotr
1255
Piotr 2015.05.04 09:40  
Demos:


exactly what I need - thank U

Demos Stogios
184
Demos Stogios 2015.05.04 09:46  

Punvher, u r welcome, I also updated my original reply, but hey, I would rather use what GumRai said :)

best regards 

/
To add comments, please log in or register