#property copyright "Copyright ゥ 2004, MetaQuotes Software Corp." #property link "http://www.metaquotes.net/" #property indicator_separate_window #property indicator_levelcolor DimGray #property indicator_buffers 6 #property indicator_color1 Black #property indicator_color2 DarkSlateBlue #property indicator_color3 Maroon #property indicator_color4 Coral #property indicator_color5 BurlyWood #property indicator_color6 BurlyWood #property indicator_width1 1 #include string gs_76; string gs_84; extern int FastPeriod = 12; extern int SlowPeriod = 34; extern int LineWidth = 2; extern bool ShowSign = TRUE; extern double SignSize = 0.5; extern color SignColorUP = BurlyWood; extern color SignColorDN = BurlyWood; extern bool AlertShow = FALSE; extern bool AlertSound = FALSE; extern string AlertSoundName = "news.wav"; extern bool AlertMail = FALSE; extern bool Show_Value = FALSE; extern int CalculateBars = 500; extern int FixedBarCount = 1; extern bool ADX_Sign = TRUE; extern int ADX_Period = 5; int gi_164 = 2; extern int ADX_Level1 = 30; extern int ADX_Level2 = 60; extern double ADX_Showlevel1 = 40.0; extern double ADX_Showlevel2 = 60.0; double g_ibuf_192[]; double g_ibuf_196[]; double g_ibuf_200[]; double g_ibuf_204[]; double g_ibuf_208[]; double g_ibuf_212[]; double g_ibuf_216[]; double g_ibuf_220[]; int gt_unused_224 = 315532800; int gt_unused_228 = 315532800; int gt_unused_232 = 315532800; 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("2020/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() { int l_timeframe_0 = Period(); switch (l_timeframe_0) { 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_ACX (" + gs_84 + ")"; IndicatorShortName(gs_76); if (libSystemStart(gs_76) == 0) return (0); IndicatorBuffers(8); SetIndexBuffer(0, g_ibuf_192); SetIndexBuffer(1, g_ibuf_196); SetIndexBuffer(2, g_ibuf_200); SetIndexLabel(0, "ACX"); if (!Show_Value) { SetIndexLabel(0, NULL); SetIndexLabel(1, NULL); SetIndexLabel(2, NULL); SetIndexLabel(3, NULL); SetIndexLabel(4, NULL); SetIndexLabel(5, NULL); SetIndexLabel(6, NULL); SetIndexLabel(7, NULL); } SetIndexStyle(0, DRAW_NONE); SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, LineWidth); SetIndexStyle(2, DRAW_HISTOGRAM, STYLE_SOLID, LineWidth); SetIndexBuffer(3, g_ibuf_212); SetIndexLabel(3, "ADX Heat"); SetIndexStyle(3, DRAW_ARROW, STYLE_SOLID); SetIndexArrow(3, 240); if (!Show_Value) SetIndexLabel(3, NULL); if (ADX_Sign == FALSE) SetIndexStyle(3, DRAW_NONE); SetIndexBuffer(4, g_ibuf_216); SetIndexBuffer(5, g_ibuf_220); SetIndexStyle(4, DRAW_ARROW, STYLE_SOLID, SignSize, SignColorUP); SetIndexStyle(5, DRAW_ARROW, STYLE_SOLID, SignSize, SignColorDN); SetIndexArrow(4, 233); SetIndexArrow(5, 234); SetIndexBuffer(6, g_ibuf_204); SetIndexBuffer(7, g_ibuf_208); SetIndexStyle(6, DRAW_NONE); SetIndexStyle(7, DRAW_NONE); if (CalculateBars > 0) { SetIndexDrawBegin(0, Bars - CalculateBars); SetIndexDrawBegin(1, Bars - CalculateBars); SetIndexDrawBegin(2, Bars - CalculateBars); SetIndexDrawBegin(3, Bars - CalculateBars); SetIndexDrawBegin(4, Bars - CalculateBars); SetIndexDrawBegin(5, Bars - CalculateBars); SetIndexDrawBegin(6, Bars - CalculateBars); SetIndexDrawBegin(7, Bars - CalculateBars); } gt_unused_224 = Time[0]; gt_unused_228 = Time[0]; gt_unused_232 = Time[0]; return (0); } int start() { double ld_8; double ld_16; double l_iadx_32; double l_iadx_40; double l_iadx_48; double l_iadx_56; double ld_64; double ld_72; double ld_80; double ld_88; double ld_96; int li_4 = IndicatorCounted(); if (li_4 > 0) li_4--; int li_0 = Bars - li_4; if (li_0 > CalculateBars) li_0 = CalculateBars; for (int li_24 = 0; li_24 < li_0; li_24++) g_ibuf_204[li_24] = iMA(NULL, 0, FastPeriod, 0, MODE_SMA, PRICE_MEDIAN, li_24) - iMA(NULL, 0, SlowPeriod, 0, MODE_SMA, PRICE_MEDIAN, li_24); for (li_24 = 0; li_24 < li_0; li_24++) g_ibuf_208[li_24] = iMAOnArray(g_ibuf_204, Bars, FastPeriod, 0, MODE_SMA, li_24); bool li_28 = TRUE; for (li_24 = li_0 - 1; li_24 >= 0; li_24--) { ld_16 = g_ibuf_204[li_24] - g_ibuf_208[li_24]; ld_8 = g_ibuf_204[li_24 + 1] - (g_ibuf_208[li_24 + 1]); if (ld_16 > ld_8) li_28 = TRUE; if (ld_16 < ld_8) li_28 = FALSE; g_ibuf_196[li_24] = 0.0; g_ibuf_200[li_24] = 0.0; if (li_28) g_ibuf_196[li_24] = ld_16; else g_ibuf_200[li_24] = ld_16; g_ibuf_192[li_24] = ld_16; } for (li_24 = li_0 - 1; li_24 >= 0; li_24--) { if (g_ibuf_192[li_24 + FixedBarCount] > 0.0 && g_ibuf_192[li_24 + FixedBarCount + 1] < 0.0) g_ibuf_216[li_24 + FixedBarCount] = 0; if (g_ibuf_192[li_24 + FixedBarCount] < 0.0 && g_ibuf_192[li_24 + FixedBarCount + 1] > 0.0) g_ibuf_220[li_24 + FixedBarCount] = 0; } if (ADX_Sign == TRUE) { for (li_24 = li_0 - 1; li_24 >= 0; li_24--) { l_iadx_32 = iADX(NULL, 0, ADX_Period, PRICE_CLOSE, MODE_MAIN, li_24); l_iadx_48 = iADX(NULL, 0, ADX_Period, PRICE_CLOSE, MODE_PLUSDI, li_24); l_iadx_56 = iADX(NULL, 0, ADX_Period, PRICE_CLOSE, MODE_MINUSDI, li_24); l_iadx_40 = iADX(NULL, 0, ADX_Period, PRICE_CLOSE, MODE_MAIN, li_24 + 1); g_ibuf_212[li_24] = EMPTY_VALUE; ld_80 = 0; MathMax(g_ibuf_204[li_24], g_ibuf_208[li_24]); ld_88 = 0; MathMin(g_ibuf_204[li_24], g_ibuf_208[li_24]); ld_96 = 0; MathAbs(g_ibuf_204[li_24] - g_ibuf_208[li_24]); if (g_ibuf_196[li_24] == 0.0) ld_72 = g_ibuf_200[li_24]; if (g_ibuf_200[li_24] == 0.0) ld_72 = g_ibuf_196[li_24]; if (ld_72 > 0.0) { if (gi_164 == 1) ld_64 = ld_72 - MathAbs(ld_72) / 3.0; if (gi_164 == 2) ld_64 = ld_72 - MathAbs(ld_72) / 4.0; if (gi_164 == 3) ld_64 = ld_88 - ld_96; if (gi_164 == 4) ld_64 = g_ibuf_196[li_24]; if (gi_164 == 5) ld_64 = 0.0; if (l_iadx_32 < l_iadx_40) ld_64 = EMPTY_VALUE; } else { if (ld_72 < 0.0) { if (gi_164 == 1) ld_64 = ld_72 + MathAbs(ld_72) / 3.0; if (gi_164 == 2) ld_64 = ld_72 + MathAbs(ld_72) / 4.0; if (gi_164 == 3) ld_64 = ld_80 + ld_96; if (gi_164 == 4) ld_64 = g_ibuf_200[li_24]; if (gi_164 == 5) ld_64 = 0.0; if (l_iadx_32 < l_iadx_40) ld_64 = EMPTY_VALUE; } } if (l_iadx_32 >= ADX_Level1 && l_iadx_32 >= l_iadx_40) { if (l_iadx_48 > l_iadx_56) g_ibuf_212[li_24] = ld_64; if (l_iadx_56 > l_iadx_48) g_ibuf_212[li_24] = ld_64; } if (l_iadx_32 >= ADX_Level2 && l_iadx_32 >= l_iadx_40) { g_ibuf_212[li_24] = EMPTY_VALUE; if (l_iadx_48 > l_iadx_56) g_ibuf_212[li_24] = ld_64; if (l_iadx_56 > l_iadx_48) g_ibuf_212[li_24] = ld_64; } } } return (0); }