【发布时间】:2015-03-28 20:25:35
【问题描述】:
我正在学习 MQL4。在他们的参考网站上,创建自定义指标如下:
#property indicator_chart_window
int init(){
return(0);
}
int deinit(){
ObjectsDeleteAll();
return(0);
}
int start(){
return(0);
}
但是当我从 MetaEditor 中创建一个新指标时,我得到了另一种语法,如下所示:
int OnInit()
{
//--- indicator buffers mapping
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
//---
//--- return value of prev_calculated for next call
return(rates_total);
}
为什么不一样?
有没有人可以推荐给我的网页链接或书? 根据我的阅读,最好的地方是 MQL4 网站,但它看起来不同,我不知道现在该去哪里。
任何帮助将不胜感激。提前致谢。
【问题讨论】:
标签: algorithmic-trading mql4 metatrader4 forex