//+------------------------------------------------------------------+ //| 3EMAS Signals v0.1 .mq4 | //| Copyright © 2006, Forex-TSD.com | //| Written by nnjeim | //| | //+------------------------------------------------------------------+ #property copyright "Copyright © 2006, Forex-TSD.com " #property link "http://www.forex-tsd.com/" #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 White #property indicator_color2 Yellow //---- input parameters extern int LEMA=50; extern int MEMA=34; extern int SEMA=14; extern int ArrowShift=5; //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_ARROW); SetIndexArrow(0,233); SetIndexBuffer(0,ExtMapBuffer1); SetIndexEmptyValue(0,0.0); SetIndexStyle(1,DRAW_ARROW); SetIndexArrow(1,234); SetIndexBuffer(1,ExtMapBuffer2); SetIndexEmptyValue(1,0.0); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int limit,i; int counted_bars=IndicatorCounted(); if (counted_bars<0) return(-1); if (counted_bars>0) counted_bars--; limit=Bars-1; if(counted_bars>=1) limit=Bars-counted_bars-1; if (limit<0) limit=0; double curlema=0.0,prevlema=0.0,curmema=0.0,prevmema=0.0,cursema=0.0,prevsema=0.0; for (i=limit;i>=0;i--) { curlema=Close[i]-iMA(NULL,0,LEMA,0,MODE_EMA,PRICE_TYPICAL,i); prevlema=Close[i]-iMA(NULL,0,LEMA,0,MODE_EMA,PRICE_TYPICAL,i+1); curmema=Close[i]-iMA(NULL,0,MEMA,0,MODE_EMA,PRICE_TYPICAL,i); prevmema=Close[i]-iMA(NULL,0,MEMA,0,MODE_EMA,PRICE_TYPICAL,i+1); cursema=Close[i]-iMA(NULL,0,SEMA,0,MODE_EMA,PRICE_TYPICAL,i); prevsema=Close[i]-iMA(NULL,0,SEMA,0,MODE_EMA,PRICE_TYPICAL,i+1); ExtMapBuffer1[i]=0; ExtMapBuffer2[i]=0; if ((curlema>curmema) && (prevlemacursema)) ExtMapBuffer1[i]=Open[i]-ArrowShift*Point; if ((curlemaprevmema) && (curmema