Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 835
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
even the compiler will highlight "the result of OrderSelect must be checked" in the first case ;-)
If you change for the first one if (!OrderSelect(...)) continue; then the options are identical.
In the first one the code is visually linear, in the second one it looks like a staircase. I prefer the first one, it's easier to read and in general the appearance of deep logical tabs {{{{ }}}} hints that it's time to change something :-)
Thanks. Does writing in staircase affect code speed? It's easier for me to understand staggered writing.
Thank you. Does stair-step recording affect the speed of code execution? It's easier for me to understand staircase writing.
It is the algorithm that influences the speed of execution in the first place. And how you represent it in the code doesn't really matter.
That's not what you think about.
You write code so that you can work with it later. So you write it anyway you like and don't bother your mind with problems you don't encounter in reality.
Well you don't have any speed problems which you need to avoid with tricks and peculiarities of coding. Simply guaranteed, you don't.
When (which is unlikely) they will appear, then you'll optimize performance.
The speed of execution is primarily affected by the algorithm. And how you represent it in code is not that important.
That's not what you're thinking about.
You write code so that you can work with it yourself later. So you write it anyway you like and don't bother your mind with problems you don't encounter in reality.
Well you don't have any speed problems which you need to avoid with tricks and peculiarities of coding. Just guaranteed, you don't.
When (which is unlikely to happen) you'll optimize your code.
Thank you very much! Very understandable.
Please help me with this question :https://www.mql5.com/ru/forum/160683/page833#comment_11585085
I doubt it will help you, but that's about it:
- You took some of the code from MT5 and are trying to "bolt" it to MT4, that's not how the indicators are called in MT4
- You have not declared the function header correctly
- MT4 does not have the built-in CopyBuffer() function
This will not work in general, look for other options to add some more code parts - syntax of MQL4 and MQL5 is 95% similar, but you can't recklessly copy code parts between platforms
I doubt it will help you, but that's about it:
- You took some of the code from MT5 and are trying to "bolt" it to MT4, that's not how the indicators are called in MT4
- You have not declared the function header correctly
- MT4 does not have the built-in CopyBuffer() function
the syntax of MQL4 and MQL5 is 95% similar, but you can't recklessly copy code sections between platforms
Sorry, I forgot to specify the code for MT5
It just does not call the Deviation(int kanal) function.
I wanted to ask how to do it correctly ?
perform one-to-one example from the articlehttps://www.mql5.com/ru/articles/18
As an option, you have compiled a project for 64-bit dll, MT4 terminal is 32-bit, you need to configure and compile the project for 32-bit .dll
I am asking questions there too, I tried the proposed examples there, in fact I have posted pictures with experiments. Well yes something is there with these versions, normally all this should be in the help, how to connect what nuances. I was given some links with codes, I opened these classes and closed them, in general mockery of information, no what you want and do. Well, excuse me, I will return to this topic after 20 years of programming experience. How do I know that the compilation for 64, how do I find out?
How do I know that the dll is compiled for 64?
Look at the project properties in Visual Studio, there should be an option for what platform to compile dll - MT4 needs 32-bit code
PS: google find the VS setting
I doubt it will help you, but that's about it:
- You took some of the code from MT5 and are trying to "bolt" it to MT4, that's not how the indicators are called in MT4
- You have not declared the function header correctly
- MT4 does not have the built-in CopyBuffer() function
the syntax of MQL4 and MQL5 is 95% similar, but you cannot recklessly copy code sections between platforms
Do you have the following code fragments?
Forum on trading, automated trading systems and strategy testing.
Any MQL4 beginners questions, help and discussion on algorithms and codes
Alexander Layzerevich, 2019.05.06 17:21
I am trying to receive indicatordata in MT5 using this function:
I receive error :
Please advise how to correct code for MT5