|
- #property indicator_chart_window //separate
- #property indicator_buffers 6
- #property indicator_color1 Red
- #property indicator_color2 Blue
- #property indicator_color3 Red
- #property indicator_color4 Blue
- #property indicator_color5 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);
- 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++)
- {
- E5[pos]=x-iMA(NULL,0,MA,0,0,0,pos);
- }
- pos++;
- }
- return(0);
- }
-
复制代码 |
|