![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
This is a great thread. Thanx for all your help Codersguru. I am sure it will help alot of us. Cant wait for your next lesson.
Thank
This is a great thread. Thanx for all your help Codersguru. I am sure it will help alot of us. Cant wait for your next lesson.
Thanks dude.![](https://c.mql5.com/forextsd/smiles/face.png)
Please download the new lesson and tell me what do you think?
This is agreat course. I went through the lessons until the first custom indicator. I have some understanding, but not thorogh. I hope in due course I will get the hang of it. THANK YOU CODEGURU for putting together this course.
I tried to convert one of my simple indicator from mql2, but there is something wrong. Can you check it?
MQL to MQL4
This is agreat course. I went through the lessons until the first custom indicator. I have some understanding, but not thorogh. I hope in due course I will get the hang of it. THANK YOU CODEGURU for putting together this course. I tried to convert one of my simple indicator from mql2, but there is something wrong. Can you check it?
saslam,
Please try this code:
//| 2PROC.mq4 |
//| saslam |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "saslam"
#property link "http://www.metaquotes.net"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//----
//int ExtCountedBars=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,ExtMapBuffer2);
string short_name = "2PROC";
IndicatorShortName(short_name);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int pos;
int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
pos=Bars-counted_bars;
//---- main calculation loop
while(pos>=0)
{
// ----Main loop
ExtMapBuffer1[pos]=(Close[pos+1]-Close[pos+3])+Close[pos+2];
ExtMapBuffer2[pos]=(Close[pos+0]-Close[pos+2])+Close[pos+1];
pos--;
}
//----
return(0);
}
//+------------------------------------------------------------------+Thanks Codesguru, it is working now. I realize my mistake. Looking forward to your future lessons on Indicators.
Thank You!
Coders' guru,
I am very new to metatrader and know very little about programing. I was looking for info on programming in metatrader. And came across your course (which made me decide to join). I look forward to learning from your course and your posts!!! Thanks again!
You're welcome.
Coders' guru, I am very new to metatrader and know very little about programing. I was looking for info on programming in metatrader. And came across your course (which made me decide to join). I look forward to learning from your course and your posts!!! Thanks again!
JN75,
You're welcome!
I hope you find it a useful place.
great idea
hi Guru
i am new in this, i found unique your idea, please i just have one lesson .How many have you post, i have the first one.
have a nice weekend
All the lessons' links
Hi there,
You have to change the option from the Last month to Last 2 months in your "Display Options".
Anyway these are all the lessons' links:
Welcome to the MQL4 course
Lesson 2 - SYNTAX
Lesson 3 - MQL4 Data types
Lesson 4 - MQL4 Operations & Expressions
Loops & Decisions (Part1)
Lesson 6 - Loops & Decisions (Part2)
Lesson 7 - Functions
Lesson 8 - Variables in MQL4
Lesson 9 - Preprocessors
Lesson 10 - Your First Indicator (Part1)
Lesson 11 - Your First Indicator (Part2)
Lesson 12 - Your First Indicator (Part3)
Lesson 13 - Your First Expert Advisor (Part 1)
Lesson 14 - Your First Expert Advisor (Part 2)
Appendix 1 - BARS
Appendix 2 - Trading functions
where can we download all lessons?
Thank you very much!!!