#property indicator_chart_window #property indicator_buffers 4 #property indicator_color1 LawnGreen #property indicator_color2 LawnGreen #property indicator_color3 OrangeRed #property indicator_color4 RoyalBlue extern color color1 = Red; extern color color2 = SkyBlue; extern color color3 = Red; extern color color4 = SkyBlue; double gda_92[]; double gda_96[]; double gda_100[]; double gda_104[]; int gi_108 = 0; int init() { SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID, 1, color1); SetIndexBuffer(0, gda_92); SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, 1, color2); SetIndexBuffer(1, gda_96); SetIndexStyle(2, DRAW_HISTOGRAM, STYLE_SOLID, 3, color3); SetIndexBuffer(2, gda_100); SetIndexStyle(3, DRAW_HISTOGRAM, STYLE_SOLID, 3, color4); SetIndexBuffer(3, gda_104); SetIndexDrawBegin(0, 10); SetIndexDrawBegin(1, 10); SetIndexDrawBegin(2, 10); SetIndexDrawBegin(3, 10); SetIndexBuffer(0, gda_92); SetIndexBuffer(1, gda_96); SetIndexBuffer(2, gda_100); SetIndexBuffer(3, gda_104); return (0); } int deinit() { return (0); } int start() { double ld_0; double ld_8; double ld_16; double ld_24; if (Bars <= 10) return (0); gi_108 = IndicatorCounted(); if (gi_108 < 0) return (-1); if (gi_108 > 0) gi_108--; for (int li_32 = Bars - gi_108 - 1; li_32 >= 0; li_32--) { ld_0 = (gda_100[li_32 + 1] + (gda_104[li_32 + 1])) / 2.0; ld_24 = (Open[li_32] + High[li_32] + Low[li_32] + Close[li_32]) / 4.0; ld_8 = MathMax(High[li_32], MathMax(ld_0, ld_24)); ld_16 = MathMin(Low[li_32], MathMin(ld_0, ld_24)); if (ld_0 < ld_24) { gda_92[li_32] = ld_16; gda_96[li_32] = ld_8; } else { gda_92[li_32] = ld_8; gda_96[li_32] = ld_16; } gda_100[li_32] = ld_0; gda_104[li_32] = ld_24; } return (0); }