Programming in MetaTrader.

 

Hi,

I've looked through many of the programs in the Code Bank and all that I've looked at have NO COMMENTS in them to teach beginners how to program in MetaTrader.

There is the book (see link above) but it starts teaching by talking about variables and types etc. What I really want is an overview of using the language. What declarations/processes/functions need to be preformed in EVERY program. How do you use indidators (in the program or from an INCLUDE statement).

The order of instructions in this book are opposite to the way questions are comming to my mind to ask.

Are there any other way to learn MetaTrader programming?

Bill

 

Look at the sample EA's that come with MT.

Read the start() function as story from top down

In more complex EA's, read the functions mentioned in the 'story' as a sort of footnote that changes the events of the story.

Like every story, it has..

a beginning - the init()

the middle - start()

and an end - deinit()

Regard INCLUDEs as another form of footnote to be read in conjunction with the main story

As you go through the story, you meet characters (indicators) and you ask them the latest news, they tell you, you remember & move on

Later, you take one or more bits of news evaluate them and do things if the news seems positive, other things if its bad news, etc, etc

Sooo...

Look for the story :)

Good Luck

-BB-

 

could start Looking for MQL4 downloadable programming books thread, but of course you already decided to not deal with MQL4 book - a pity really, it would answer ALL your questions.

Yes... it may seem daunting but it gets easier. The above thread has link to a privately written tutorial which many around the world have enjoyed.

Additionally, MetaEditor HELP (from the beginning!) can give many clues/hints as to what's going on.

Please consider that it is not the language that is the issue here, it is the way one uses it combined with the many Terminal function calls.

What the language lacks in syntax richness can be overcome by using it to build bottom up tools which higher levels of code can call. Anything is possible with MQL4 - even using Windows API .dll's

another way???

programming is about doing the 1 step forwards and 10 steps backwards dance... over and over again!

one only get what one puts into it in the end.

Trust you enjoy it all.


btw, have been keeping a written list of all those questions that come into your mind?

You know, it really does help to dump them from the grey matter. They will all get answered almost involuntarily at times simply due to continued reading around what you are interested at the time!

Front to back is not always the most suitable way for many to learn - so just go with the flow and read whatever takes your fancy. Does not matter if not understand much of what reading... is an incremental process and before long you'll be having a wry smile at some of those questions which at one time were blowing your mind ;)

 

BB and fbj,

Thanks for your comments. I downloaded Sergey Koyalyov's book and will look through it. I also requested information for the programming course being constructed.

BB, I liked your story view of propgramming in MT4.

fbj, I have 20 years programming experience. I know how to cheat and look in the back of the book to learn how to use specific functions.

What I don't have is an overview of the steps necessary to program an EA. BB provided a starter for that. I had decided that the init, deinit and start functions were required in all programs. BB's view of it made the concepts stay a little longer in my mind.

O.K. I got these characters that tell me things about the market environment.

Super. I suspect there are 2 things I can do at this point, depending on the story bits:

1) Start a trade.

2) Close a trade if I'm already in one.

Alright, I'm starting to think in the EA terms, once I get those down I can learn the syntax from the documentation sources mentioned.

Thanks guys,

Bill