1 / 13
文档名称:

15 Lesson15 - Your First Expert Advisor (Part 3).pdf

格式:pdf   页数:13
下载后只包含 1 个 PDF 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

15 Lesson15 - Your First Expert Advisor (Part 3).pdf

上传人:bolee65 2014/4/30 文件大小:0 KB

下载得到文件列表

15 Lesson15 - Your First Expert Advisor (Part 3).pdf

文档介绍

文档介绍:MQL4 COURSE
By Coders’ guru


-15-
Your First Expert Advisor
Part 3
--------------------

In the previous two parts of this lesson, we have introduced our expert advisor and knew
the idea behind it.
And in the Appendix 2 we have studied the Trading Functions which we will use some of
them today in our expert advisor.

Today we will continue cracking the remaining code of the expert advisor.
I hope you have cleared your mind for our discovering mission.

The code we have:

//+------------------------------------------------------------------+
//| |
//| Coders Guru |
//| |
//+------------------------------------------------------------------+
#property copyright "Coders Guru"
#property link ""

//---- input parameters
extern double TakeProfit=;
extern double Lots=;
extern double TrailingStop=;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}

int Crossed (double line1 , double line2)
{
static int last_direction = 0;
static int current_direction = 0;

if(line1>line2)current_direction = 1; //up
if(line1<line2)current_direction = 2; //down



if(current_direction != last_direction) //changed
{
last_direction = current_direction;
return (last_direction);
}
else
{
return (0);
}
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----


t, t