//+------------------------------------------------------------------+ //| ARIMA.mq4 | //| Copyright © 2009, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright © 2009, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" #property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 Magenta //---- input parameters extern datetime start=D'2011.11.11'; extern int period=5;//порядок модели //---- buffers double Ext[]; int st; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ double fak[100]; double a[100][100], b[100], x[100]; int init() { //---- indicators SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,Ext); st=iBarShift(NULL,0,start); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(), i, j, k; //---- for(i=st;i>=0;i--) { calc_fak(i); //выч автокорреляции prepare_matrix(); //подготовка матрицы slau(period, a, b, x); //решение слау Ext[i]=res_sum(i); //рассчёт результирующей суммы } //---- return(0); } //+------------------------------------------------------------------+ double res_sum(int j) { //Print("*********"); double sum=0; for(int i=0;i=0;i--) { h=b[i]; for(j=i;j