You could take a look at StringFind, StringLen and StringSubstr in documentation string functions.
Then figure out a way to extract the number from the string so you can compare them and keep the
index of the highest number.
If you have questions about this write back.
Arpit T:
i have a string array
I want to find string which has maximum index e.g. in this case w_50
How can i do it
Hello,
You can find the largest or lowest value by sorting the contents of the array.
https://docs.mql4.com/array/arraysort
Since the contents of your array are strings, the numbers must be in the following format:
w_01 w_02 w_03 ... w_50
ArraySort - Array Functions - MQL4 Reference
- docs.mql4.com
ArraySort - Array Functions - MQL4 Reference
There are no numbers in a string. ("_10" comes before "_9", etc.)
Isolate the number part, convert it to a number, and store them in a numeric array.
Now you can search that and get the index for both.
Sort orders based on OrderOpenTime MQL4 programming forum (2020)
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
i have a string array
I want to find string which has maximum index e.g. in this case w_50
How can i do it