
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
Really? EnumToString(anInt) compiles? I don't think so.
It was you that started the argument "Please pay attention to what you post. Your code doesn't compile as mql5." My post was about self-documenting code. You brought up a nit.
I am trying to solve problems through dialogue, but it seems it's not possible with you.
Don't post mql4 code on a mql5 topic ! Is it more clear like that ? If you don't know what is mql5 code that compiles then refrain from answering.
As before it has worked @Lakshan Perera
some 1 has recommended i use this. I'm not a coder I paid for the code to be written then when i asked for the message to be edited the coder wanted more money so i thought i would ask.
how would i use the code below. I just want to see which works better
IntegerToString(Period()) IntegerToString(Symbol())
IntegerToString(Symbol()) is wrong, because Symbol() returns a string already...
By better if you mean you want to cut that "PERIOD_" part, use the following,
'_Period' - parameter for EnumToString must be an enumeration testscr.mq4 4 24
because _Period is an int per the documentation.
_Period - Predefined Variables - MQL4 Reference
I don't have MT5 but per the documentation, _Period is still an int. So it shouldn't compile. If it actually does, then I am still not wrong, the documentation is.
Predefined Variables / _Period - Reference on algorithmic/automated trading language for MetaTrader 5
I am trying to solve problems through dialogue, but it seems it's not possible with you.
Don't post mql4 code on a mql5 topic ! Is it more clear like that ? If you don't know what is mql5 code that compiles then refrain from answering.
Other can copy/paste problem with DoubleToStr vs DoubleToString, I didn't post MQL4 code. I posted generic functions. Show me what won't compile.
I don't have MT5 but per the documentation, _Period is still an int. So it shouldn't compile. If it actually does, then I am still not wrong, the documentation is.
Predefined Variables / _Period - Reference on algorithmic/automated trading language for MetaTrader 5
I hear you, but it compiles in MQL5.., and it is true it does not compile in MQL4 , Anyway, the question was about MQL5, that's why gave that answer. (I have used it in the past)
and guys, I think we need to cool down little.. :D
No surprise lol
-
Other can copy/paste problem with DoubleToStr vs DoubleToString, I didn't post MQL4 code. I posted generic functions. Show me what won't compile.
William I will not continue this stupid dispute.
You posted mql4 code that doesn't compile under mql5 and it's confusing for people who are not professional coders. This is obvious to everyone except to you. Why is it so hard to say "That's right I will pay more attention to such things" ?
I think both are correct or at least can be used.
This results in "PERIOD_M30 30" when dropped on a 30 min chart and "PERIOD_D1 16408" on daily.
Whroeder's code (should result in D1, not PERIOD_D1) is definitely the proper way if output would be read by humans.What MT4 code? Show me the compile errors! If it's so obvious, show me. How can I learn where I am wrong, if no one will answer my direct question?
..
What MT4 code? Show me the compile errors! If it's so obvious, show me. How can I learn where I am wrong, if no one will answer my direct question?
That's not serious. You edited your code AFTER my post, then you made all a fuss about it.
You are dishonest.
I am serious.
I edited the code after your first post, and commented that you are complaining about a nit.
It is you that has, after that, repeatedly called it MT4 code, when it is generic MT code snippet, and with the typo fixed, MT5 code.
You have gone so far as to strike out everything over a nit, a typo. You are dishonest. Not once have you stated what was wrong with it. (The noobs still won't know.)
It was a month ago that you asked me whether I wanted to be a moderator. I don't think you should be. Most of the time you're reasonable. But sometimes you go off the deep end and become fixated or inconsistent. So last month I'm good enough to be a moderator but today I'm dishonest. LOL. I'm done with this thread.