All lessons of Codersguru:
Mql - Metatrader Development Course | www.metatrader.info
All Codersguru lessons + questions/replies and so on are on this section Metatrader 4 mql 4 - Development course - Forex-TSD
some usefull links:
can't you autotrade?
Trading technique (something about how to trade):
MetaTrader 5 - everything for automated trading!
Automated Trading Championship 2010
How to prepare metatrader for trading - read this thread.
How to attach simple indicators to the chart
How to attach simple indicators to the chart.
in case the indicators are already installed in Metatrader.
For example, I want to attach some indicators to EURUSD chart, H1 timeframe:
1. Check symbol in 'Market Watch' window (EURUSD should be there, if not - right mouse click on window to install this symbol to the Metatrader).
2. Open the chart.
3. Go to 'History Center' and download the data from your broker (double mouse click on timeframe under selected the symbol to download the data from your broker)
4. Refresh the chart (synchronize the data/bars on the chart with the data from 'History Center').
5. Attach indicators to the chart.
6. Check 'Max Bars in Chart' (affected on the memory and CPU power) - for the indicators using limited number of bars in calculation.
Watch small video (attached) about how to do it step by step.
Download Winrar from here (to open attachment)
Simple explanation from barryvincent is on this post.
Ask all your questions on this thread https://www.mql5.com/en/forum/176352
How to backtest EAs
How to backtest EAs.
in case the EAs and indicators are already installed in Metatrader.
Starting procedure is the same one:
- Check symbol in 'Market Watch' window (EURUSD should be there, if not - right mouse click on window to install this symbol to the Metatrader).
- Go to 'History Center' and download the data from your broker (double mouse click on timeframe under selected the symbol to download the data from your broker)
- Check 'Max Bars in History' to be maximum one.
and so on.
Watch small video.
1. First backtesting is EA from elite section (author is Tokarus).
2. Second backtesting is EA from this thread https://www.mql5.com/en/forum/general (first version; author is firedave).
how to create template and how to load template
You attached all the indicators to the chart ... and you want to save the settings? Learn how to create template and how to load template.
Ask all your questions on this thread https://www.mql5.com/en/forum/176352
How create template -
How to use template -
How to use external template file (in case someone on the forum placed it) -
How to attach simple EA to the chart
How to attach simple EA to the chart.
Why "simple" EA?
In case of EA is using just one timeframe (your chart timeframe) with no any indicators and library files so it is simple EA. Simple to install in Metatrader (but may be not simple in coding and using).
Watch small video attached.
How to optimize the settings of simple EA
How to optimize the settings of simple EA.
- Open 'Strategy Tester' (in Metatrader's menu - go to 'View' and 'Strategy Tester'; or press Ctrl+R).
- make sure that the data you are using for optimizing is giving you 90% modelling quality. How to make sure? Backtest for the same time period with same timeframe as you will use for optimizing (watch video).
- optimization (watch video).
- save optimized settings to pre-set file (you can load this settings pressing 'Load' if you will need it some day);
I used well-known simple EA (Frank_mod EA modified for elite section by Kalenzo).
If the members are asking you about the settings of some EA so the best way is to post pre-set file (other people will easy load this file so no need to type/change the settings manually).
How to install simple indicator
How to install simple indicator.
1. Place mq4 indicator's file to /indicator's folder in Metatrader's directory of your computer. For example: C:\Program Files\MetaTrader - Alpari UK_1\experts\indicators
2. Open MetaEditor and find your mq4 indicator and open it in MetaEditor:
3. Compile file in MetaEditor pressing 'Compile':
4. Check for errors during the compillation. You can easy see the errors line in the code by double mouse click on error. And you can copy the bug's code line to the forum with the question "please help to fix this error", or you can fix it by yourself. This wondow will appear automatically after compillation:
5. Close MetaEditor. Open MetaTrader. Do you see your indicator listed here with yellow icon?
It is ex4 file was generated by MetaEditor. Metatrader is using ex4 files. So, you can attach indicator to the chart.
Download Winrar from here (to open attachments)
How to install simple EA
How to install simple EA.
Why "simple EA"? Because Ea is not using any custm indicator and any custom library file. Simple because simple to install.
1. Place mq4 EA's file to Data Folder\experts folder (read this
article to find about data Folder).
2. Open MetaEditor and find your mq4 EA, and open this EA (which is located on the left side) in MetaEditor.
4. Check for errors during the compillation. You can easy see the errors line in the code by double mouse click on error. And you can copy the
bug's code line to the forum with the question "please help to fix this error", or you can fix it by yourself. This window will appear
automatically after compillation.
5. Close MetaEditor. Open MetaTrader. Do you see your EA listed here with yellow/blue icon?
It is ex4 file was generated by MetaEditor. Metatrader is using ex4 files. So, you can attach EA to the chart.
How to know which indicator is simple and which is complex
How to know which indicator is simple and which is complex.
Why complex indicator?
If indicator is using the other indicators so it is not simple, right? It is complex indicator.
Let's describe the example about Z_MTF_ DoublecciWoody indicator from this thread https://www.mql5.com/en/forum/trading_systems
This Z_MTF_ DoublecciWoody indicator is using the other indicator: DoublecciWoody indicator. We may look inside the code and understand it: read this post.
That's fine if I am a coder and I can look inside that code and I will understand which is simple indicator and which is complex one. But if I am not coder so I can also look inside the code but I will understand nothing.
So, what to do?
It is very simple.
It is our example with Z_MTF_ DoublecciWoody indicator:
So to use one complex indicator (let's say - main indicator) we need additional indicator (let's say - subsidiary indicator).
We need to attach to the chart the main indicator only.
And it is the example of sucessfull installation of our complex indicator:
Main one may be EA, script and indicator.
subsidiary one may be anything as well so we should look at expert menu in Terminal in Metatrader just to know:
- which indicator or EA or script is complex one
- which additional (subsidiary) files we need (names of the files and so on) for our main one to work correctly.
What is pre-set or set file
What is pre-set or set file.
Set files (or pre-set files) are the settings of the EAs.
- To use in trading : during attaching EA to the chart - place set file (pre-set file) to the following folder: [...MQL4\presets] for MT4 or [...MQL5\presets] for MT5, and press 'Load'.
We can also create those files pressing 'Save':
- To use in backtesting or optimizing the settings place the file to the following folder: [...MetaQuotes\Terminal\...\tester] for MT4 or [...MQL5\profiles\tester] for MT5 - and, during attaching EA to the chart - press 'Load'.
Set files are just a settings of the EA. Nothing more. Just a settings. It saves our time because we do not need to type/change the settings in the EA manually. All we need is just to use set files.
If someone is asking you:
"what is the settings in your EA?"
so you will probable will post the set file as a reply (you will create the file with your settings and will attach to your post to the forum).
"what is the settings in your indicators on the chart?"
so you will probable will give template file as a reply.
More Programming Student Tips
This thread "Things Coders' Guru Never Taught Me" has many programming tips that you need to know if you are learning the MQL4 language: