#property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Lime #property indicator_color2 Red extern int ADXbars = 14; extern int CountBars = 350; double g_ibuf_84[]; double g_ibuf_88[]; double g_iadx_92; double g_iadx_100; double g_iadx_108; double g_iadx_116; int init() { string ls_unused_0; IndicatorBuffers(2); SetIndexStyle(0, DRAW_ARROW); SetIndexArrow(0, 108); SetIndexStyle(1, DRAW_ARROW); SetIndexArrow(1, 108); SetIndexBuffer(0, g_ibuf_84); SetIndexBuffer(1, g_ibuf_88); return (0); } int start() { if (CountBars >= Bars) CountBars = Bars; SetIndexDrawBegin(0, Bars - CountBars); SetIndexDrawBegin(1, Bars - CountBars); int l_ind_counted_8 = IndicatorCounted(); if (l_ind_counted_8 < 0) return (-1); if (l_ind_counted_8 < 1) { for (int li_0 = 1; li_0 <= CountBars; li_0++) g_ibuf_84[CountBars - li_0] = 0.0; for (li_0 = 1; li_0 <= CountBars; li_0++) g_ibuf_88[CountBars - li_0] = 0.0; } for (int li_4 = CountBars; li_4 >= 0; li_4--) { g_iadx_92 = iADX(NULL, 0, ADXbars, PRICE_CLOSE, MODE_PLUSDI, li_4 - 1); g_iadx_100 = iADX(NULL, 0, ADXbars, PRICE_CLOSE, MODE_PLUSDI, li_4); g_iadx_108 = iADX(NULL, 0, ADXbars, PRICE_CLOSE, MODE_MINUSDI, li_4 - 1); g_iadx_116 = iADX(NULL, 0, ADXbars, PRICE_CLOSE, MODE_MINUSDI, li_4); if (g_iadx_92 > g_iadx_108 && g_iadx_100 < g_iadx_116 && li_0 != 1) { g_ibuf_84[li_4] = Low[li_4] - 5.0 * Point; Alert("Buy Arrow", "\n", "Current time is ", TimeToStr(TimeCurrent()), "\n", Symbol()); li_0++; } if (g_iadx_92 < g_iadx_108 && g_iadx_100 > g_iadx_116 && li_0 != 1) { g_ibuf_88[li_4] = High[li_4] + 5.0 * Point; Alert("Sell Arrow", "\n", "Current time is ", TimeToStr(TimeCurrent()), "\n", Symbol()); li_0++; } } return (0); }