//+------------------------------------------------------------------+ //| Sample1_Ind.mq4 | //| Copyright ゥ 2006, Toyolab FX | //| http://forex.toyolab.com | //+------------------------------------------------------------------+ #property copyright "Copyright ゥ 2006, Toyolab FX" #property link "http://forex.toyolab.com" #property indicator_chart_window #property indicator_buffers 1 //---- インディケータバッファ double Buf0[]; //+------------------------------------------------------------------+ //| インディケータ初期化関数 | //+------------------------------------------------------------------+ int init() { //---- バッファのインディケータへの割り当て SetIndexBuffer(0,Buf0); return(0); } //+------------------------------------------------------------------+ //| インディケータ処理関数 | //+------------------------------------------------------------------+ int start() { int i, limit = Bars-IndicatorCounted(); for(i=limit-1; i>=0; i--) { Buf0[i] = (Close[i]+Close[i+1]+Close[i+2]+Close[i+3])/4; } return(0); } //+------------------------------------------------------------------+