当新柱在载入指标的图表上出现时开始缓冲区的计算,黄色突出显示了直到需要计算的缓冲区的柱的编号,已计算的柱数的本地计数器就是用于它的,我们需要它是因为在新一天的开始时把prev_calculated常量重设为0, 尽管这样的重置是有必要的。 轴点指标的完整代码可以在Pivots.mq5文件中找到。 2. 基本策略 让我们根据所描述的
MQL5真是大势所趋啊,很高级,很智能
int OnInit 无 EA交易和指标 初始化(Init)事件处理器。允许使用void返回类型。 void OnDeinit const int reason EA交易和指标 清理(Deinit)事件处理器 void OnStart 无 脚本和服务 启动(Start)事件处理器 int OnCalculate const int rates_total,const int prev_calculated,const datetime &Time[],const double &...
token=os8C9Eld4P3LpB2KjC_aLw 2.3 MQL5的脚本、指标、EA运行机制 1. 脚本(Script) void OnStart() { Print("Hello, MT5"); } 2. 指标(Indicator) int OnInit() { Print("oninit"); return(INIT_SUCCEEDED); } int OnCalculate(const int rates_total, const int prev_calculated, const datetime ...
nice!!!
否则,就用 _prev_calculated - 1. 索引只重新计算最后一个柱。 计算指标缓冲区值的循环由 for 运算符执行 - 为了每一个已重新计算的指标缓冲区值,我们调用其主体中的趋势判断函数 TrendDetector。因此,只覆写这个函数,我们就能为计算趋势方向实施不同的计算式。在本例中,指标其他部分事实上并没有改变(外界...
const int prev_calculated, const datetime &Time[], const double &Open[], const double &High[], const double &Low[], const double &Close[], const long &Volume[], const long &Real_Volume[], const int &Spread[]) { ArraySetAsSeries(Open,true); ...
intOnCalculate(constintrates_total,constintprev_calculated,constintbegin,constdouble&price[]) {return(rates_total); } 此函数的第一个版本的参数中包括 time[] 数组,而该数组中的元素则包含所有柱的时间。 使用第二个版本时,以及编制 EA 程序、安排对于从指标到其它时间框架上各柱时间的访问时,我们采用 Cop...
Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Cancel Create saved search Sign in Sign up Reseting focus {{ message }} KonzACDC / MQL5_MT5_EA Public Notifications You must be signed in to change notification settings Fork 14 Star 32 ...
Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Cancel Create saved search Sign in Sign up Reseting focus {{ message }} KonzACDC / MQL5_MT5_EA Public Notifications You must be signed in to change notification settings Fork 14 Star 32 ...