samjesse:
Try to read the documentation of StringSplit() maybe ?
This code failed to return the number 6 which is how many char in a forex symbol, any idea how to fix it?
Thanks
samjesse:
I read it 2 times but could not figure out what would the delimiter be for a char boundary? too bad mql4 does not use regex.
The second parameter need to be a ushort, something like ','
You can't use an empty string, split nothing, so result is 1.
If you want the number of character use StringLen().
use StringLen and StringSubstr
samjesse:
This code failed to return the number 6 which is how many char in a forex symbol, any idea how to fix it?
Thanks
You used sting split wrongly . In order to use the string split function correctly you have to enter the separation symbol using ushort symbol of the character . For example if the separation is _ then then you use
Charachtergetshort(char'index)
Then you use the resulted value into the string split function
However in this case you mentioned there is no separation between the base and related currency AudUSD so using string split is not the correct way
It's better to consider StringSubString() function

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
This code failed to return the number 6 which is how many char in a forex symbol, any idea how to fix it?
Thanks