How and where can I learn more ?

 
I have read the book, the documentation and now reading some of the code base to learn more.
I am coding lightly, but feel I'm just not getting it all fast enough.

I understand I'm a new programmer, and know little with little experience, however I seem to have trouble designing code.

Mainly because I have had trouble grasping some of the topics in the book and documentation. They seem formal enough and I'm starting to understand most of it, however the details are week; and I am unable to put the information into use properly or at all.
There is simply not enough clear examples that I can learn from to understand exactly what these topics mean.
Or perhaps my understanding of programming is so week that the information is there but I cannot understand what it's telling me.
I am learning a lot, and have made a lot of progress, but my understanding of things are missing for sure.

I thought I would have a better understanding by now. I am creating some simple EA's and some indicators but many of these things I have to constantly refer to other's codes the book/documentation and/ or the dictionary and even then I have trouble understanding or just finding the information.

I have yet to build my own arrays and other more complex task and the information seems to evade me.

I guess the question is:
Is there nothing more to learn with a bit more details for MQL4 and where to find it.

Please advise
Thanks
 

What you may need are a few simple projects to get stuck into. It's not all about code though . . what you are trying to do with any code is solve a problem, how you design the solution is a key aspect, a bad solution, however well coded, will still be a bad solution.

So, what are your problems ? what do you need to do more efficiently that a piece of code will help with ? you need to test your learning by putting it into practice . . . code something that is of use to somebody.

 
RaptorUK:

What you may need are a few simple projects to get stuck into. It's not all about code though . . what you are trying to do with any code is solve a problem, how you design the solution is a key aspect, a bad solution, however well coded, will still be a bad solution.

So, what are your problems ? what do you need to do more efficiently that a piece of code will help with ? you need to test your learning by putting it into practice . . . code something that is of use to somebody.

I thought I would do just that, but I seem to be making slow progress of it.

I've been working on a few things, and did finish 2 EA's 1 of which was useful for me.
I read and try to learn more everyday about 2-3 hours per day, sometimes just falling asleep at the computer because I can't find the answer I'm looking for, and don't want to keep posting in the forums for every little thing. I'm not quick to post questions unless I really have tried to research and find out for myself.

I have started studying the code base to get a better understanding of code, mainly out of lack of ideas to complete my EA's

One thing that seems to have me extremely puzzled is creating working functions.

I have not been able to write a function without the if(statment) the functions in the book that I see and recreated gives me global errors.

I had assumed it must be because I do not understand where to put the braces, but I feel I understand this now.
Perhaps If re-read the book again this might help.

I think I mostly need to understand more about making proper loops., I don't understand in detail the return(0); vs return; and yet I do understand return(myfunction);

I do not understand if the trading should occur within the loop or should the purpose of the loop be inside the if(functions) ? Or maybe this is a feature of design that needs to be figured depending on the EA ?
I don't understand myfunction() with no variables or is this called no elements ?

There is a lot of things that seem to just be my lack of knowledge of code prior to beginning to learn MQL4

I don't know if I should just re-read the book or read the code base and try to match the code with the documentation and the dictionary to understand what the code is doing and learn from other's codes.

I wanted to read more about IsTradeAllowed() to understand this and perhaps create a time range which trades were allowed and yet NO trading during OFF times. Then also perhaps with extern int number_of_trades = 2 // can set the number of trades per time range


And also additionally allow for time range bubbles that you can trade number of trades, per time range bubble say from 9am-12am =3 trades, and 17:00-20:00 = 1 trade and so on.


Also creating candle patterns and referring to them by name or number in order to create a function that would if(candle formation[name or number] && candle formation [name or number] and imacd upper, OrderSend(

The actual strategy is not as important as knowing and understanding how to do it.

I dunno, sorry for the babbling on and long winded posts.

I just feel that I should have made more progress and I guess I'll just post one question at a time as the subject arises.

Just thought there might be some other resource of learning that might help smooth things out a little.

Thanks.


I'll keep on hacking away at it.

 

You don't need to know all the syntax or all the areas that mql4 covers to be able to write code that does what you need it to do . . . you actually don't need to create functions. Perhaps your problem with functions stems from you not really understanding when and why you would create and use one ?

As you probably know, there is stuff in the book about Functions: https://book.mql4.com/basics/functions

it looks OK but some bit may not have been translated/written as clearly as they might have been . . but overall it looks OK to me.

So why would you go to the bother of creating and using a user defined Function at all ? well there are a few good reasons, if you find yourself writing the same piece of code many times throughout your EA or Indicator you might take that piece of code and put it into a Function and just call the Function, this will make your code more readable and physically shorter in length. You might find that while writing an EA the method part of the EA is very small compared to the rest of the code, in this case you may want to split the other bits of the code that do not form the method, e.g. error reporting, placement and modification of orders, chart capture, etc off into individual Functions so that the code for the method . . . which is the heart of the EA, is kept clear and easily readable.

Another reason for creating Functions is that for a very large project the Functions break up the task into smaller chunks, these can be specified, designed and coded individually and tested individually, once they are proven to work correctly they are done . . they are known to be good and can simply be used and re-used as and when needed in any projects that may come along.

You asked about a function that does not have any variables passed to it . . this suggests you don't understand about scope of variables ? you need to understand about scope, not just read and recite . . I mean understand . . . scope is a fundamental thing you need to grasp. Back to the function() if all your variables are defined Globally then your function can see them . . they are global, so you don't need to pass them to the function. If you have variables that are defined locally, maybe in start(), and you are calling your function() from within start() then you might need to pass it some variables to work with . . .

IsTradeAllowed() has nothing to do with trading only at certain times or during certain days . . . https://docs.mql4.com/check/istradeallowed

I wrote this about return: https://www.mql5.com/en/forum/135343

One final piece of advice, when you think about solving a problem using any code the first thing you need to figure out is how you are going to solve the problem . . this is not code specific, so don't think in terms of coding, think in terms of everyday language.

Reason: