double buyArrowBuffer[]; //--- plot sellArrow const string sellArrow = "sellArrow"; #property indicator_label4 "sellArrow" #property indicator_type4 DRAW_ARROW #property indicator_color4 clrLime #property indicator_style4 STYLE_SOLID #property indicator_width4 1 double sellArrowBuffer[]; //...
可以看到上图有一个错误是“zero divide in “hudge indicator.mq4””,这个错误的意思是在hudge indicator.mq4这个文件中出现了除以0的情况导致程序无法执行下去而中断了。 有时程序不会提示错误的详细内容,而会显示一个错误代码,这时我们可以在MQL4帮助文件中查找ERR来查找错误代码对应的错误编号,如下图: 这里的错...
#property indicator_chart_window // 设置指标线数为 1 条, 颜色为黄色 #property indicator_buffers 1 #property indicator_color1 Yellow double mk[]; extern int 均线 = 10; double temp0; double temp1; int init() { // 指标线数量为 1 条 IndicatorBuffers(1); // 第 1 条指标线的数组为 mk[...
在上面的代码中,#property indicator_color1 clrBlue设置了第一条指标线的颜色为蓝色。 4. 额外的颜色选择或自定义颜色的方法 虽然MQL4提供了许多预定义的颜色常量,但你也可以通过自定义RGB值来设置颜色。这通常需要使用ObjectSetInteger函数与OBJPROP_COLOR属性来实现。以下是一个设置自定义颜色的示例: mql4 ObjectSet...
#property indicator_color1 Silver //--- 指标参数 extern int FastEMA=12;extern int SlowEMA=2...
#property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 Blue input int period = 14; double buffer[]; int OnInit() { SetIndexBuffer(0, buffer); return(INIT_SUCCEEDED); } void OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[...
structures; classes. In terms ofOOPcomplex data types are called abstract data types. Thecoloranddatetimetypes make sense only to facilitate visualization and input of parameters defined from outside - from the table of Expert Advisor or custom indicator properties (theInputstab). Data ofcolorandda...
indicator_maximum double The top scaling limit for a separate indicator window indicator_labelN string Sets a label for the N-thgraphic seriesdisplayed in DataWindow indicator_colorN color The color for displaying line N, where N is the number ofgraphic series; numbering starts from 1 ...
#property indicator_buffers 2 定义了有2条线 #property indicator_color1 Silver #property indicator_color2 Red 定义颜色 ,银色和红色 #property indicator_width1 2 定义线的宽度。 extern int FastEMA=12; extern int SlowEMA=26; extern int SignalSMA=9; ...
#property indicator_buffers 2 定义了有2条线 #property indicator_color1 Silver #property indicator_color2 Red 定义颜色 ,银色和红色 #property indicator_width1 2 定义线的宽度。 extern int FastEMA=12; extern int SlowEMA=26; extern int SignalSMA=9; ...