#property copyright "Copyright © 2008, MF_Strategy" #property link "mfstrategy@gmail.com" #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Red #property indicator_color2 DodgerBlue double Gl_ibuf_76[]; double Gl_ibuf_80[]; int Gli_84 = 14; int Gli_88 = 5000; void init() { string Lcs_unused_0; SetIndexBuffer(0, Gl_ibuf_76); SetIndexBuffer(1, Gl_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 Lci_4; double Lcd_16; int Lci_0 = IndicatorCounted(); if (Lci_0 >= 0) { if (Lci_0 > 0) Lci_0--; Lci_4 = MathMin(Bars - Lci_0, Gli_88); Lcd_16 = 0; for (int Lci_8 = 1; Lci_8 <= 20; Lci_8++) Lcd_16 += 0.3 * (High[Lci_8] - Low[Lci_8]) / 20.0; for (Lci_8 = Gli_84 + 0; Lci_8 <= Lci_4 + Gli_84; Lci_8++) { Gl_ibuf_76[Lci_8] = 0; Gl_ibuf_80[Lci_8] = 0; if (is_upper_fr(Lci_8, Gli_84) == 1) Gl_ibuf_76[Lci_8] = High[Lci_8] + Lcd_16; if (is_lower_fr(Lci_8, Gli_84) == 1) Gl_ibuf_80[Lci_8] = Low[Lci_8] - Lcd_16; } } } int is_upper_fr(int Ari_0, int Ari_4) { bool bool_8 = TRUE; int Lci_12 = 1; while (Lci_12 <= Ari_4) { if (Ari_0 + Lci_12 >= Bars || Ari_0 - Lci_12 < 0 == TRUE) return (0); bool_8 = bool_8 && High[Ari_0] >= High[Ari_0 + Lci_12] && High[Ari_0] >= High[Ari_0 - Lci_12]; Lci_12++; } return (bool_8); } int is_lower_fr(int Ari_0, int Ari_4) { bool bool_8 = TRUE; int Lci_12 = 1; while (Lci_12 <= Ari_4) { if (Ari_0 + Lci_12 >= Bars || Ari_0 - Lci_12 < 0 == TRUE) return (0); bool_8 = bool_8 && Low[Ari_0] <= Low[Ari_0 + Lci_12] && Low[Ari_0] <= Low[Ari_0 - Lci_12]; Lci_12++; } return (bool_8); }