#property copyright "Copyright © 2003 Ëàðèîíîâ Àëåêñåé" #property link "http://fx.winm.ru" #property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 Yellow extern int perMA1=3; extern int viborka=300; extern int Shift=0; extern double Band=0.0; double Buf1[]; int init() { IndicatorDigits(Digits); //SetIndexStyle(0,DRAW_ARROW); //SetIndexArrow(0,160); SetIndexBuffer(0,Buf1); SetIndexShift(0,Shift); SetIndexLabel(0,"per:"+perMA1+""); return(0); } int start() { double b,a1,y1,y2,op; for(int i=0; i<viborka; i++) { double sumXY=0.0,sumX=0.0,sumY=0.0,sumX2=0.0; int ll,hh,mm=0; for(int j=i; j<=99999; j++) { if (TimeDay(Time[j])!=TimeDay(Time[j+1])) { mm++; op=Open[j]; sumXY=sumXY+(mm*op); sumX=sumX+mm; sumY=sumY+op; sumX2=sumX2+(mm*mm); } if (mm>=perMA1+1) break; } b=(((perMA1+1)*sumXY)-(sumX*sumY))/(((perMA1+1)*sumX2)-(sumX*sumX)); a1=(sumY-(b*sumX))/(perMA1+1); y2=a1+b; Buf1[i] = y2; } }
Sample
Analysis
Market Information Used:
Series array that contains open time of each bar
Series array that contains open prices of each bar
Indicator Curves created:
Indicators Used:
Custom Indicators Used:
Order Management characteristics:
Other Features: