//+------------------------------------------------------------------+ //| SAInpData.mq5 | //| Copyright 2010, MetaQuotes Software Corp. | //| http://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "2010, MetaQuotes Software Corp." #property link "http://www.mql5.com" #property description "Data for Spectrum Analyzer" #property version "1.00" #property indicator_separate_window #property indicator_buffers 1 #property indicator_plots 1 //--- plot Level0 #property indicator_label1 "Data" #property indicator_type1 DRAW_LINE #property indicator_color1 DodgerBlue #property indicator_style1 STYLE_SOLID #property indicator_width1 1 //--- indicator buffers double DataBuffer[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- indicator buffers mapping SetIndexBuffer(0,DataBuffer,INDICATOR_DATA); ArraySetAsSeries(DataBuffer,true); //--- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate(const int rates_total, const int prev_calculated, const datetime& time[], const double& open[], const double& high[], const double& low[], const double& close[], const long& tick_volume[], const long& volume[], const int& spread[]) { int i; ArrayInitialize(DataBuffer,0.0); DataBuffer[0]=0.4360409450; DataBuffer[1]=0.3658689069; DataBuffer[2]=0.2460452079; DataBuffer[3]=0.1104506886; DataBuffer[4]=-0.0054034585; DataBuffer[5]=-0.0760367731; DataBuffer[6]=-0.0933058722; DataBuffer[7]=-0.0670110374; DataBuffer[8]=-0.0190795053; DataBuffer[9]=0.0259609206; DataBuffer[10]=0.0502044896; DataBuffer[11]=0.0477818607; DataBuffer[12]=0.0249252327; DataBuffer[13]=-0.0047706151; DataBuffer[14]=-0.0272432537; DataBuffer[15]=-0.0338917071; DataBuffer[16]=-0.0244141482; DataBuffer[17]=-0.0055774838; DataBuffer[18]=0.0128149838; DataBuffer[19]=0.0226522218; DataBuffer[20]=0.0208778257; DataBuffer[21]=0.0100299086; DataBuffer[22]=-0.0036771622; DataBuffer[23]=-0.0136744850; DataBuffer[24]=-0.0160483392; DataBuffer[25]=-0.0108597376; DataBuffer[26]=-0.0016060704; DataBuffer[27]=0.0069480557; DataBuffer[28]=0.0110573605; DataBuffer[29]=0.0095711419; DataBuffer[30]=0.0040444064; DataBuffer[31]=-0.0023824623; DataBuffer[32]=-0.0067093714; DataBuffer[33]=-0.0072003400; DataBuffer[34]=-0.0047717710; DataBuffer[35]=0.0005541115; DataBuffer[36]=0.0007860160; DataBuffer[37]=0.0130129076; DataBuffer[38]=0.0040364019; //--- return value of prev_calculated for next call return(rates_total); } //+------------------------------------------------------------------+