/*
   Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
   Website: http://purebeam.biz
   E-mail : purebeam@gmail.com
*/
#property copyright "Joshua Jones"
#property link      "http://www.forexfactory.com"

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Black

extern int periods = 20;
extern double multiplier = 3.0;
int gi_88 = 10000;
double g_ibuf_92[];
string gs_96 = "";

int init() {
   int li_0;
   if (StringFind(Symbol(), "JPY", 0) != -1) gi_88 = 100;
   if (multiplier != 1.0) {
      li_0 = 100.0 * multiplier;
      gs_96 = li_0 + "% of ";
   }
   SetIndexBuffer(0, g_ibuf_92);
   SetIndexLabel(0, "ATR (" + periods + ")");
   SetIndexStyle(0, DRAW_NONE);
   IndicatorShortName(gs_96 + "ATR (" + periods + ")");
   return (0);
}

int deinit() {
   return (0);
}

int start() {
   double ld_12;
   int li_4 = IndicatorCounted();
   if (li_4 < 0) return (-1);
   if (li_4 > 0) li_4--;
   int li_0 = Bars - li_4;
   for (int li_8 = 0; li_8 < li_0; li_8++) {
      ld_12 = MathCeil(gi_88 * multiplier * iATR(NULL, 0, periods, li_8));
      g_ibuf_92[li_8] = ld_12;
   }
   Comment("\n", " ", gs_96, "ATR (", periods, "):   ", g_ibuf_92[0], " pips");
   return (0);
}
