2013-12-30

MQL4 - Lesson 1 - Notes

You can access Jim Dandy's MQL4 youtube course here for free. He also has a website with videos in higher resolution. You can check them out here and here. Due to the lower resolution of the free youtube videos the code is a bit blur. Nevertheless I could finish the first lesson successfully ;-). I will list the notes I took in each lesson.

Difference between mq4 file and ex4 file
  • ex4 file computer machine file - can be used by mt4 and appears in the navigator window (mql4 does not)
  • mq4 file can be edited; code can be seen
  • mq4 -> compile -> ex4
Comment function
  • how to comment 1: put double hashmarks (2 forward slashes = //) before each line (greys out a single line); this comments out code lines -> EA cannot see them -> make your notes in the code
  • how to comment 2: comment out a whole section -> combination of forward slash and asterisk -> /* code */
Property copyright and link
  • don't have to be in the code
  • appears as popup of ex4 file in the navigator window
Functions (for indicators and Eas)
  • initialisation function: what should the EA do when you first drop it on a chart? get prices?
  • deinisalisation function: what should the EA do when you remove it from a chart? clean arrows or lines for example
  • start function: what should the EA do when the price changes (tick by tick)? Here is the actual code of the EA 
  • Advice: You can build a new EA with the editor and take a look at the code

1 comment: