/* Generated by EX4-TO-MQ4 decompiler V4.0.220.2c [] Website: http://purebeam.biz E-mail : purebeam@gmail.com */ #property copyright "Kirk Sloan" #property link "http://www.metaquotes.net" #property indicator_separate_window #property indicator_minimum 0.0 #property indicator_maximum 1.0 #property indicator_buffers 3 #property indicator_color1 FireBrick #property indicator_color2 Green #property indicator_color3 Gold int g_timeframe_76 = 0; int g_period_80 = 2; int g_period_84 = 4; int g_period_88 = 9; int gi_92 = 1000; int g_window_96 = 1; int g_corner_100 = 3; double g_ibuf_104[]; double g_ibuf_108[]; double g_ibuf_112[]; string gs_unused_164; double g_imacd_196; double g_imacd_204; int gi_unused_212 = 0; int init() { SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID, 4, FireBrick); SetIndexBuffer(0, g_ibuf_104); SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, 4, Green); SetIndexBuffer(1, g_ibuf_108); SetIndexStyle(2, DRAW_HISTOGRAM, STYLE_SOLID, 4, Gold); SetIndexBuffer(2, g_ibuf_112); switch (g_timeframe_76) { case PERIOD_M1: gs_unused_164 = "Period_M1"; break; case PERIOD_M5: gs_unused_164 = "Period_M5"; break; case PERIOD_M15: gs_unused_164 = "Period_M15"; break; case PERIOD_M30: gs_unused_164 = "Period_M30"; break; case PERIOD_H1: gs_unused_164 = "Period_H1"; break; case PERIOD_H4: gs_unused_164 = "Period_H4"; break; case PERIOD_D1: gs_unused_164 = "Period_D1"; break; case PERIOD_W1: gs_unused_164 = "Period_W1"; break; case PERIOD_MN1: gs_unused_164 = "Period_MN1"; break; default: gs_unused_164 = "Current Timeframe"; g_timeframe_76 = 0; } IndicatorShortName("THV Trend"); return (0); } int deinit() { return (0); } int start() { string l_text_8; int l_ind_counted_0 = IndicatorCounted(); for (int l_shift_4 = 0; l_shift_4 < gi_92; l_shift_4++) { g_ibuf_104[l_shift_4] = 0; g_ibuf_108[l_shift_4] = 0; g_ibuf_112[l_shift_4] = 0; g_imacd_196 = iMACD(NULL, g_timeframe_76, g_period_80, g_period_84, g_period_88, PRICE_CLOSE, MODE_SIGNAL, l_shift_4); g_imacd_204 = iMACD(NULL, g_timeframe_76, g_period_80, g_period_84, g_period_88, PRICE_CLOSE, MODE_MAIN, l_shift_4); if (g_imacd_196 < g_imacd_204 && g_imacd_204 > 0.0) g_ibuf_108[l_shift_4] = 1; if (g_imacd_196 > g_imacd_204 && g_imacd_204 < 0.0) g_ibuf_104[l_shift_4] = 1; if (g_ibuf_104[l_shift_4] == 0.0 && g_ibuf_108[l_shift_4] == 0.0) g_ibuf_112[l_shift_4] = 1; } if (g_ibuf_108[0] == 1.0 && g_ibuf_108[1]) { l_text_8 = "Trend U P"; ObjectDelete("Trend_Crossing_Label"); ObjectCreate("Trend_Crossing_Label", OBJ_LABEL, g_window_96, 0, 0); ObjectSet("Trend_Crossing_Label", OBJPROP_CORNER, g_corner_100); ObjectSet("Trend_Crossing_Label", OBJPROP_XDISTANCE, 6); ObjectSet("Trend_Crossing_Label", OBJPROP_YDISTANCE, 1); ObjectSet("Trend_Crossing_Label", OBJPROP_COLOR, LimeGreen); ObjectSetText("Trend_Crossing_Label", l_text_8, 14, "Arial Black", LimeGreen); } if (g_ibuf_104[0] == 1.0 && g_ibuf_104[1]) { l_text_8 = "Trend Down"; ObjectDelete("Trend_Crossing_Label"); ObjectCreate("Trend_Crossing_Label", OBJ_LABEL, g_window_96, 0, 0); ObjectSet("Trend_Crossing_Label", OBJPROP_CORNER, g_corner_100); ObjectSet("Trend_Crossing_Label", OBJPROP_XDISTANCE, 3); ObjectSet("Trend_Crossing_Label", OBJPROP_YDISTANCE, 1); ObjectSet("Trend_Crossing_Label", OBJPROP_COLOR, Red); ObjectSetText("Trend_Crossing_Label", l_text_8, 12, "Arial Black", Red); } if (g_ibuf_112[0] == 1.0 && g_ibuf_104[1]) { l_text_8 = "Trend Flat"; ObjectDelete("Trend_Crossing_Label"); ObjectCreate("Trend_Crossing_Label", OBJ_LABEL, g_window_96, 0, 0); ObjectSet("Trend_Crossing_Label", OBJPROP_CORNER, g_corner_100); ObjectSet("Trend_Crossing_Label", OBJPROP_XDISTANCE, 4); ObjectSet("Trend_Crossing_Label", OBJPROP_YDISTANCE, 1); ObjectSet("Trend_Crossing_Label", OBJPROP_COLOR, Red); ObjectSetText("Trend_Crossing_Label", l_text_8, 14, "Arial Black", Yellow); } return (0); }