/* Generated by EX4-TO-MQ4 decompiler V4.0.224.1 [] Website: http://purebeam.biz E-mail : purebeam@gmail.com */ #property copyright "Copyright © 2005, Shurka" #property link "http://shforex.narod.ru" #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Lime #property indicator_color2 Red extern int AllBars = 0; extern int Otstup = 17; extern double Per = 13.0; extern string Alert_Setting = "---------- Alert Setting"; extern bool PushAlert = TRUE; extern bool EnableAlert = TRUE; extern string SoundFilename = "alert.wav"; int gi_112; int gi_116; int gi_120; int gi_124; int g_count_128 = 0; int g_count_132 = 0; int gi_unused_136 = 0; int gi_unused_140 = 0; double gd_144; double g_high_152; double g_low_160; double g_ibuf_168[]; double g_ibuf_172[]; int init() { if (Bars < AllBars + Per || AllBars == 0) gi_116 = Bars - Per; else gi_116 = AllBars; IndicatorBuffers(2); IndicatorShortName("SHI_SilverTrendSig"); SetIndexStyle(0, DRAW_ARROW, STYLE_SOLID, 4); SetIndexStyle(1, DRAW_ARROW, STYLE_SOLID, 4); SetIndexArrow(0, 159); SetIndexArrow(1, 159); SetIndexBuffer(0, g_ibuf_172); SetIndexBuffer(1, g_ibuf_168); SetIndexDrawBegin(0, Bars - gi_116); SetIndexDrawBegin(1, Bars - gi_116); ArrayInitialize(g_ibuf_168, 0.0); ArrayInitialize(g_ibuf_172, 0.0); return (0); } int deinit() { return (0); } int start() { string ls_4; int l_ind_counted_0 = IndicatorCounted(); if (l_ind_counted_0 < 0) return (-1); if (gi_116 > Bars - l_ind_counted_0) gi_116 = Bars - l_ind_counted_0; for (gi_112 = 1; gi_112 < gi_116; gi_112++) { gd_144 = 0; for (gi_120 = gi_112; gi_120 < gi_112 + 10; gi_120++) gd_144 += (gi_112 + 10 - gi_120) * (High[gi_120] - Low[gi_120]); gd_144 /= 55.0; g_high_152 = High[iHighest(NULL, 0, MODE_HIGH, Per, gi_112)]; g_low_160 = Low[iLowest(NULL, 0, MODE_LOW, Per, gi_112)]; if (Close[gi_112] > g_high_152 - (g_high_152 - g_low_160) * Otstup / 100.0 && gi_124 != 1) { g_ibuf_168[gi_112] = High[gi_112] + gd_144 / 2.0; if (Close[gi_112] > g_high_152 - (g_high_152 - g_low_160) * Otstup / 100.0 && gi_124 != 1) gi_124 = 1; if (Close[gi_112] > g_high_152 - (g_high_152 - g_low_160) * Otstup / 100.0 && gi_124 != 1) g_count_132 = 0; } else { if (Close[gi_112] < g_low_160 + (g_high_152 - g_low_160) * Otstup / 100.0 && gi_124 != -1) { g_ibuf_172[gi_112] = Low[gi_112] - gd_144 / 2.0; if (Close[gi_112] < g_low_160 + (g_high_152 - g_low_160) * Otstup / 100.0 && gi_124 != -1) gi_124 = -1; if (Close[gi_112] < g_low_160 + (g_high_152 - g_low_160) * Otstup / 100.0 && gi_124 != -1) g_count_128 = 0; } } } if (EnableAlert) { if (gi_124 == 1 && g_count_128 == 1) SendNotification(Symbol()+ " - "+ "BUY - UP DIRECTION !"); if (gi_124 == 1 && g_count_128 == 1) Alert(Symbol(), " - ", "BUY - UP DIRECTION !"); if (gi_124 == 1 && g_count_128 == 1) Alert(ls_4); if (gi_124 == 1 && g_count_128 == 1) PlaySound(SoundFilename); if (gi_124 == 1 && g_count_128 == 1) g_count_128++; if (gi_124 == -1 && g_count_132 == 1) SendNotification(Symbol()+ " - "+ "SELL - DOWN DIRECTION !"); if (gi_124 == -1 && g_count_132 == 1) Alert(Symbol(), " - ", "SELL - DOWN DIRECTION !"); if (gi_124 == -1 && g_count_132 == 1) Alert(ls_4); if (gi_124 == -1 && g_count_132 == 1) PlaySound(SoundFilename); if (gi_124 == -1 && g_count_132 == 1) g_count_132++; } return (0); }