#property copyright "Copyright © 2010" #property link "" #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Red #property indicator_color2 DodgerBlue double G_ibuf_76[]; double G_ibuf_80[]; int Gi_84 = 14; int Gi_88 = 5000; void init() { string Ls_unused_0; SetIndexBuffer(0, G_ibuf_76); SetIndexBuffer(1, G_ibuf_80); SetIndexEmptyValue(0, 0); SetIndexEmptyValue(1, 0); SetIndexStyle(0, DRAW_ARROW); SetIndexArrow(0, 234); SetIndexStyle(1, DRAW_ARROW); SetIndexArrow(1, 233); } void start() { int Li_0; double Ld_4; int Li_12 = IndicatorCounted(); if (Li_12 >= 0) { if (Li_12 > 0) Li_12--; Li_0 = MathMin(Bars - Li_12, Gi_88); Ld_4 = 0; for (int Li_16 = 1; Li_16 <= 20; Li_16++) Ld_4 += 0.3 * (High[Li_16] - Low[Li_16]) / 20.0; for (Li_16 = Gi_84 + 0; Li_16 <= Li_0 + Gi_84; Li_16++) { G_ibuf_76[Li_16] = 0; G_ibuf_80[Li_16] = 0; if (is_upper_fr(Li_16, Gi_84) == 1) G_ibuf_76[Li_16] = High[Li_16] + Ld_4; if (is_lower_fr(Li_16, Gi_84) == 1) G_ibuf_80[Li_16] = Low[Li_16] - Ld_4; } } } int is_upper_fr(int Ai_0, int Ai_4) { bool bool_8 = TRUE; int Li_12 = 1; while (Li_12 <= Ai_4) { if (Ai_0 + Li_12 >= Bars || Ai_0 - Li_12 < 0 == 1) return (0); bool_8 = bool_8 && High[Ai_0] >= High[Ai_0 + Li_12] && High[Ai_0] >= High[Ai_0 - Li_12]; Li_12++; } return (bool_8); } int is_lower_fr(int Ai_0, int Ai_4) { bool bool_8 = TRUE; int Li_12 = 1; while (Li_12 <= Ai_4) { if (Ai_0 + Li_12 >= Bars || Ai_0 - Li_12 < 0 == 1) return (0); bool_8 = bool_8 && Low[Ai_0] <= Low[Ai_0 + Li_12] && Low[Ai_0] <= Low[Ai_0 - Li_12]; Li_12++; } return (bool_8); }