|
说明
1.图形背景色见图示颜色(白底蓝红K)
2.均线参数可调
3.K宽度为3像素
4.作用:未知
代码:
- #property indicator_chart_window
- #property indicator_buffers 6
- #property indicator_color1 SeaGreen
- #property indicator_color2 DeepPink
- #property indicator_color3 SeaGreen
- #property indicator_color4 DeepPink
- #property indicator_color6 Red
- double E1[];
- double E2[];
- double E3[];
- double E4[];
- double E5[];
- double D5[];
- int n;
- int ExtCountedBars=0;
- extern int MA=60;
- int init()
- {
- SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2);
- SetIndexBuffer(0, E1);
- SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,2);
- SetIndexBuffer(1, E2);
- SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,1);
- SetIndexBuffer(2, E3);
- SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,1);
- SetIndexBuffer(3, E4);
- SetIndexStyle(4,DRAW_LINE,0,1,Red);
- SetIndexBuffer(4, E5);
- SetIndexBuffer(5, D5);
- return(0);
- }
- int deinit()
- {
- return(0);
- }
- int start()
- {
- if(Bars<=10) return(0);
- int pos=0,limit=Bars-IndicatorCounted();
- n=WindowBarsPerChart();
- while(pos<n)
- {
- double x=WindowPriceMax()+WindowPriceMin();
- E1[pos]=x-Open[pos];
- E2[pos]=x-Close[pos];
- if (Open[pos]==Close[pos]) E2[pos]=x-Close[pos]-Point*0.1;
- if (Open[pos]<=Close[pos])
- {
- E3[pos]=x-Low[pos];
- E4[pos]=x-High[pos];
- }
- else
- {
- E4[pos]=x-Low[pos];
- E3[pos]=x-High[pos];
- }
- for(int i=0; i<limit; i++)
- {
- D5[i]=iMA(NULL,0,MA,0,0,0,i);
- E5[pos]=x-D5[pos];
- }
- pos++;
- }
- return(0);
- }
-
复制代码
来源: MT4平台显示反K线指标(主图显示分享) |
|