#property copyright "ForexTrigger System (C) 2009-2010"
#property link "ForexTrigger.com"
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Green
#property indicator_color2 Blue
#property indicator_color3 Red
int g_period_76 = 20;
double g_ibuf_80[];
double g_ibuf_84[];
double g_ibuf_88[];
int init() {
if (ObjectType("lbl") != 23) ObjectDelete("lbl");
if (ObjectFind("lbl") == -1) ObjectCreate("lbl", OBJ_LABEL, 0, Time[5], Close[5]);
ObjectSetText("lbl", "InstaaTrend (C)");
ObjectSet("lbl", OBJPROP_FONTSIZE, 9);
ObjectSet("lbl", OBJPROP_CORNER, 3);
ObjectSet("lbl", OBJPROP_COLOR, Blue);
ObjectSet("lbl", OBJPROP_XDISTANCE, 20);
ObjectSet("lbl", OBJPROP_YDISTANCE, 10);
SetIndexStyle(0, DRAW_HISTOGRAM);
SetIndexBuffer(0, g_ibuf_80);
SetIndexStyle(1, DRAW_HISTOGRAM);
SetIndexBuffer(1, g_ibuf_84);
SetIndexStyle(2, DRAW_HISTOGRAM);
SetIndexBuffer(2, g_ibuf_88);
return (0);
}
int deinit() {
ObjectDelete("lbl");
return (0);
}
int start() {
if (ObjectType("lbl") != 23) ObjectDelete("lbl");
if (ObjectFind("lbl") == -1) ObjectCreate("lbl", OBJ_LABEL, 0, Time[5], Close[5]);
ObjectSetText("lbl", "InstaaTrend (C)");
ObjectSet("lbl", OBJPROP_FONTSIZE, 9);
ObjectSet("lbl", OBJPROP_CORNER, 3);
ObjectSet("lbl", OBJPROP_COLOR, Blue);
ObjectSet("lbl", OBJPROP_XDISTANCE, 20);
ObjectSet("lbl", OBJPROP_YDISTANCE, 10);
double ld_0 = 0;
for (int li_8 = 0; li_8 < Bars; li_8++) {
ld_0 = iMA(Symbol(), 0, g_period_76, 0, MODE_SMA, PRICE_CLOSE, li_8) - iMA(Symbol(), 0, g_period_76, 0, MODE_SMA, PRICE_CLOSE, li_8 + 1);
ld_0 += iMA(Symbol(), 0, g_period_76, 0, MODE_SMA, PRICE_CLOSE, li_8 + 1) - iMA(Symbol(), 0, g_period_76, 0, MODE_SMA, PRICE_CLOSE, li_8 + 2);
ld_0 /= 2.0;
g_ibuf_80[li_8] = ld_0;
}
for (li_8 = 0; li_8 < Bars; li_8++) {
if (g_ibuf_80[li_8] > 0.0) g_ibuf_84[li_8] = g_ibuf_80[li_8];
else g_ibuf_88[li_8] = g_ibuf_80[li_8];
}
return (0);
}