Learning to program in MQL4

 

Hey all,


I am pretty new to programming, in particular to MQL4, but I do have a strong math background and have done a lot of work in abstract math and the like, so I'd like to be able to implement some algorithms I have ideas for. I have been reading through the book, but am left with a lot of questions about how to go about actually implementing more complex strategies within an EA, or at least, through a variety of indicators.


For example, I'd like to be able to look at 4 different EMAs within 2 periods and, based upon the deltas between the different EMAs and comparing the two different periods, move on to checking another indicator. Once that is met, another TI is used and, if it fits within the strategy, sets into motion a trade.


The part I am having most difficulty figuring out how to implement is this: I want to be able to calculate the probabilities of the risk/reward based upon the numbers generated by the algorithm and then finalize the trade by setting target entry/exit points and a stoploss function.


If anybody can point me to some more guides on MQL4 programming or how to design more advanced strategies, it would be appreciated. I have looked at some EAs on here and they seem to go far beyond what the manual describes (and beyond my comprehension), so I imagine that there are some other resources that I can be directed to.


Thanks for any help!

 

The best guide you have is this website.


You have to start with the basics of the programming language first under the Book link above. Then get into the specifics of the language in the Documentation link, and there is no shortcut for this step even if you are already familiar with other programming languages. And then progress to the Code Base and Articles links. The Championship link is optional. :)


Start by downloading and installing the software, and trying the sample codes provided with the installation, alongside all the reading you are doing. Your very first useful command is the Print() function.
Reason: