#property copyright "Copyright(c)2007, SeeyaTrading" #property link "http://seeyafx.blog31.fc2.com/" #property indicator_separate_window #property indicator_levelcolor DimGray #property indicator_buffers 4 #property indicator_color1 SkyBlue #property indicator_color2 Fuchsia #property indicator_color3 Khaki #property indicator_color4 Khaki #include string gs_76; string gs_84; int g_timeframe_92; extern bool CrossSignal = TRUE; extern bool LevelSignal = FALSE; extern bool HeatSignal = FALSE; extern bool BreakSignal = FALSE; extern int CrossSelect = 2; extern bool BigTrend = TRUE; extern bool LevelFilter = TRUE; extern int LineFilter = 0; extern bool RSIFilter = FALSE; extern int RCI_Level1 = -80; extern int RCI_Level2 = 80; extern int RSI_Period = 12; extern int FixedBarCount = 0; extern bool AlertShow = FALSE; extern bool AlertSound = FALSE; extern string AlertSoundName = "alert.wav"; extern int AlertInterval = 1; extern bool AlertMail = FALSE; extern double ArrowSize = 0.5; extern double ArrowSpace = 0.5; extern bool BigAlertShow = FALSE; extern bool BigAlertSound = FALSE; extern string BigAlertSoundName = "alert.wav"; extern bool BigAlertMail = FALSE; extern bool Show_Value = FALSE; extern int CalculateBars = 500; int g_time_216 = 315532800; int g_time_220 = 315532800; int g_time_224 = 315532800; double g_ibuf_228[]; double g_ibuf_232[]; double g_ibuf_236[]; double g_ibuf_240[]; double g_ibuf_244[]; double g_ibuf_248[]; int gi_252; int libSystemStart(string as_0 = "") { string ls_8 = ""; string ls_16 = ""; bool li_ret_24 = TRUE; ls_8 = "VERSION1"; ls_16 = "Version"; libObjectLabel(as_0, ls_8); libObjectLabel(as_0, ls_8, ls_16, 7, "MSゴシック", 2, 15, Gray); ls_8 = "VERSION2"; ls_16 = "9.1.0"; libObjectLabel(as_0, ls_8); libObjectLabel(as_0, ls_8, ls_16, 8, "MSゴシック", 35, 15, Gray); int l_str2time_28 = StrToTime("2009/01/31"); string l_time2str_32 = TimeToStr(TimeLocal(), TIME_DATE); string l_time2str_40 = TimeToStr(l_str2time_28, TIME_DATE); if (l_time2str_32 > l_time2str_40) { ls_8 = "UseTimeLimitError"; ls_16 = ""; libObjectLabel(as_0, ls_8); ls_16 = "利用期限を過ぎています。" + "(期限 " + l_time2str_40 + " まで)"; libObjectLabel(as_0, ls_8, ls_16, 8, "MSゴシック", 67, 15, Orange); libMsgBox(as_0, ls_16, "メッセージ", 0); li_ret_24 = FALSE; } return (li_ret_24); } void libObjectLabel(string as_0 = "", string a_name_8 = "", string a_text_16 = "", int a_fontsize_24 = 0, string a_fontname_28 = "", int a_x_36 = 0, int a_y_40 = 0, color a_color_44 = 0) { int li_48 = 0; if (as_0 != "") li_48 = WindowFind(as_0); if (li_48 > EMPTY && WindowIsVisible(li_48) == 1) { if (a_name_8 == "") ObjectsDeleteAll(li_48, OBJ_LABEL); else { if (a_text_16 == "") ObjectDelete(a_name_8); else { ObjectCreate(a_name_8, OBJ_LABEL, li_48, 0, 0); ObjectSetText(a_name_8, a_text_16, a_fontsize_24, a_fontname_28, a_color_44); ObjectSet(a_name_8, OBJPROP_CORNER, 0); ObjectSet(a_name_8, OBJPROP_XDISTANCE, a_x_36); ObjectSet(a_name_8, OBJPROP_YDISTANCE, a_y_40); } } } } void libMsgBox(string as_0 = "", string as_8 = "", string as_16 = "", string as_unused_24 = "") { int li_32 = 0; string ls_36 = as_8; string ls_44 = as_16; bool li_52 = FALSE; if (as_0 != "") li_32 = WindowFind(as_0); li_32 = 0; int li_56 = MessageBoxA(li_32, ls_36, ls_44, li_52); } int init() { g_timeframe_92 = Period(); switch (g_timeframe_92) { case PERIOD_M1: gs_84 = "M1"; break; case PERIOD_M5: gs_84 = "M5"; break; case PERIOD_M15: gs_84 = "M15"; break; case PERIOD_M30: gs_84 = "M30"; break; case PERIOD_H1: gs_84 = "H1"; break; case PERIOD_H4: gs_84 = "H4"; break; case PERIOD_D1: gs_84 = "D1"; break; case PERIOD_W1: gs_84 = "W1"; break; case PERIOD_MN1: gs_84 = "MN1"; break; default: gs_84 = ""; } gs_76 = "HEi_SIG"; IndicatorShortName(gs_76); if (libSystemStart("") == 0) return (0); IndicatorBuffers(6); SetIndexStyle(0, DRAW_ARROW, EMPTY, ArrowSize); SetIndexArrow(0, 233); SetIndexBuffer(0, g_ibuf_228); SetIndexStyle(1, DRAW_ARROW, EMPTY, ArrowSize); SetIndexArrow(1, 234); SetIndexBuffer(1, g_ibuf_232); SetIndexStyle(2, DRAW_ARROW, EMPTY, 2); SetIndexArrow(2, SYMBOL_ARROWUP); SetIndexBuffer(2, g_ibuf_236); SetIndexStyle(3, DRAW_ARROW, EMPTY, 2); SetIndexArrow(3, SYMBOL_ARROWDOWN); SetIndexBuffer(3, g_ibuf_240); SetIndexBuffer(4, g_ibuf_244); SetIndexBuffer(5, g_ibuf_248); SetIndexLabel(0, "Sign Up"); SetIndexLabel(1, "Sign Down"); SetIndexLabel(2, "BigTrend Up"); SetIndexLabel(3, "BigTrend Down"); if (!Show_Value) { SetIndexLabel(0, NULL); SetIndexLabel(1, NULL); SetIndexLabel(2, NULL); SetIndexLabel(3, NULL); SetIndexLabel(4, NULL); SetIndexLabel(5, NULL); } SetIndexStyle(4, DRAW_NONE); SetIndexStyle(5, DRAW_NONE); if (CalculateBars > 0) { SetIndexDrawBegin(0, CalculateBars); SetIndexDrawBegin(1, CalculateBars); SetIndexDrawBegin(2, CalculateBars); SetIndexDrawBegin(3, CalculateBars); } g_time_216 = Time[0]; g_time_220 = Time[0]; g_time_224 = Time[0]; return (0); } int deinit() { return (0); } int start() { int li_12; int li_16; double l_icustom_20; double l_icustom_28; double l_icustom_36; double l_icustom_44; double l_icustom_52; double l_icustom_60; double l_icustom_68; double l_icustom_76; double l_icustom_84; double l_icustom_92; double ld_100; double l_icustom_108; double l_icustom_116; double l_icustom_124; double l_icustom_140; double l_icustom_148; double l_icustom_156; double l_icustom_164; double l_icustom_172; double l_icustom_180; double l_icustom_188; double l_icustom_196; double l_icustom_204; double l_icustom_212; double l_icustom_220; double l_icustom_228; double l_icustom_236; double l_icustom_244; int li_252; int li_0 = IndicatorCounted(); if (li_0 < 0) return (-1); if (li_0 > 0) li_0--; gi_252 = Bars - li_0; if (gi_252 > CalculateBars) gi_252 = CalculateBars + 1; for (int li_4 = gi_252; li_4 >= 0; li_4--) { g_ibuf_228[li_4] = EMPTY_VALUE; g_ibuf_232[li_4] = EMPTY_VALUE; g_ibuf_236[li_4] = EMPTY_VALUE; g_ibuf_240[li_4] = EMPTY_VALUE; if (CrossSelect == 1) { li_12 = 5; li_16 = 4; } if (CrossSelect == 2) { li_12 = 4; li_16 = 3; } if (CrossSelect == 3) { li_12 = 3; li_16 = 2; } if (CrossSelect == 4) { li_12 = 2; li_16 = 1; } if (CrossSelect == 5) { li_12 = 1; li_16 = 0; } if (LineFilter == 1) ld_100 = 5; if (LineFilter == 2) ld_100 = 4; if (LineFilter == 3) ld_100 = 3; if (LineFilter == 4) ld_100 = 2; if (LineFilter == 5) ld_100 = 1; if (LineFilter == 6) ld_100 = 0; l_icustom_28 = iCustom(NULL, 0, "HEi_RCI", li_12, li_4 + FixedBarCount); l_icustom_44 = iCustom(NULL, 0, "HEi_RCI", li_12, li_4 + FixedBarCount + 1); l_icustom_60 = iCustom(NULL, 0, "HEi_RCI", li_12, li_4 + FixedBarCount + 2); l_icustom_36 = iCustom(NULL, 0, "HEi_RCI", li_16, li_4 + FixedBarCount); l_icustom_52 = iCustom(NULL, 0, "HEi_RCI", li_16, li_4 + FixedBarCount + 1); l_icustom_68 = iCustom(NULL, 0, "HEi_RCI", li_16, li_4 + FixedBarCount + 2); l_icustom_76 = iCustom(NULL, 0, "HEi_RCI", 0, li_4 + FixedBarCount); l_icustom_84 = iCustom(NULL, 0, "HEi_RCI", 0, li_4 + FixedBarCount + 1); l_icustom_92 = iCustom(NULL, 0, "HEi_RCI", 0, li_4 + FixedBarCount + 2); l_icustom_108 = iCustom(NULL, 0, "HEi_RCI", li_12, li_4); l_icustom_116 = iCustom(NULL, 0, "HEi_RCI", ld_100, li_4); l_icustom_124 = iCustom(NULL, 0, "HEi_RCI", ld_100, li_4 + 1); l_icustom_140 = iCustom(NULL, 0, "HEi_RSI", 3, li_4); l_icustom_148 = iCustom(NULL, 0, "HEi_RSI", 3, li_4 + 1); l_icustom_156 = iCustom(NULL, 0, "HEi_RSI", 3, li_4 + 2); l_icustom_172 = iCustom(NULL, 0, "HEi_RSI", 0, li_4); l_icustom_180 = iCustom(NULL, 0, "HEi_RSI", 1, li_4); l_icustom_164 = iCustom(NULL, 0, "HEi_LAG", 0, li_4); l_icustom_188 = iCustom(NULL, 0, "HEi_RSI", 4, li_4); l_icustom_204 = iCustom(NULL, 0, "HEi_RSI", 5, li_4); l_icustom_196 = iCustom(NULL, 0, "HEi_RSI", 6, li_4); l_icustom_212 = iCustom(NULL, 0, "HEi_RSI", 7, li_4); l_icustom_220 = iCustom(NULL, 0, "HEi_RSI", 4, li_4 + 1); l_icustom_236 = iCustom(NULL, 0, "HEi_RSI", 5, li_4 + 1); l_icustom_228 = iCustom(NULL, 0, "HEi_RSI", 6, li_4 + 1); l_icustom_244 = iCustom(NULL, 0, "HEi_RSI", 7, li_4 + 1); li_252 = EMPTY_VALUE; l_icustom_20 = l_icustom_28; if (CrossSignal == TRUE) { if (l_icustom_28 > l_icustom_44 && l_icustom_28 > l_icustom_36 && l_icustom_44 <= l_icustom_52 && l_icustom_60 <= l_icustom_68) li_252 = 0; else if (l_icustom_28 < l_icustom_44 && l_icustom_28 < l_icustom_36 && l_icustom_44 >= l_icustom_52 && l_icustom_60 >= l_icustom_68) li_252 = 1; } if (LevelSignal == TRUE) { if (l_icustom_28 > l_icustom_44 && l_icustom_28 > RCI_Level1 && l_icustom_44 <= RCI_Level1 && l_icustom_60 <= RCI_Level1) li_252 = 0; else { if (l_icustom_36 > l_icustom_52 && l_icustom_36 > RCI_Level1 && l_icustom_52 <= RCI_Level1 && l_icustom_68 <= RCI_Level1) { l_icustom_20 = l_icustom_36; li_252 = 0; } else { if (l_icustom_28 < l_icustom_44 && l_icustom_28 < RCI_Level2 && l_icustom_44 >= RCI_Level2 && l_icustom_60 >= RCI_Level2) li_252 = 1; else { if (l_icustom_36 < l_icustom_52 && l_icustom_36 < RCI_Level2 && l_icustom_52 >= RCI_Level2 && l_icustom_68 >= RCI_Level2) { l_icustom_20 = l_icustom_36; li_252 = 1; } } } } } if (HeatSignal == TRUE) { LevelFilter = FALSE; if (l_icustom_140 > l_icustom_148 && l_icustom_188 != EMPTY_VALUE || l_icustom_196 != EMPTY_VALUE) li_252 = 0; else if (l_icustom_140 < l_icustom_148 && l_icustom_204 != EMPTY_VALUE || l_icustom_212 != EMPTY_VALUE) li_252 = 1; } if (BreakSignal == TRUE) { LevelFilter = FALSE; if (l_icustom_140 > l_icustom_172 && l_icustom_148 <= l_icustom_172) li_252 = 0; else if (l_icustom_140 < l_icustom_180 && l_icustom_148 >= l_icustom_180 && l_icustom_156 >= l_icustom_180) li_252 = 1; } if (li_252 == 0) { g_ibuf_228[li_4] = l_icustom_20; if (LineFilter > 0 && l_icustom_116 < l_icustom_124) g_ibuf_228[li_4] = EMPTY_VALUE; if (l_icustom_164 != 0.0) if (RSIFilter == TRUE && l_icustom_140 < l_icustom_148) g_ibuf_228[li_4] = EMPTY_VALUE; if (RSIFilter == TRUE && l_icustom_140 < l_icustom_180) g_ibuf_228[li_4] = EMPTY_VALUE; if (LevelFilter == TRUE && l_icustom_108 > 0.0) g_ibuf_228[li_4] = EMPTY_VALUE; } else { if (li_252 == 1) { g_ibuf_232[li_4] = l_icustom_20; if (LineFilter > 0 && l_icustom_116 > l_icustom_124) g_ibuf_232[li_4] = EMPTY_VALUE; if (l_icustom_164 != 1.0) if (RSIFilter == TRUE && l_icustom_140 > l_icustom_148) g_ibuf_232[li_4] = EMPTY_VALUE; if (RSIFilter == TRUE && l_icustom_140 > l_icustom_172) g_ibuf_232[li_4] = EMPTY_VALUE; if (LevelFilter == TRUE && l_icustom_108 < 0.0) g_ibuf_232[li_4] = EMPTY_VALUE; } } if (BigTrend == TRUE) { if (l_icustom_76 > RCI_Level1 && l_icustom_84 < RCI_Level1) g_ibuf_236[li_4] = RCI_Level1; else if (l_icustom_76 < RCI_Level2 && l_icustom_84 > RCI_Level2) g_ibuf_240[li_4] = RCI_Level2; } if (li_4 == AlertInterval) { if (g_ibuf_228[li_4] < g_ibuf_232[li_4]) subShowAlert(0); if (g_ibuf_228[li_4] > g_ibuf_232[li_4]) subShowAlert(1); } if (li_4 == AlertInterval) { if (g_ibuf_236[li_4] < g_ibuf_240[li_4]) subShowBigAlert(0); if (g_ibuf_236[li_4] > g_ibuf_240[li_4]) subShowBigAlert(1); } } return (0); } void subShowAlert(int ai_0) { string l_str_concat_4; string ls_12; if (AlertShow == TRUE && g_time_216 != Time[0]) { if (ai_0 == 0) Alert(gs_76 + " going UP on ", Symbol(), " ", gs_84); if (ai_0 == 1) Alert(gs_76 + " going DOWN on ", Symbol(), " ", gs_84); g_time_216 = Time[0]; } if (AlertSound == TRUE && g_time_220 != Time[0]) { if (ai_0 == 0) PlaySound(AlertSoundName); if (ai_0 == 1) PlaySound(AlertSoundName); g_time_220 = Time[0]; } if (AlertMail == TRUE && g_time_224 != Time[0]) { l_str_concat_4 = StringConcatenate(Symbol(), " ", Close[0], " on ", gs_76, TimeToStr(Time[0], TIME_DATE|TIME_SECONDS)); if (ai_0 == 0) l_str_concat_4 = StringConcatenate("UP!", " ", l_str_concat_4); if (ai_0 == 1) l_str_concat_4 = StringConcatenate("DOWN!", " ", l_str_concat_4); ls_12 = "HighPerformance Exchange Indicators for MetaTrader4"; SendMail(l_str_concat_4, ls_12); g_time_224 = Time[0]; } } void subShowBigAlert(int ai_0) { string l_str_concat_4; string ls_12; if (BigAlertShow == TRUE && g_time_216 != Time[0]) { if (ai_0 == 0) Alert(gs_76 + " going Big-UP on ", Symbol(), " ", gs_84); if (ai_0 == 1) Alert(gs_76 + " going Big-DOWN on ", Symbol(), " ", gs_84); g_time_216 = Time[0]; } if (BigAlertSound == TRUE && g_time_220 != Time[0]) { if (ai_0 == 0) PlaySound(BigAlertSoundName); if (ai_0 == 1) PlaySound(BigAlertSoundName); g_time_220 = Time[0]; } if (BigAlertMail == TRUE && g_time_224 != Time[0]) { l_str_concat_4 = StringConcatenate(Symbol(), " ", Close[0], " on ", gs_76, TimeToStr(Time[0], TIME_DATE|TIME_SECONDS)); if (ai_0 == 0) l_str_concat_4 = StringConcatenate("Big-UP!", " ", l_str_concat_4); if (ai_0 == 1) l_str_concat_4 = StringConcatenate("Big-DOWN!", " ", l_str_concat_4); ls_12 = "HighPerformance Exchange Indicators for MetaTrader4"; SendMail(l_str_concat_4, ls_12); g_time_224 = Time[0]; } }