//+------------------------------------------------------------------+ //| indicator_temp.mq4 | //| kei | //| http://metatraderfx.net/ | //+------------------------------------------------------------------+ #property copyright "kei" #property link "http://metatraderfx.net/" #property indicator_chart_window //#property indicator_separate_window #property indicator_buffers 8 #property indicator_color1 Red #property indicator_color2 Blue #property indicator_color3 Green #property indicator_color4 Yellow #property indicator_color5 Magenta #property indicator_color6 Aqua #property indicator_color7 LimeGreen #property indicator_color8 Orange //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; double ExtMapBuffer4[]; double ExtMapBuffer5[]; double ExtMapBuffer6[]; double ExtMapBuffer7[]; double ExtMapBuffer8[]; //Parameter extern int Param1=0; extern int Param2=0; extern int Param3=0; extern int Param4=0; extern int Param5=0; extern int Param6=0; extern int Param7=0; extern int Param8=0; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,ExtMapBuffer1); SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,ExtMapBuffer2); SetIndexStyle(2,DRAW_LINE); SetIndexBuffer(2,ExtMapBuffer3); SetIndexStyle(3,DRAW_LINE); SetIndexBuffer(3,ExtMapBuffer4); SetIndexStyle(4,DRAW_LINE); SetIndexBuffer(4,ExtMapBuffer5); SetIndexStyle(5,DRAW_LINE); SetIndexBuffer(5,ExtMapBuffer6); SetIndexStyle(6,DRAW_LINE); SetIndexBuffer(6,ExtMapBuffer7); SetIndexStyle(7,DRAW_LINE); SetIndexBuffer(7,ExtMapBuffer8); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars = Bars - IndicatorCounted(); //---- for(int i = counted_bars - 1 ; i >= 0 ; i--) { DataSet(i); } //---- return(0); } //+------------------------------------------------------------------+ //Yuor DataSet! void DataSet(int i) { ExtMapBuffer1[i]=iMA(NULL,0,7,0,MODE_SMA,PRICE_CLOSE,i); ExtMapBuffer2[i]=iMA(NULL,0,7,0,MODE_EMA,PRICE_WEIGHTED,i); ExtMapBuffer3[i]=iMA(NULL,0,7,0,MODE_SMMA,PRICE_WEIGHTED,i); ExtMapBuffer4[i]=iMA(NULL,0,7,0,MODE_LWMA,PRICE_WEIGHTED,i); ExtMapBuffer5[i]=iMA(NULL,0,14,0,MODE_SMA,PRICE_WEIGHTED,i); ExtMapBuffer6[i]=iMA(NULL,0,14,0,MODE_EMA,PRICE_WEIGHTED,i); ExtMapBuffer7[i]=iMA(NULL,0,14,0,MODE_SMMA,PRICE_WEIGHTED,i); ExtMapBuffer8[i]=iMA(NULL,0,14,0,MODE_LWMA,PRICE_WEIGHTED,i); }