#property copyright "Copyright © 2010, D.Zhebrak aka Necron" #property link "www.mqlcoder.ru" #property indicator_separate_window #property indicator_buffers 5 #property indicator_color1 Black #property indicator_color2 Lime #property indicator_color3 Red #property indicator_color4 Lime #property indicator_color5 Red extern int BarsToProcess = 1000; extern bool alert = TRUE; extern bool write_file = TRUE; string Gs_88 = "FXG_iAlligatorZone"; double G_ibuf_96[]; double G_ibuf_100[]; double G_ibuf_104[]; double G_ibuf_108[]; double G_ibuf_112[]; datetime G_time_116; // E37F0136AA3FFAF149B351F6A4C948E9 int init() { G_time_116 = 0; SetIndexBuffer(0, G_ibuf_96); SetIndexBuffer(1, G_ibuf_100); SetIndexBuffer(2, G_ibuf_104); SetIndexBuffer(3, G_ibuf_108); SetIndexBuffer(4, G_ibuf_112); SetIndexStyle(0, DRAW_HISTOGRAM); SetIndexStyle(1, DRAW_HISTOGRAM); SetIndexStyle(2, DRAW_HISTOGRAM); SetIndexStyle(3, DRAW_HISTOGRAM, EMPTY, 2); SetIndexStyle(4, DRAW_HISTOGRAM, EMPTY, 2); IndicatorShortName("Al_Zone"); SetIndexLabel(0, NULL); SetIndexLabel(1, NULL); SetIndexLabel(2, NULL); SetIndexLabel(3, NULL); SetIndexLabel(4, NULL); return (0); } // 52D46093050F38C27267BCE42543EF60 int deinit() { return (0); } // EA2B2676C28C0DB26D39331A336C6B92 int start() { double ialligator_0; double ialligator_8; double ialligator_16; double ima_24; double iclose_32; string Ls_56; int ind_counted_48 = IndicatorCounted(); if (ind_counted_48 < 0) return (-1); if (iBars(Symbol(), Period()) < 14) { Print("Недостаточно баров для расчета индикатора!"); return (-1); } int Li_52 = Bars - ind_counted_48 - 1; if (Bars - ind_counted_48 > 2) Li_52 = Bars - 35; if (Li_52 > BarsToProcess && BarsToProcess > 0) Li_52 = BarsToProcess; for (int Li_40 = Li_52; Li_40 >= 0; Li_40--) { ialligator_0 = iAlligator(Symbol(), Period(), 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORJAW, Li_40); ialligator_8 = iAlligator(Symbol(), Period(), 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORTEETH, Li_40); ialligator_16 = iAlligator(Symbol(), Period(), 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORLIPS, Li_40); ima_24 = iMA(Symbol(), Period(), 3, 1, MODE_SMMA, PRICE_MEDIAN, Li_40); iclose_32 = iClose(Symbol(), Period(), Li_40); G_ibuf_100[Li_40] = 0; G_ibuf_104[Li_40] = 0; G_ibuf_96[Li_40] = 0; G_ibuf_108[Li_40] = 0; G_ibuf_112[Li_40] = 0; if (iclose_32 > ialligator_0 && iclose_32 > ialligator_8 && iclose_32 > ialligator_16) G_ibuf_100[Li_40] = 1; if (iclose_32 < ialligator_0 && iclose_32 < ialligator_8 && iclose_32 < ialligator_16) G_ibuf_104[Li_40] = 1; if (iclose_32 > ialligator_0 && iclose_32 > ialligator_8 && iclose_32 > ialligator_16 && iclose_32 > ima_24) G_ibuf_108[Li_40] = 1; if (iclose_32 < ialligator_0 && iclose_32 < ialligator_8 && iclose_32 < ialligator_16 && iclose_32 < ima_24) G_ibuf_112[Li_40] = 1; else G_ibuf_96[Li_40] = 1; if (Li_40 == 1) { if (write_file) { if (iclose_32 > ialligator_0 && iclose_32 > ialligator_8 && iclose_32 > ialligator_16 && ialligator_16 >= ialligator_8 && G_time_116 < Time[0]) { Ls_56 = TimeToStr(TimeCurrent(), TIME_DATE|TIME_SECONDS) + "; Сильный тренд вверх на " + Symbol() + "_" + Period() + ""; f0_0(Gs_88 + " " + TimeToStr(TimeCurrent(), TIME_DATE) + ".txt", Ls_56); } if (iclose_32 < ialligator_0 && iclose_32 < ialligator_8 && iclose_32 < ialligator_16 && ialligator_16 <= ialligator_8 && G_time_116 < Time[0]) { Ls_56 = TimeToStr(TimeCurrent(), TIME_DATE|TIME_SECONDS) + "; Сильный тренд вниз на " + Symbol() + "_" + Period() + ""; f0_0(Gs_88 + " " + TimeToStr(TimeCurrent(), TIME_DATE) + ".txt", Ls_56); } } if (alert) { if (iclose_32 > ialligator_0 && iclose_32 > ialligator_8 && iclose_32 > ialligator_16 && ialligator_16 >= ialligator_8 && G_time_116 < Time[0]) { Alert("i-Alligator_Zone: Сильный тренд вверх на " + Symbol() + "_" + Period() + ""); G_time_116 = Time[0]; } if (iclose_32 < ialligator_0 && iclose_32 < ialligator_8 && iclose_32 < ialligator_16 && ialligator_16 <= ialligator_8 && G_time_116 < Time[0]) { Alert("i-Alligator_Zone: Сильный тренд вниз на " + Symbol() + "_" + Period() + ""); G_time_116 = Time[0]; } } } } return (0); } // D434BA69A8D51901523AEE1F0FC68B76 void f0_0(string A_name_0, string As_8) { int file_16 = FileOpen(A_name_0, FILE_WRITE|FILE_READ, " "); if (file_16 > 0) { FileSeek(file_16, 0, SEEK_END); FileWrite(file_16, As_8); FileClose(file_16); } }