#property copyright "InsightNext" #property link "http://www.metaquotes.net" #property indicator_chart_window #property indicator_buffers 4 #property indicator_color1 Red #property indicator_color2 RoyalBlue #property indicator_color3 Red #property indicator_color4 RoyalBlue int g_ma_method_76 = MODE_SMMA; int g_period_80 = 6; int g_ma_method_84 = MODE_LWMA; int g_period_88 = 2; double g_ibuf_92[]; double g_ibuf_96[]; double g_ibuf_100[]; double g_ibuf_104[]; double g_ibuf_108[]; double g_ibuf_112[]; double g_ibuf_116[]; double g_ibuf_120[]; int gi_124 = 0; int init() { IndicatorBuffers(8); SetIndexStyle(0, DRAW_NONE); SetIndexStyle(1, DRAW_NONE); SetIndexStyle(2, DRAW_NONE); SetIndexStyle(3, DRAW_NONE); SetIndexStyle(4, DRAW_NONE); SetIndexStyle(5, DRAW_NONE); SetIndexStyle(6, DRAW_NONE); SetIndexStyle(7, DRAW_NONE); SetIndexLabel(0, NULL); SetIndexLabel(1, NULL); SetIndexLabel(2, NULL); SetIndexLabel(3, NULL); SetIndexLabel(4, NULL); SetIndexLabel(5, NULL); SetIndexLabel(6, NULL); SetIndexLabel(7, NULL); SetIndexDrawBegin(0, 5); SetIndexBuffer(0, g_ibuf_92); SetIndexBuffer(1, g_ibuf_96); SetIndexBuffer(2, g_ibuf_100); SetIndexBuffer(3, g_ibuf_104); SetIndexBuffer(4, g_ibuf_108); SetIndexBuffer(5, g_ibuf_112); SetIndexBuffer(6, g_ibuf_116); SetIndexBuffer(7, g_ibuf_120); return (0); } int deinit() { return (0); } int start() { double l_ima_0; double l_ima_8; double l_ima_16; double l_ima_24; double ld_32; double ld_40; double ld_48; double ld_56; if (Bars <= 10) return (0); gi_124 = IndicatorCounted(); if (gi_124 < 0) return (-1); if (gi_124 > 0) gi_124--; for (int li_64 = Bars - gi_124 - 1; li_64 >= 0; li_64--) { l_ima_0 = iMA(NULL, 0, g_period_80, 0, g_ma_method_76, PRICE_CLOSE, li_64); l_ima_8 = iMA(NULL, 0, g_period_80, 0, g_ma_method_76, PRICE_LOW, li_64); l_ima_16 = iMA(NULL, 0, g_period_80, 0, g_ma_method_76, PRICE_OPEN, li_64); l_ima_24 = iMA(NULL, 0, g_period_80, 0, g_ma_method_76, PRICE_HIGH, li_64); ld_32 = (g_ibuf_108[li_64 + 1] + (g_ibuf_112[li_64 + 1])) / 2.0; ld_56 = (l_ima_0 + l_ima_24 + l_ima_16 + l_ima_8) / 4.0; ld_40 = MathMax(l_ima_24, MathMax(ld_32, ld_56)); ld_48 = MathMin(l_ima_16, MathMin(ld_32, ld_56)); if (ld_32 < ld_56) { g_ibuf_116[li_64] = ld_48; g_ibuf_120[li_64] = ld_40; } else { g_ibuf_116[li_64] = ld_40; g_ibuf_120[li_64] = ld_48; } g_ibuf_108[li_64] = ld_32; g_ibuf_112[li_64] = ld_56; } for (int li_68 = 0; li_68 < Bars; li_68++) g_ibuf_92[li_68] = iMAOnArray(g_ibuf_116, Bars, g_period_88, 0, g_ma_method_84, li_68); for (li_68 = 0; li_68 < Bars; li_68++) g_ibuf_96[li_68] = iMAOnArray(g_ibuf_120, Bars, g_period_88, 0, g_ma_method_84, li_68); for (li_68 = 0; li_68 < Bars; li_68++) g_ibuf_100[li_68] = iMAOnArray(g_ibuf_108, Bars, g_period_88, 0, g_ma_method_84, li_68); for (li_68 = 0; li_68 < Bars; li_68++) g_ibuf_104[li_68] = iMAOnArray(g_ibuf_112, Bars, g_period_88, 0, g_ma_method_84, li_68); return (0); }