#property copyright "Copyright © 2009, fxsupertools.com" #property link "http://fxsupertools.com/" #property indicator_separate_window #property indicator_minimum -0.05 #property indicator_maximum 1.0 #property indicator_buffers 4 #property indicator_color1 MidnightBlue #property indicator_color2 Maroon #property indicator_color3 Blue #property indicator_color4 Red extern int _Period = 14; double g_ibuf_80[]; double g_ibuf_84[]; double g_ibuf_88[]; double g_ibuf_92[]; int init() { SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID, 4); SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, 4); SetIndexStyle(2, DRAW_HISTOGRAM, STYLE_SOLID, 4); SetIndexStyle(3, DRAW_HISTOGRAM, STYLE_SOLID, 4); SetIndexBuffer(0, g_ibuf_80); SetIndexBuffer(1, g_ibuf_84); SetIndexBuffer(2, g_ibuf_88); SetIndexBuffer(3, g_ibuf_92); IndicatorDigits(MarketInfo(Symbol(), MODE_DIGITS)); string ls_0 = "Trend"; IndicatorShortName(ls_0); SetIndexLabel(0, "Overbought or Strong Bulls"); SetIndexLabel(1, "Oversold or Strong Bears"); SetIndexLabel(2, "Trend Bulls"); SetIndexLabel(3, "Trend Bears"); SetIndexDrawBegin(0, _Period); SetIndexDrawBegin(1, _Period); SetIndexDrawBegin(2, _Period); SetIndexDrawBegin(3, _Period); return (0); } int start() { int li_0; double l_iwpr_4; for (int li_12 = Bars - _Period - 1; li_12 >= 0; li_12--) { l_iwpr_4 = iWPR(NULL, 0, _Period, li_12); if (l_iwpr_4 > -50.0 && l_iwpr_4 < -20.0) li_0 = 1; if (l_iwpr_4 > -20.0) li_0 = 2; if (l_iwpr_4 < -50.0 && l_iwpr_4 > -80.0) li_0 = -1; if (l_iwpr_4 <= -80.0) li_0 = -2; if (li_0 == 1) { g_ibuf_80[li_12] = 0; g_ibuf_88[li_12] = 1; g_ibuf_84[li_12] = 0; g_ibuf_92[li_12] = 0; } if (li_0 == 2) { g_ibuf_80[li_12] = 1; g_ibuf_88[li_12] = 0; g_ibuf_84[li_12] = 0; g_ibuf_92[li_12] = 0; } if (li_0 == -1) { g_ibuf_80[li_12] = 0; g_ibuf_88[li_12] = 0; g_ibuf_84[li_12] = 0; g_ibuf_92[li_12] = 1; } if (li_0 == -2) { g_ibuf_80[li_12] = 0; g_ibuf_88[li_12] = 0; g_ibuf_84[li_12] = 1; g_ibuf_92[li_12] = 0; } } return (0); }