/* Generated by EX4-TO-MQ4 decompiler V4.0.215.6 Website: http://purebeam.biz E-mail : purebeam@gmail.com */ #property copyright "Copyright c 2005, MetaQuotes Software Corp." #property link "http://www.metaquotes.net/" #property indicator_separate_window #property indicator_buffers 3 #property indicator_color1 Black #property indicator_color2 Green #property indicator_color3 Red double g_ibuf_76[]; double g_ibuf_80[]; double g_ibuf_84[]; double g_ibuf_88[]; double g_ibuf_92[]; int init() { IndicatorBuffers(5); SetIndexStyle(0, DRAW_NONE); SetIndexStyle(1, DRAW_HISTOGRAM); SetIndexStyle(2, DRAW_HISTOGRAM); IndicatorDigits(Digits + 2); SetIndexDrawBegin(0, 38); SetIndexDrawBegin(1, 38); SetIndexDrawBegin(2, 38); SetIndexBuffer(0, g_ibuf_76); SetIndexBuffer(1, g_ibuf_80); SetIndexBuffer(2, g_ibuf_84); SetIndexBuffer(3, g_ibuf_88); SetIndexBuffer(4, g_ibuf_92); IndicatorShortName("AC"); SetIndexLabel(1, NULL); SetIndexLabel(2, NULL); return (0); } int start() { double ld_8; double ld_16; int li_4 = IndicatorCounted(); if (li_4 > 0) li_4--; int li_0 = Bars - li_4; for (int li_24 = 0; li_24 < li_0; li_24++) g_ibuf_88[li_24] = iMA(NULL, 0, 5, 0, MODE_SMA, PRICE_MEDIAN, li_24) - iMA(NULL, 0, 34, 0, MODE_SMA, PRICE_MEDIAN, li_24); for (li_24 = 0; li_24 < li_0; li_24++) g_ibuf_92[li_24] = iMAOnArray(g_ibuf_88, Bars, 5, 0, MODE_SMA, li_24); bool li_28 = TRUE; for (li_24 = li_0 - 1; li_24 >= 0; li_24--) { ld_16 = g_ibuf_88[li_24] - g_ibuf_92[li_24]; ld_8 = g_ibuf_88[li_24 + 1] - (g_ibuf_92[li_24 + 1]); if (ld_16 > ld_8) li_28 = TRUE; if (ld_16 < ld_8) li_28 = FALSE; if (!li_28) { g_ibuf_84[li_24] = ld_16; g_ibuf_80[li_24] = 0.0; } else { g_ibuf_80[li_24] = ld_16; g_ibuf_84[li_24] = 0.0; } g_ibuf_76[li_24] = ld_16; } return (0); }