In counting '(', ')', '{', and '}' the compilers treats them more or less as if they were the same. :(
Check each of them! But most probably (only) one of them causes the error!
Make it as your habit to write opening and closing brackets in one of theses two ways:
// version 1 if ( true ) { // do something ... } // version 2 if ( true ) { // do something }
Make it as your habit to write opening and closing brackets in one of theses two ways:
You should mention another most popular style:
// version 0 if(condition) { // code }
Hello again,
Thank you both,
I am trying understand. The problem is after the "case" statements, correct?
Edit: After the "case" statements. polyline should be a return value, correct?
Edit: After the "case" statements. polyline should be a return value, correct?
Why create so many arrays and case conditions? Just create a single multi-dimensional array.
double value[][30];
- docs.mql4.com
- Why are you modifying my polyline code? What's wrong with the original?
(Other than changing dots in variable names to underscores.)
Posted my code Why is there NO Complete EA within the Code-Base? - MQL4 and MetaTrader 4 - MQL4 programming forum It has not been adjusted for Build 600+. - Fernando Carreiro: Why create so many arrays and case conditions? Just create a singlel multi-dimensional array.Because each array is dynamically sized. There was no classes or structures or pointers; yet it supports up to 20 independent lines. I intended to rewrite it as a class with one array but never got around to it.
if(!Show.Objects){
This a a bool, not a structurestatic int= LRU[POLYLINE_MAX];
Obviously bogus.for(int iLine=0; iLine<POLYLINE_MAX; iLine++) { bool isNew=lineName[iLine]!=name; if(!isNew) break; }
This code will not work with strict (it exports iLine and isNew outside the loop.)
So it is old code, that never got modernised. OK understood, but I also did not realise it was your code (originally).
PS! You could have still used a single array and dynamically grown it as a whole based on the longest length needed! Not very memory efficient, but more elegant in terms of code!
So it is old code, that never got modernised. OK understood, but I also did not realise it was your code (originally).
PS! You could have still used a single array and dynamically grown it as a whole based on the longest length needed! Not very memory efficient, but more elegant in terms of code!
Grumpy,
I think what Fernando is getting at, and correct me if I'm wrong Fernando, is that you shouldn't be learning to better your skills using examples from pre-build-600 style projects. Instead you should be learning to effectively use OOP and the (new) standard library (especially data-collections) in order to implement much more simple, small, and elegant solutions.
Actually my statement was in reply to @whroeder1, not the OP!
As for the OP, I had already suggested to him on another thread (see below), that since his coding skills are only at the beginning (not even having coded before in other languages), that he would be better served following a step-by-step method and even suggested a book or two to get him started.
However, I would NOT suggest that he start on OOP until he has properly grasped procedural coding first. OOP is just to "complicated" for those that have never coded before.
Forum on trading, automated trading systems and testing trading strategies
Fernando Carreiro, 2017.09.09 08:47
I think you should first concentrate on learning the basics of the language, its structure, its syntax, code layout and readability, etc.
Then learn about the various functions that are available, how they work and how to use them properly.
The code you provided, will not even compile, because you are basically mixing apples, oranges, tomatoes, carrots, and anything else that fits in the basket.
For example, the OrderSelect() function is for selecting a particular Order either by Index or by Ticket Number. It does not by itself return the number of Orders of a certain type.
So, before you even think about "professional account management", first you need to learn the language, by reading the documentation and researching the example code in the CodeBase.
If you want or prefer, you can even get yourself a good book and follow it from start to end:
Actually my statement was in reply to @whroeder1, not the OP!
As for the OP, I had already suggested to him on another thread (see below), that since his coding skills are only at the beginning (not even having coded before in other languages), that he would be better served following a step-by-step method and even suggested a book or two to get him started.
However, I would NOT suggest that he start on OOP until he has properly grasped procedural coding first. OOP is just to "complicated" for those that have never coded before.
As per usual we would disagree on that. :) I think it's (by orders of magnitude) more easy to understand how objects work than to trying to decipher a bunch of spaghetti that was written to circumvent the original language's restrictions. That's not a malicious comment directed at the author, since it's true of any old mql that uses multi-dimensional arrays instead of objects. It's just bad design by today's standards and should not be encouraged as a learning platform.
As far as learning resources go, I had much better results by learning from C++ tutorials than MQL tutorials. Based on how much time I wasted and how long it took me to progress to the point where I am, if I had to do it over again I would've ditched the MQL tutorials and jumped straight into learning C++ first, and then later dive into the MQL docs and MQL5 codebase examples.Hello again,
I am very sorry if I have offended anyone, believe me I didn't mean to at all. I was searching the forum for code containing "Switch operators" and whroeder1 seem to be the most interesting one I found in a quick search.
Again please except my apology whroeder1, I was in no way trying rip off your code.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello everyone,
I found this post https://www.mql5.com/en/forum/150808
I am trying to get the example to work, but I have run into a problem with completely solving it.
I get these errors:
')' - unexpected end of program line 159 col 6
'{' - unbalanced parentheses line 11 col 3
Where have I gone wrong?