I'm trying to do the following:
//decide for which currencies if we are trending or not if( (Symbol() == "USDCHF") || (Symbol() == "USDCHFm") ) { //do something specific for this currency } else if( (Symbol() == "USDJPY") || (Symbol() == "USDJPYm") ) { //do something specific for this currency } else if( (Symbol() == "GBPUSD") || (Symbol() == "GBPUSDm") ) { //do something specific for this currency } else if ( (Symbol() == "EURUSD") || (Symbol() == "EURUSDm") ) { //do something specific for this currency } else { //set some default variables }
I am having a problem comparing the strings like "EURUSD" to what Symbol() returns, I think my if statements are comparing numerical values.
Is there a way to compare strings? or is there another way to determine which currency pair you are in?
Thanks!
Works for me a OK as is.
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 am having a problem comparing the strings like "EURUSD" to what Symbol() returns, I think my if statements are comparing numerical values.
Is there a way to compare strings? or is there another way to determine which currency pair you are in?
Thanks!