//+------------------------------------------------------------------+ //| mtf i-GentorCCIM_v.1.1.mq4 | //| Egorov Gennadiy | //| 2005.08.20 KimIV v.0.0 | //| Íåìíîãî ìîäåðíèçèðîâàë, äîáàâèâ LSMA è ïîìåíÿâ å¸ ìåñòàìè ñ ÅÌÀ | //| 2005.08.20 KimIV v.0.1 | //| Îñâîáîäèë îäèí áóôåð | //| 2005.08.20 KimIV v.0.2 | //| Óáðàë LSMA è EMA. | //| Ñäåëàë ñèãíàëüíûé øåñòîé áàð è òðåíäîâóþ ðàñêðàñêó | //| 2005.08.20 KimIV v.0.3 | //| Ïîïûòêà óáðàòü ãëþê ñ òðåíäîâîé îêðàñêîé. | //| 2005.08.21 KimIV v.0.4 | //| Ïîñëåäîâàòåëüíîñòü îòðèñîâêè ëèíèé (TCCI ïîâåðõ îñòàëüíûõ). | //| Êîììåíòàðèè. | //| 2005.08.21 KimIV v.1.0 | //| Íîìåð ñèãíàëüíîãî áàðà è äåëüòó âî âíåøíèå ïàðàìåòðû. | //| 2005.08.21 KimIV v.1.1 | //|  êîììåíòû âûâåë ðàññòîÿíèÿ ìåæäó EMA, LSMA è Close. | //+------------------------------------------------------------------+ //mod2008fxtsd ki #property copyright "Egorov Gennadiy, FX Sniper, KimIV" #property link "http://www.kimiv.ru" #property indicator_separate_window #property indicator_maximum 300 #property indicator_minimum -300 #property indicator_buffers 7 #property indicator_color1 Silver #property indicator_color2 Yellow #property indicator_color3 MediumSeaGreen #property indicator_color4 DarkOrchid #property indicator_color5 DarkSlateGray #property indicator_color6 Red #property indicator_color7 DarkOrange #property indicator_width1 1 #property indicator_width2 2 #property indicator_width3 2 #property indicator_width4 2 #property indicator_width5 1 #property indicator_width6 1 #property indicator_width7 1 #property indicator_level1 300 #property indicator_level2 200 #property indicator_level3 100 #property indicator_level4 50 #property indicator_level5 -50 #property indicator_level6 -100 #property indicator_level7 -200 #property indicator_level8 -300 #property indicator_levelcolor DarkOliveGreen //------- Âíåøíèå ïàðàìåòðû ------------------------------------------ extern int FastCCIPeriod = 6; // Ïåðèîä áûñòðîãî CCI extern int SlowCCIPeriod = 14; // Ïåðèîä ìåäëåííîãî CCI extern int NSignalBar = 5; // Íîìåð ñèãíàëüíîãî áàðà extern int Delta = 6; // Äîïóñê â áàðàõ extern bool MarkBarClose = true; extern int MarkLevel = -25; extern int timeFrame = 0; extern string timeFrames = "M1;5,15,30,60H1;240H4;1440D1;10080W1;43200MN|0-CurrentTF"; //------- Áóôåðû èíäèêàòîðà ------------------------------------------ double HistCCI[]; double SignalBar[]; double TrendUp[]; double TrendDn[]; double SlowCCI[]; double FastCCI[]; string IndicatorFileName; double BarCloseMark[]; //------- Ãëîáàëüíûå ïåðåìåííûå -------------------------------------- //--- void init() { IndicatorDigits(2); SetIndexBuffer(0, HistCCI); SetIndexBuffer(1, SignalBar); SetIndexBuffer(2, TrendUp); SetIndexBuffer(3, TrendDn); SetIndexBuffer(4, SlowCCI); SetIndexBuffer(5, FastCCI); SetIndexBuffer(6,BarCloseMark); SetIndexStyle (0, DRAW_HISTOGRAM); SetIndexStyle (1, DRAW_HISTOGRAM); SetIndexStyle (2, DRAW_HISTOGRAM); SetIndexStyle (3, DRAW_HISTOGRAM); SetIndexStyle (4, DRAW_LINE); SetIndexStyle (5, DRAW_LINE); SetIndexStyle (6, DRAW_ARROW); SetIndexArrow (6, 158); SetIndexEmptyValue(4,EMPTY_VALUE); SetIndexEmptyValue(5,EMPTY_VALUE); SetIndexEmptyValue(6,EMPTY_VALUE); SetIndexLabel (0, ""); SetIndexLabel (1, ""); SetIndexLabel (2, ""); SetIndexLabel (3, ""); SetIndexLabel (4, "trendCCI"); SetIndexLabel (5, "turboCCI"); SetIndexLabel (6, ""); switch(timeFrame) { case 1 : string TimeFrameStr= "M1"; break; case 5 : TimeFrameStr= "M5"; break; case 15 : TimeFrameStr= "M15"; break; case 30 : TimeFrameStr= "M30"; break; case 60 : TimeFrameStr= "H1"; break; case 240 : TimeFrameStr= "H4"; break; case 1440 : TimeFrameStr= "D1"; break; case 10080 : TimeFrameStr= "W1"; break; case 43200 : TimeFrameStr= "MN1"; break; default : TimeFrameStr= "TF0"; } IndicatorShortName("iGenWCCIv1.1M [" + TimeFrameStr + "] (" + FastCCIPeriod + ","+SlowCCIPeriod+") "); IndicatorFileName = WindowExpertName(); timeFrame = MathMax(timeFrame,Period()); if( MarkBarClose && timeFrame > Period()) SetIndexStyle(6,DRAW_ARROW); else SetIndexStyle(6,DRAW_NONE); SetIndexShift(6, timeFrame/Period()); } //--- int start() { bool fcu=False, fcd=False, fup=False, fdn=False; int shift, ss; int counted_bars=IndicatorCounted(); int i,limit; if(counted_bars<0) return(-1); if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; if (timeFrame != Period()) { datetime TimeArray[]; limit = MathMax(limit,timeFrame/Period()); ArrayCopySeries(TimeArray ,MODE_TIME ,NULL,timeFrame); for(i=0,int y=0; i<limit; i++) { if(Time[i]<TimeArray[y]) y++; HistCCI[i] = iCustom(NULL,timeFrame,IndicatorFileName,FastCCIPeriod,SlowCCIPeriod, NSignalBar,Delta,MarkBarClose,MarkLevel, 0,y); SignalBar[i] = iCustom(NULL,timeFrame,IndicatorFileName,FastCCIPeriod,SlowCCIPeriod, NSignalBar,Delta,MarkBarClose,MarkLevel, 1,y); TrendUp[i] = iCustom(NULL,timeFrame,IndicatorFileName,FastCCIPeriod,SlowCCIPeriod, NSignalBar,Delta,MarkBarClose,MarkLevel, 2,y); TrendDn[i] = iCustom(NULL,timeFrame,IndicatorFileName,FastCCIPeriod,SlowCCIPeriod, NSignalBar,Delta,MarkBarClose,MarkLevel, 3,y); SlowCCI[i] = iCustom(NULL,timeFrame,IndicatorFileName,FastCCIPeriod,SlowCCIPeriod, NSignalBar,Delta,MarkBarClose,MarkLevel, 4,y); FastCCI[i] = iCustom(NULL,timeFrame,IndicatorFileName,FastCCIPeriod,SlowCCIPeriod, NSignalBar,Delta,MarkBarClose,MarkLevel, 5,y); if(Time[i]==TimeArray[y]) BarCloseMark[i] = iCustom(NULL,timeFrame,IndicatorFileName,FastCCIPeriod,SlowCCIPeriod, NSignalBar,Delta,MarkBarClose,MarkLevel, 6,y); } return(0); } for (shift=Bars; shift>=0; shift--) { TrendUp[shift] = 0; TrendDn[shift] = 0; FastCCI[shift] = iCCI(NULL, 0, FastCCIPeriod, PRICE_TYPICAL, shift); SlowCCI[shift] = iCCI(NULL, 0, SlowCCIPeriod, PRICE_TYPICAL, shift); HistCCI[shift] = SlowCCI[shift]; BarCloseMark[shift] =MarkLevel; if (HistCCI[shift+1]*HistCCI[shift]<0) { if (ss<=Delta) { if (fup && HistCCI[shift]>0) fcu = True; else fcu = False; if (fdn && HistCCI[shift]<0) fcd = True; else fcd = False; } else { if (ss<NSignalBar) { fup = False; fdn = False; fcu = False; fcd = False; } } ss = 1; } else ss++; if (ss==NSignalBar) SignalBar[shift] = HistCCI[shift]; else SignalBar[shift] = 0; if ((ss>NSignalBar || fcu) && HistCCI[shift]>0) { TrendUp[shift] = HistCCI[shift]; fup = True; fdn = False; fcd = False; } if ((ss>NSignalBar || fcd) && HistCCI[shift]<0) { TrendDn[shift] = HistCCI[shift]; fdn = True; fup = False; fcu = False; } } } //---
Sample
Analysis
Market Information Used:
Series array that contains open time of each bar
Indicator Curves created:
Implements a curve of type DRAW_ARROW
Implements a curve of type DRAW_NONE
Indicators Used:
Commodity channel index
Custom Indicators Used:
Order Management characteristics:
Other Features: