/*
   Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
   Website: http://purebeam.biz
   E-mail : purebeam@gmail.com
*/

#property indicator_separate_window
#property indicator_minimum 0.5
#property indicator_maximum 3.0
#property indicator_buffers 8
#property indicator_color1 Lime
#property indicator_color2 Red
#property indicator_color3 Lime
#property indicator_color4 Red
#property indicator_color5 Lime
#property indicator_color6 Red
#property indicator_color7 Lime
#property indicator_color8 Red

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 = Red;
extern color TextColor = Black;
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_180;
double g_ima_188;
double g_ima_196;
string gs_unused_204 = "";
int gi_unused_212 = 16777215;
string gs_216;
string gs_232;
int gi_unused_244;
int g_acc_number_248;
int gi_252;
int g_color_256 = Red;
string gs_unused_260 = "Font Size";
int g_fontsize_268 = 40;
string gs_unused_272 = "Font Type";
string gs_verdana_280 = "Verdana";
string g_text_288 = ">>> CHECKING ACCOUNT <<<";
string g_text_296 = ">>> AUTHORIZATION <<<";
string g_name_304 = "cmtagtpbi01";
string g_name_312 = "cmtagtpbi02";

int init() {
   gi_unused_244 = 1;
   gs_232 = " RibbonTrader " + Symbol() + Period();
   gs_216 = gs_232 + "0";
   IndicatorShortName(gs_232);
   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_304);
   ObjectDelete(g_name_312);
   return (0);
}

int start() {
   int li_0;
   ObjectDelete(g_name_304);
   ObjectDelete(g_name_312);
   int li_4 = IndicatorCounted();
   if (li_4 < 0) return (-1);
   if (li_4 > 0) li_4--;
   int li_8 = Bars - li_4;
   if (gi_252 < 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_188 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_CLOSE, li_12);
      g_ima_196 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_CLOSE, li_12 + 1);
      if (g_ima_188 < g_ima_196) g_ibuf_148[li_12] = 2.5;
      else g_ibuf_144[li_12] = 2.5;
      g_ima_188 = iMA(NULL, 0, 10, 0, MODE_EMA, PRICE_CLOSE, li_12);
      g_ima_196 = iMA(NULL, 0, 10, 0, MODE_EMA, PRICE_CLOSE, li_12 + 1);
      if (g_ima_188 < g_ima_196) g_ibuf_156[li_12] = 2;
      else g_ibuf_152[li_12] = 2;
      g_ima_188 = iMA(NULL, 0, 20, 0, MODE_EMA, PRICE_CLOSE, li_12);
      g_ima_196 = iMA(NULL, 0, 20, 0, MODE_EMA, PRICE_CLOSE, li_12 + 1);
      if (g_ima_188 < g_ima_196) g_ibuf_164[li_12] = 1.5;
      else g_ibuf_160[li_12] = 1.5;
      g_ima_188 = iMA(NULL, 0, 30, 0, MODE_EMA, PRICE_CLOSE, li_12);
      g_ima_196 = iMA(NULL, 0, 30, 0, MODE_EMA, PRICE_CLOSE, li_12 + 1);
      if (g_ima_188 < g_ima_196) g_ibuf_172[li_12] = 1;
      else g_ibuf_168[li_12] = 1;
   }
   if (li_12 > gi_252) gi_252 = li_12;
   return (0);
}

