6. int LineNo=0; stringmyObjectName="Line"+LineNo; void iDrawLine(stringmyObjectName,int myFirstTime,double myFirstPrice,intmySecondTime,double mySecondPrice) { iTwoPointsLine(myObjectName,myFirstTime,myFirstPrice,mySecondTime,mySecondPrice,STYLE_DOT,Green);...
SetIndexStyle(0, DRAW_LINE,STYLE_SOLID,3,阶梯颜色); SetIndexBuffer(0, bufferLadder); SetIndexStyle(1, DRAW_LINE,STYLE_SOLID,2,上涨颜色); SetIndexBuffer(1, bufferUp); SetIndexStyle(2, DRAW_LINE,STYLE_SOLID,2,下跌颜色); SetIndexBuffer(2, bufferDn); SetIndexBuffer(3, bufferDirection); ...
SetIndexStyle的意思是设置我们要画的图形的类型,SetIndexStyle中的第一个参数0,表示我们要对第一个指标的样式进行设置,在MT4中,最多只能设置8个指标,编码是从0开始至7结束;第二个参数DRAW_LINE是MT4默认的系统变量,意思是告诉MT4我们将要在图表上画线。如果我们现在想在每根K线的中间部分画个箭头,该如何做呢?用...
1#property copyright"Copyright 2020"2#property link"https://www.mql5.com"3#property version"1.00"4#property strict5#property indicator_separate_window6#property indicator_buffers37#property indicator_plots38//--- plot KLine9#property indicator_label1"KLine"10#property indicator_type1 DRAW_LINE11#p...
DRAW_LINE);SetIndexStyle(1,DRAW_LINE);SetIndexStyle(2,DRAW_HISTOGRAM);SetIndexDrawBegin(1,SignalEMA...
39、fer(0,buf);设置数组buf为第一条指标线SetIndexStyle(0,DRAW_LINE);设置第一条指标线线型为连续曲线return(0);函数结束语句int start()指标触发函数。与init函数不同,该函数在有数据变化时被触发,如果数据被 不断更新,则该函数将不断执行。start也是系统默认的函数名,但使用时也仍 然需要进行创设,所以也要...
画上升趋势线:myFirstTime:第1点时间——X1=AmyFirstPrice:第1点价格——Y1=Low[A]mySecondTime:第2点时间——X2=X3mySecondPrice:第2点价格——Y2=Low[X3] iDrawLine(A,Low[A],X3,Low[X3]); B)当为下跌趋势:直线斜率(R):R=(High[B]-High[A])/L; //两点之间的斜率计算每根K线最低价与趋...
#property indicator_type1 DRAW_LINE #property indicator_color1 clrRed #property indicator_style1 STYLE_SOLID #propertyindicator_width1 1 //--- plot up #property indicator_label2 "up" #property indicator_type2 DRAW_ARROW #property indicator_color2 clrGold ...
画图最基本的操作是画直线。下面的两个例子将演示如何在图表上画一条直线。首先在MetaEditor编辑器中创建一个客户指标文件,名字可以任意,我这里就把它命名为Lesson1_DrawLine。然后在其中的start()函数中添加下面的代码:添加完毕后,按F5编译代码,然后在MT4中打开任意一张图表,把编译好的指标Lesson1_DrawLine添加...
SetIndexStyle(2, DRAW_LINE,STYLE_SOLID,2,下跌颜色); SetIndexBuffer(2, bufferDn); SetIndexBuffer(3, bufferDirection); return(0); } //+---+ int deinit() { return(0); } //+---+ datetime dtLastTime = 0; int start() { double ...