//+------------------------------------------------------------------+ //| govinda_live.mq4 | //| Copyright © 2008, WhiteForex.com | //| Written by Govinda | //| | //+------------------------------------------------------------------+ #property copyright "Copyright © 2008, WhiteForex.com " #property link "http://www.WhiteForex.com/" #property indicator_separate_window #property indicator_minimum 0.00 #property indicator_maximum 0.08 #property indicator_buffers 6 #property indicator_color1 Blue #property indicator_color2 Red #property indicator_color3 LightBlue #property indicator_color4 Gold //---- indicator buffers double UpBuffer1[]; double DnBuffer1[]; double UpBuffer3[]; double DnBuffer3[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { string short_name; //---- indicator line SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,4); SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,4); SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,4); SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,4); SetIndexBuffer(0,UpBuffer1); SetIndexBuffer(1,DnBuffer1); SetIndexBuffer(2,UpBuffer3); SetIndexBuffer(3,DnBuffer3); IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)); //---- name for DataWindow and indicator subwindow label short_name="Govinda Live"; IndicatorShortName(short_name); SetIndexLabel(0,NULL); SetIndexLabel(1,NULL); SetIndexLabel(2,NULL); SetIndexLabel(3,NULL); //---- SetIndexDrawBegin(0,55); SetIndexDrawBegin(1,55); SetIndexDrawBegin(2,55); SetIndexDrawBegin(3,55); //---- return(0); } //+------------------------------------------------------------------+ //| CCIFilter | //+------------------------------------------------------------------+ int start() { int i,signal,goup=0,godn=0; for(i=Bars-55-1;i>=0;i--) { double HA1o=iCustom(NULL,0,"govinda_math",0,i); double HA1c=iCustom(NULL,0,"govinda_math",1,i); double HA2o=iCustom(NULL,0,"govinda_math",0,i+1); double HA2c=iCustom(NULL,0,"govinda_math",1,i+1); double HA3o=iCustom(NULL,0,"govinda_math",0,i+2); double HA3c=iCustom(NULL,0,"govinda_math",1,i+2); double pc = iMA(NULL,0,1,0,MODE_SMA,PRICE_CLOSE,i); double pc1 = iMA(NULL,0,1,0,MODE_SMA,PRICE_CLOSE,i+1); double pL = iMA(NULL,0,1,0,MODE_SMA,PRICE_LOW,i); double pH = iMA(NULL,0,1,0,MODE_SMA,PRICE_HIGH,i); double pL1 = iMA(NULL,0,1,0,MODE_SMA,PRICE_LOW,i+1); double pH1 = iMA(NULL,0,1,0,MODE_SMA,PRICE_HIGH,i+1); double ema55 = iMA(NULL,0,55,0,MODE_EMA,PRICE_CLOSE,i); double ema551 = iMA(NULL,0,55,0,MODE_EMA,PRICE_CLOSE,i+1); double osma1 = iOsMA(NULL,0,12,26,9,PRICE_CLOSE,i); double osma11 = iOsMA(NULL,0,12,26,9,PRICE_CLOSE,i+1); double kijun = iIchimoku (NULL,0,9,26,52,MODE_KIJUNSEN,i); double tenkan = iIchimoku (NULL,0,9,26,52,MODE_TENKANSEN,i); double kijun1 = iIchimoku (NULL,0,9,26,52,MODE_KIJUNSEN,i+1); double tenkan1 = iIchimoku (NULL,0,9,26,52,MODE_TENKANSEN,i+1); if (pc > ema55) signal=1; if (pc < ema55) signal=-1; if ( pc > ema55 && pc > kijun && pc > tenkan && osma1 > 0 && HA1o <= HA1c && pc1 <= ema551 || pc1 <= kijun1 || pc1 <= tenkan1 || osma11 <= 0 || pL <= ema55 || pL <= kijun || pL <= tenkan || HA2o > HA2c ) { signal=2; goup++; godn=0; } if ( pc < ema55 && pc < kijun && pc < tenkan && osma1 < 0 && HA1o >= HA1c && pc1 >= ema551 || pc1 >= kijun1 || pc1 >= tenkan1 || osma11 >= 0 || pH >= ema55 || pH >= kijun || pH >= tenkan || HA2o < HA2c ) { signal=-2; goup=0; godn++; } if (goup==1)signal=3; if (godn==1)signal=-3; if (signal==1) { UpBuffer1[i]=0; UpBuffer3[i]=0; DnBuffer1[i]=0; DnBuffer3[i]=0; } if (signal==2) { UpBuffer1[i]=1; UpBuffer3[i]=0; DnBuffer1[i]=0; DnBuffer3[i]=0; } if (signal==3) { UpBuffer1[i]=0; UpBuffer3[i]=1; DnBuffer1[i]=0; DnBuffer3[i]=0; } if (signal==-1) { UpBuffer1[i]=0; UpBuffer3[i]=0; DnBuffer1[i]=0; DnBuffer3[i]=0; } if (signal==-2) { UpBuffer1[i]=0; UpBuffer3[i]=0; DnBuffer1[i]=1; DnBuffer3[i]=0; } if (signal==-3) { UpBuffer1[i]=0; UpBuffer3[i]=0; DnBuffer1[i]=0; DnBuffer3[i]=1; } } return(0); }