#property copyright "Copyright © 2005, FX Sniper " #property link "http://www.metaquotes.net/" #property indicator_separate_window #property indicator_buffers 3 #property indicator_color1 Yellow #property indicator_color2 Chartreuse #property indicator_color3 Red double g_ibuf_76[]; double g_ibuf_80[]; double g_ibuf_84[]; extern int Rperiod = 14; extern int Draw4HowLongg = 300; int gi_100; int gi_104; int gi_108; int gi_112; double g_ibuf_116[]; int gi_120; double gd_124; double gd_132; double g_ibuf_140[]; int init() { IndicatorBuffers(5); SetIndexBuffer(2, g_ibuf_76); SetIndexBuffer(1, g_ibuf_80); SetIndexBuffer(0, g_ibuf_84); SetIndexBuffer(3, g_ibuf_116); SetIndexBuffer(4, g_ibuf_140); SetIndexStyle(2, DRAW_LINE, STYLE_SOLID, 3); SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 3); SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 3); return (0); } int start() { gi_100 = 1000 - Rperiod - 5; gi_120 = Rperiod; gi_112 = gi_100 - gi_120 - 1; for (gi_104 = gi_112; gi_104 >= 0; gi_104--) { g_ibuf_116[1] = 0; for (gi_108 = gi_120; gi_108 >= 1; gi_108--) { gd_124 = gi_120 + 1; gd_124 /= 3.0; gd_132 = 0; gd_132 = (gi_108 - gd_124) * iWPR(NULL, 0, Rperiod, gi_120 - gi_108 + gi_104); g_ibuf_116[1] += gd_132; } g_ibuf_140[gi_104] = 6.0 * g_ibuf_116[1] / (gi_120 * (gi_120 + 1)); g_ibuf_84[gi_104] = g_ibuf_140[gi_104]; g_ibuf_80[gi_104] = g_ibuf_140[gi_104]; g_ibuf_76[gi_104] = g_ibuf_140[gi_104]; if (g_ibuf_140[gi_104 + 1] > g_ibuf_140[gi_104]) g_ibuf_80[gi_104 + 1] = EMPTY_VALUE; else { if (g_ibuf_140[gi_104 + 1] < g_ibuf_140[gi_104]) { g_ibuf_76[gi_104 + 1] = EMPTY_VALUE; MessageBox("asda"); } else { g_ibuf_76[gi_104 + 1] = -1; g_ibuf_80[gi_104 + 1] = -1; } } } return (0); }