MQL4 Programs
program running
1.script 2.Expert advisor 3. indicator
int OnInit() 1. 2. 3 allowto use void return type
void OnDeinit() 1.2. 3
void OnStart() 1 Start event handler
int OnCalculate( const int rates_total, const int prev_calculated,const datetime
&time[],const double &open[],const double &Hight[],const double &Low[],const double
&Close[],const long &tickVolume[], const long &Volume[],const in &spread[]) 3
Calculate event handler for all prices
void Ontick() 2 newTick event handler
void OnTimer() 1, 2, 3 timer event handler
double OnTester() 2 tester event handler
void OnChartEvent(const int id, const long &lparam,const double &dparam,const string
string &sparam) 2, 3 chartEvent
funtions prohibited in Indicators and Expert Advisors
The following functions are prohibited in indicators:
OrderSend()
SendFtp()
sleep()
ExpertRemove()
Messagebox()
the following functions are prohibited in Expert Advisors and scripts:
SetIndexBuffer();
IndicatorSetDouble()
IndicatorSetInteger()
IndicatorSetString()
the above restrictions apply to the called library.
Indicators are loaded in the follwing cases:
an indicator is attached to a chart;
terminal start(if the indicators was attached to the chart prior to the shutdown of the terminal);
loading of a template(if the indicator is attached to one of the profile charts);
change of a symbol and or timeframe of a chart ,to which the indicator is attached.
after the sucessful recompilation of an indicator(if the inidicators was attached to a chart);
change of input parameter of the indicator.
indicators are unloaded in the following cases:
when detaching an indictor from a chart;
terminal shutdown (if the indicator was attached to a chart);
loading of a template(if an indicator is attached to a chart);
closing od a chart to which the indicator was attched.
change of a profile(if the indicator is attached to one of chartss of the changed profile);
change of symbol and/ ortimeframe of a chart, to which the indicator is attached;
change of input paraneters of the indicator.
Expert Advisors are loading in the following cases:
when attaching an expert advior to a chart;
terminal start(if the expert advisor was attached to the chart prir to the shutdown of the terminal);
loading of a template(if the expert advisor attached to the chart is specified in the template);
change of a profile(if the expert advisor is attached to the one of the profile charts);
connection to an account ,even if the account number is the sanme(if the expert advisor was attached to the chart before the authorization of the terminal on the server).
expert advisors are unloaded in the following cases:
when detaching an expert advisor fron a chart
if a new Expert advisor ia attched to a chart,if another expert advisor has been attached already,this expert advisor is unloaded.
terminal shutdown(if the expoert Advisor was attached to a chart);
loading of a template(if an expert advisor is attached to teh chart);
close of a chart, to which the expert advisor is attached.
change of a profile (if the expert advisor attached to one of charts of the changed profile);
change of the account to which the terminal is cinnected(if the expert advissor was attached to the chart before the authorization of the terminal on the server)
calling the expertRemove() function.
loading an unloading of scripts
script are loaded immediately after they are attached to a chart and unloaded immediately after they complete their operation.
input parameters and source code compilation.
相关文章
- 02-12MQL4 Programs
- 02-12《how to design programs》第11章自然数
- 02-12高级编程 High Level: Building Intelligence into your programs.
- 02-12configure: error: cannot run Fortran 77 compiled programs问题解决
- 02-12OpenStack official programs
- 02-12验证实验 Blum’s Book: Sample programs in Chapter 04, 05 (MovingData)
- 02-12Proj THUDBFuzz Paper Reading: Language-Agnostic Generation of Compilable Test Programs
- 02-12IT项目管理中projects、programs和portfolio之间的关系,附带operations以及OPM之间的关系分析
- 02-12Cygwin自用脚本programs,列出自己定义的函数(主要用于快速运行Windows程序)和alias别名,并实现简单查找
- 02-12Proj THUDBFuzz Paper Reading: PMFuzz: Test Case Generation for Persistent Memory Programs