if( StringFind( AccountName(), "Smart" ) >= 0 ) { // found "Smart" so do something about it } else { // did not find "Smart" so do something about it };
Search for a substring in a string |

StringFind - String Functions - MQL4 Reference
- docs.mql4.com
StringFind - String Functions - MQL4 Reference
thank you very much, perfect, have a nice weekend

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
double Target;
Is it possible to use the if function with the contains combination? Alternatively, I can ask for a formula correctionif(StringFind(AccountName(),"Smart") Target == 1;