//+------------------------------------------------------------------+ //| iMirror.mq4 | //| | //| | //+------------------------------------------------------------------+ #property copyright "" #property link "" #property indicator_chart_window #property indicator_buffers 4 #property indicator_color1 Blue #property indicator_color2 Red #property indicator_color3 Blue #property indicator_color4 Red #property indicator_width1 1 #property indicator_width2 1 #property indicator_width3 3 #property indicator_width4 3 //---- input parameters extern int ExtParam1; //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; double ExtMapBuffer4[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_HISTOGRAM); SetIndexBuffer(0,ExtMapBuffer3); SetIndexStyle(1,DRAW_HISTOGRAM); SetIndexBuffer(1,ExtMapBuffer4); SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,3); SetIndexBuffer(2,ExtMapBuffer1); SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,3); SetIndexBuffer(3,ExtMapBuffer2); //---- return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int First_Visible_Index=FirstVisibleBar(); int Last_Visible_Index=FirstVisibleBar()-BarsPerWindow(); if(Last_Visible_Index<0)Last_Visible_Index=0; if(Last_Visible_Index<0)Last_Visible_Index=0; double wr=(High[Highest(NULL,0,MODE_HIGH,First_Visible_Index-Last_Visible_Index+1,Last_Visible_Index)]-Low[Lowest(NULL,0,MODE_LOW,First_Visible_Index-Last_Visible_Index+1,Last_Visible_Index)])/Point; for(int i=0;iOpen[i]){ hh=lo+KK*(ExtMapBuffer3[i]-ln); ll=lo+KK*(ExtMapBuffer4[i]-ln); ExtMapBuffer4[i]=hh; ExtMapBuffer3[i]=ll; } else{ ExtMapBuffer3[i]=lo+KK*(ExtMapBuffer3[i]-ln); ExtMapBuffer4[i]=lo+KK*(ExtMapBuffer4[i]-ln); } } return(0); } //+------------------------------------------------------------------+