#property copyright "Copyright © 2008, FOREXflash Software Corp." #property link "http://www.metaquotes.net" #property indicator_chart_window #property indicator_buffers 8 #property indicator_color1 White #property indicator_color2 Lime #property indicator_color3 Red #property indicator_color4 Yellow #property indicator_color5 Red #property indicator_color6 Lime #property indicator_color7 Orange #property indicator_color8 LightGreen extern int NumberOfBars = 300; extern double Offset = 150.0; extern double Offset1 = 50.0; extern double Offset2 = 100.0; double g_ibuf_104[]; double g_ibuf_108[]; double g_ibuf_112[]; double g_ibuf_116[]; double g_ibuf_120[]; double g_ibuf_124[]; double g_ibuf_128[]; double g_ibuf_132[]; int gi_136 = 0; int init() { string ls_0 = "2009.07.06"; int l_str2time_8 = StrToTime(ls_0); if (TimeCurrent() >= l_str2time_8) { Alert("The trial version expired! Contact forexflash@gmail.com"); return (1); } Offset *= Point; Offset1 *= Point; Offset2 = Offset * Point; SetIndexBuffer(0, g_ibuf_104); SetIndexStyle(0, DRAW_ARROW); SetIndexArrow(0, 119); SetIndexLabel(0, "Reversal"); SetIndexBuffer(1, g_ibuf_108); SetIndexStyle(1, DRAW_ARROW); SetIndexArrow(1, 233); SetIndexLabel(1, "Demand"); SetIndexBuffer(2, g_ibuf_112); SetIndexStyle(2, DRAW_ARROW); SetIndexArrow(2, 234); SetIndexLabel(2, "Supply"); SetIndexBuffer(3, g_ibuf_116); SetIndexStyle(3, DRAW_ARROW); SetIndexArrow(3, SYMBOL_STOPSIGN); SetIndexLabel(3, "Reversal"); SetIndexBuffer(4, g_ibuf_120); SetIndexStyle(4, DRAW_ARROW); SetIndexArrow(4, 159); SetIndexLabel(4, "SStopingVolume"); SetIndexBuffer(5, g_ibuf_124); SetIndexStyle(5, DRAW_ARROW); SetIndexArrow(5, 159); SetIndexLabel(5, "BStopingVolume"); SetIndexBuffer(6, g_ibuf_128); SetIndexStyle(6, DRAW_ARROW); SetIndexArrow(6, 119); SetIndexLabel(6, "SELLReversal"); SetIndexBuffer(7, g_ibuf_132); SetIndexStyle(7, DRAW_ARROW); SetIndexArrow(7, 119); SetIndexLabel(7, "BUYReversal"); return (0); } int deinit() { return (0); } int start() { double ld_0; double ld_8; double l_ivolume_16; double l_ivolume_24; VPA(); int li_36 = IndicatorCounted(); if (li_36 > 0) li_36--; int li_32 = NumberOfBars; for (int li_40 = li_32; li_40 >= 0; li_40--) { ld_0 = High[li_40 + 1] - (Low[li_40 + 1]); ld_8 = High[li_40 + 2] - (Low[li_40 + 2]); g_ibuf_104[li_40] = 0; g_ibuf_108[li_40] = 0; g_ibuf_112[li_40] = 0; g_ibuf_116[li_40] = 0; l_ivolume_16 = iVolume(NULL, 0, li_40 + 1); l_ivolume_24 = iVolume(NULL, 0, li_40 + 2); if (ld_0 > ld_8) { if (l_ivolume_16 < l_ivolume_24) { if (High[li_40 + 1] - (Close[li_40 + 1]) < Close[li_40 + 1] - (Low[li_40 + 1])) { g_ibuf_104[li_40 + 1] = High[li_40 + 1] + Offset; g_ibuf_112[li_40 + 1] = 0; } if (High[li_40 + 1] - (Close[li_40 + 1]) > Close[li_40 + 1] - (Low[li_40 + 1])) { g_ibuf_104[li_40 + 1] = Low[li_40 + 1] - Offset; g_ibuf_108[li_40 + 1] = 0; } } if (l_ivolume_16 > l_ivolume_24) { if (High[li_40 + 1] - (Close[li_40 + 1]) < Close[li_40 + 1] - (Low[li_40 + 1])) { g_ibuf_108[li_40 + 1] = Low[li_40 + 1] - Offset; g_ibuf_104[li_40 + 1] = 0; } if (High[li_40 + 1] - (Close[li_40 + 1]) > Close[li_40 + 1] - (Low[li_40 + 1])) { g_ibuf_112[li_40 + 1] = High[li_40 + 1] + Offset; g_ibuf_104[li_40 + 1] = 0; } } } if (ld_0 < ld_8) if (l_ivolume_16 > l_ivolume_24) g_ibuf_116[li_40 + 1] = High[li_40 + 1] + Offset; } return (0); } int VPA() { if (Bars <= 10) return (0); gi_136 = IndicatorCounted(); if (gi_136 < 0) return (-1); if (gi_136 > 0) gi_136--; int li_8 = Bars - gi_136 - 1; int li_unused_12 = li_8; int li_unused_4 = 1; while (li_8 >= 0) { if (Close[li_8 + 3] < Close[li_8 + 2] && Close[li_8 + 2] < Close[li_8 + 1] && Close[li_8 + 1] >= Close[li_8]) if (Volume[li_8 + 3] < Volume[li_8 + 2] && Volume[li_8 + 2] < Volume[li_8 + 1] && Volume[li_8 + 1] > Volume[li_8]) g_ibuf_120[li_8 + 1] = High[li_8 + 1] + Offset1; if (Close[li_8 + 3] > Close[li_8 + 2] && Close[li_8 + 2] > Close[li_8 + 1] && Close[li_8 + 1] <= Close[li_8]) if (Volume[li_8 + 3] < Volume[li_8 + 2] && Volume[li_8 + 2] < Volume[li_8 + 1] && Volume[li_8 + 1] > Volume[li_8]) g_ibuf_124[li_8 + 1] = Low[li_8 + 1] - Offset1; if (Close[li_8 + 3] < Close[li_8 + 2] && Close[li_8 + 2] < Close[li_8 + 1] && Low[li_8 + 1] >= Close[li_8]) if (Volume[li_8 + 3] < Volume[li_8 + 2] && Volume[li_8 + 2] < Volume[li_8 + 1] && Volume[li_8 + 1] > Volume[li_8]) g_ibuf_128[li_8 + 1] = High[li_8 + 1] + Offset2; if (Close[li_8 + 3] > Close[li_8 + 2] && Close[li_8 + 2] > Close[li_8 + 1] && High[li_8 + 1] <= Close[li_8]) if (Volume[li_8 + 3] < Volume[li_8 + 2] && Volume[li_8 + 2] < Volume[li_8 + 1] && Volume[li_8 + 1] > Volume[li_8]) g_ibuf_132[li_8 + 1] = Low[li_8 + 1] - Offset2; li_8--; } return (0); }