#property copyright "Copyright © 2009, Forex-Solutions-Team" #property link "www.sRs_Trend_Rider.com" #property indicator_separate_window #property indicator_minimum 0.0 #property indicator_maximum 20000.0 #property indicator_buffers 1 #property indicator_color1 DodgerBlue int gi_76 = 14; double g_ibuf_80[]; double g_ibuf_84[]; double g_ibuf_88[]; int gi_unused_92 = 0; int init() { IndicatorDigits(2); IndicatorBuffers(3); SetIndexBuffer(1, g_ibuf_84); SetIndexBuffer(2, g_ibuf_88); SetIndexStyle(0, DRAW_ARROW, EMPTY, 1); SetIndexBuffer(0, g_ibuf_80); string ls_0 = "sRs Trend Rider Indicator"; IndicatorShortName(ls_0); SetIndexLabel(0, ls_0); SetLevelStyle(1, 1, Red); SetLevelValue(1, 10000); SetIndexDrawBegin(0, gi_76); return (0); } int start() { double ld_8; double ld_16; double ld_24; double ld_32; double ld_40; SetLevelStyle(1, 2, Red); SetLevelValue(1, 10000); int l_ind_counted_4 = IndicatorCounted(); if (Bars <= gi_76) return (0); if (l_ind_counted_4 < 1) for (int li_0 = 1; li_0 <= gi_76; li_0++) g_ibuf_80[Bars - li_0] = 0.0; li_0 = Bars - gi_76 - 1; if (l_ind_counted_4 >= gi_76) li_0 = Bars - l_ind_counted_4 - 1; while (li_0 >= 0) { ld_32 = 0.0; ld_40 = 0.0; if (li_0 == Bars - gi_76 - 1) { for (int li_48 = Bars - 2; li_48 >= li_0; li_48--) { ld_8 = Close[li_48] - (Close[li_48 + 1]); ld_8 = 200.0 * ld_8; if (ld_8 > 0.0) ld_40 += ld_8; else ld_32 -= ld_8; } ld_24 = ld_40 / gi_76; ld_16 = ld_32 / gi_76; } else { ld_8 = Close[li_0] - (Close[li_0 + 1]); ld_8 = 200.0 * ld_8; if (ld_8 > 0.0) ld_40 = ld_8; else ld_32 = -ld_8; ld_24 = ((g_ibuf_84[li_0 + 1]) * (gi_76 - 1) + ld_40) / gi_76; ld_16 = ((g_ibuf_88[li_0 + 1]) * (gi_76 - 1) + ld_32) / gi_76; } g_ibuf_84[li_0] = ld_24; g_ibuf_88[li_0] = ld_16; if (ld_16 == 0.0) g_ibuf_80[li_0] = 0.0; else g_ibuf_80[li_0] = 20000.0 - 20000.0 / (ld_24 / ld_16 + 1.0); li_0--; } return (0); }