
#property indicator_separate_window
#property indicator_minimum 0.0
#property indicator_maximum 4.0
#property indicator_buffers 8
#property indicator_color1 Lime
#property indicator_color2 OrangeRed
#property indicator_color3 Lime
#property indicator_color4 OrangeRed
#property indicator_color5 Lime
#property indicator_color6 OrangeRed
#property indicator_color7 Lime
#property indicator_color8 OrangeRed

extern int price.x.offset = 0;
extern int price.y.offset = 0;
extern string myFont = "Arial Bold";
extern int myFontSize = 20;
extern int xStart = 0;
extern int xOffSet = 0;
extern int MAPeriod = 5;
extern int MAType = 1;
extern int BarWidth = 0;
extern color BarColorUp = Lime;
extern color BarColorDown = OrangeRed;
extern color TextColor = White;
extern int MaxBars = 500;
extern int myWingding = 110;
double gd_unused_136 = 1.0;
double g_ibuf_144[];
double g_ibuf_148[];
double g_ibuf_152[];
double g_ibuf_156[];
double g_ibuf_160[];
double g_ibuf_164[];
double g_ibuf_168[];
double g_ibuf_172[];
string gs_dummy_176;
double g_ima_184;
double g_ima_192;
string gs_unused_200 = "";
int gi_unused_208 = 16777215;
string gs_212;
string gs_220;
int gi_unused_228;
int gi_232;
int gi_unused_236 = 255;
string gs_unused_240 = "Font Size";
int gi_unused_248 = 40;
string gs_unused_252 = "Font Type";
string gs_unused_260 = "Verdana";
string g_name_268 = "cmtagtpbi01";
string g_name_276 = "cmtagtpbi02";

int init() {
   gi_unused_228 = 1;
   gs_220 = "Fxdd " + Symbol() + Period();
   gs_212 = gs_220 + "0";
   IndicatorShortName(gs_220);
   SetIndexStyle(0, DRAW_ARROW, STYLE_SOLID, BarWidth, BarColorUp);
   SetIndexArrow(0, myWingding);
   SetIndexBuffer(0, g_ibuf_144);
   SetIndexStyle(1, DRAW_ARROW, STYLE_SOLID, BarWidth, BarColorDown);
   SetIndexArrow(1, myWingding);
   SetIndexBuffer(1, g_ibuf_148);
   SetIndexStyle(2, DRAW_ARROW, STYLE_SOLID, BarWidth, BarColorUp);
   SetIndexArrow(2, myWingding);
   SetIndexBuffer(2, g_ibuf_152);
   SetIndexStyle(3, DRAW_ARROW, STYLE_SOLID, BarWidth, BarColorDown);
   SetIndexArrow(3, myWingding);
   SetIndexBuffer(3, g_ibuf_156);
   SetIndexStyle(4, DRAW_ARROW, STYLE_SOLID, BarWidth, BarColorUp);
   SetIndexArrow(4, myWingding);
   SetIndexBuffer(4, g_ibuf_160);
   SetIndexStyle(5, DRAW_ARROW, STYLE_SOLID, BarWidth, BarColorDown);
   SetIndexArrow(5, myWingding);
   SetIndexBuffer(5, g_ibuf_164);
   SetIndexStyle(6, DRAW_ARROW, STYLE_SOLID, BarWidth, BarColorUp);
   SetIndexArrow(6, myWingding);
   SetIndexBuffer(6, g_ibuf_168);
   SetIndexStyle(7, DRAW_ARROW, STYLE_SOLID, BarWidth, BarColorDown);
   SetIndexArrow(7, myWingding);
   SetIndexBuffer(7, g_ibuf_172);
   IndicatorDigits(0);
   return (0);
}

int deinit() {
   ObjectDelete(g_name_268);
   ObjectDelete(g_name_276);
   return (0);
}

int start() {
   int li_unused_0 = 1106860;
   ObjectDelete(g_name_268);
   ObjectDelete(g_name_276);
   int li_4 = IndicatorCounted();
   if (li_4 < 0) return (-1);
   if (li_4 > 0) li_4--;
   int li_8 = Bars - li_4;
   if (gi_232 < Bars - 1) li_8 = Bars - 1;
   for (int li_12 = 0; li_12 < li_8; li_12++) {
      g_ibuf_148[li_12] = EMPTY_VALUE;
      g_ibuf_144[li_12] = EMPTY_VALUE;
      g_ibuf_156[li_12] = EMPTY_VALUE;
      g_ibuf_152[li_12] = EMPTY_VALUE;
      g_ibuf_164[li_12] = EMPTY_VALUE;
      g_ibuf_160[li_12] = EMPTY_VALUE;
      g_ibuf_172[li_12] = EMPTY_VALUE;
      g_ibuf_168[li_12] = EMPTY_VALUE;
      g_ima_184 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_CLOSE, li_12);
      g_ima_192 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_CLOSE, li_12 + 1);
      if (g_ima_184 < g_ima_192) g_ibuf_148[li_12] = 2.5;
      else g_ibuf_144[li_12] = 2.5;
      g_ima_184 = iMA(NULL, 0, 10, 0, MODE_EMA, PRICE_CLOSE, li_12);
      g_ima_192 = iMA(NULL, 0, 10, 0, MODE_EMA, PRICE_CLOSE, li_12 + 1);
      if (g_ima_184 < g_ima_192) g_ibuf_156[li_12] = 2;
      else g_ibuf_152[li_12] = 2;
      g_ima_184 = iMA(NULL, 0, 20, 0, MODE_EMA, PRICE_CLOSE, li_12);
      g_ima_192 = iMA(NULL, 0, 20, 0, MODE_EMA, PRICE_CLOSE, li_12 + 1);
      if (g_ima_184 < g_ima_192) g_ibuf_164[li_12] = 1.5;
      else g_ibuf_160[li_12] = 1.5;
      g_ima_184 = iMA(NULL, 0, 30, 0, MODE_EMA, PRICE_CLOSE, li_12);
      g_ima_192 = iMA(NULL, 0, 30, 0, MODE_EMA, PRICE_CLOSE, li_12 + 1);
      if (g_ima_184 < g_ima_192) g_ibuf_172[li_12] = 1;
      else g_ibuf_168[li_12] = 1;
   }
   if (li_12 > gi_232) gi_232 = li_12;
   return (0);
}