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
That’s not my code, I don’t use input = ‘m1’
but if you’re referring to OP, your proposal does make the code arbitrarily/arguably more readable, in return for using switch and limiting the amount of chars. Either way, you have to validate incoming data from the api anyway, so I’m not inclined to make unnecessary castings and conversions. And I guess we’d have to cast the timeframe constants in the “case” also to long, possibly making it even more complex.
unless there is a compelling performance or integrity benefit, the added complexity makes the readability less intuitive, and verbose imho. But it’s matter of style i guess.
For instance, I agree i personally prefer the switch too for translations, however it’s a pity mql does not support strings with it.