|
本帖最后由 frlin2003 于 2017-8-18 11:38 编辑
- #property indicator_chart_window
- #property indicator_buffers 6
- #property indicator_color1 Red
- #property indicator_color2 Green
- #property indicator_color3 Red
- #property indicator_color4 Green
- #property indicator_color5 Red
- #property indicator_color6 Green
- int 变色布林=60;
- double sha[];
- double shaa[];
- double zho[];
- double zhon[];
- double xia[];
- double xiaa[];
- int init()
- {
- SetIndexBuffer(0,sha);
- SetIndexBuffer(1,shaa);
- SetIndexBuffer(2,zho);
- SetIndexBuffer(3,zhon);
- SetIndexBuffer(4,xia);
- SetIndexBuffer(5,xiaa);
- SetIndexStyle(0,0,DRAW_LINE,1,Red);
- SetIndexStyle(1,0,DRAW_LINE,1,Green);
- SetIndexStyle(2,0,DRAW_LINE,1,Red);
- SetIndexStyle(3,0,DRAW_LINE,1,Green);
- SetIndexStyle(4,0,DRAW_LINE,1,Red);
- SetIndexStyle(5,0,DRAW_LINE,1,Green);
- SetIndexDrawBegin(0,变色布林);
- SetIndexDrawBegin(1,变色布林);
- SetIndexDrawBegin(2,变色布林);
- SetIndexDrawBegin(3,变色布林);
- SetIndexDrawBegin(4,变色布林);
- SetIndexDrawBegin(5,变色布林);
- IndicatorDigits(Digits);
- return(0);
- }
- int start()
- {
- double temp0,temp1,temp2,temp3,temp4,temp5;
- int limit;
- int counted_bars=IndicatorCounted();
- if(counted_bars<0) return(-1);
- if(counted_bars>0) counted_bars--;
- limit=Bars-counted_bars;
- for(int i=limit; i>=0; i--)
- {
- sha[i]=EMPTY_VALUE;
- shaa[i]=EMPTY_VALUE;
- zho[i]=EMPTY_VALUE;
- zhon[i]=EMPTY_VALUE;
- xia[i]=EMPTY_VALUE;
- xiaa[i]=EMPTY_VALUE;
- temp0=iCustom(NULL,0,"Bands",0,i);
- temp1=iCustom(NULL,0,"Bands",0,i+1);
- temp2=iCustom(NULL,0,"Bands",1,i);
- temp3=iCustom(NULL,0,"Bands",1,i+1);
- temp4=iCustom(NULL,0,"Bands",2,i);
- temp5=iCustom(NULL,0,"Bands",2,i+1);
-
- if(temp0>=temp1)
- {
- sha[i]=temp0;
- sha[i+1]=temp1;
- zho[i]=temp2;
- zho[i+1]=temp3;
- xia[i]=temp4;
- xia[i+1]=temp5;
- }
- else
- {
- shaa[i]=temp0;
- shaa[i+1]=temp1;
- zhon[i]=temp2;
- zhon[i+1]=temp3;
- xiaa[i]=temp4;
- xiaa[i+1]=temp5;
- }
- }
- return(0);
- }
复制代码
双色布林.zip
(887 Bytes, 下载次数: 17, 售价: 10 金钱)
|
|