/*
*/
#property copyright "Copyright © 2008, Forex Day Monster"
#property link      "http://www.forexprofitmonster.com"

#property indicator_separate_window

extern double Risk_to_Reward_ratio = 3.0;
int gi_unused_84;

int init() {
   IndicatorShortName("FDM ADR");
   if (Symbol() == "GBPJPY" || Symbol() == "EURJPY" || Symbol() == "USDJPY" || Symbol() == "GOLD" || Symbol() == "USDMXN") gi_unused_84 = 4;
   if (Symbol() == "GBPUSD" || Symbol() == "EURUSD" || Symbol() == "NZDUSD" || Symbol() == "USDCHF" || Symbol() == "USDCAD" || Symbol() == "AUDUSD" || Symbol() == "EURUSD" ||
      Symbol() == "EURCHF" || Symbol() == "EURGBP" || Symbol() == "EURCAD" || Symbol() == "EURAUD" || Symbol() == "AUDNZD") gi_unused_84 = 4;
   return (0);
}

int deinit() {
   return (0);
}

int start() {
   string ls_0 = "2015.11.01";
   int l_str2time_8 = StrToTime(ls_0);
   if (TimeCurrent() >= l_str2time_8) {
      Alert(" Trial version has expired! Email support@forexprofitmonster.com with broker account number for rights to full version!");
      return (0);
   }
   int li_12 = 0;
   int li_16 = 0;
   int li_20 = 0;
   int li_24 = 0;
   int li_28 = 0;
   bool li_32 = FALSE;
   bool li_36 = FALSE;
   bool li_40 = FALSE;
   bool li_44 = FALSE;
   double ld_48 = 0;
   double ld_56 = 0;
   double l_ilow_64 = 0;
   double l_ihigh_72 = 0;
   string ls_80 = "";
   int li_88 = 0;
   li_12 = (iHigh(NULL, PERIOD_D1, 1) - iLow(NULL, PERIOD_D1, 1)) / Point;
   for (li_88 = 1; li_88 <= 5; li_88++) li_16 = li_16 + (iHigh(NULL, PERIOD_D1, li_88) - iLow(NULL, PERIOD_D1, li_88)) / Point;
   for (li_88 = 1; li_88 <= 10; li_88++) li_20 = li_20 + (iHigh(NULL, PERIOD_D1, li_88) - iLow(NULL, PERIOD_D1, li_88)) / Point;
   for (li_88 = 1; li_88 <= 20; li_88++) li_24 = li_24 + (iHigh(NULL, PERIOD_D1, li_88) - iLow(NULL, PERIOD_D1, li_88)) / Point;
   li_16 /= 5;
   li_20 /= 10;
   li_24 /= 20;
   li_28 = (li_12 + li_16 + li_20 + li_24) / 4;
   l_ilow_64 = iLow(NULL, PERIOD_D1, 0);
   l_ihigh_72 = iHigh(NULL, PERIOD_D1, 0);
   li_32 = li_28 - (Bid - l_ilow_64) / Point;
   li_36 = li_28 - (l_ihigh_72 - Bid) / Point;
   li_40 = li_32 / Risk_to_Reward_ratio;
   ld_48 = Bid - li_40 * Point;
   li_44 = li_36 / Risk_to_Reward_ratio;
   ld_56 = Bid + li_44 * Point;
   Comment(ls_80);
   string l_timeframe_92 = Period();
   ObjectCreate("FDM ADR", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("FDM ADR", StringSubstr(Symbol(), 0), 12, "Arial Bold", White);
   ObjectSet("FDM ADR", OBJPROP_CORNER, 0);
   ObjectSet("FDM ADR", OBJPROP_XDISTANCE, 125);
   ObjectSet("FDM ADR", OBJPROP_YDISTANCE, 2);
   ObjectCreate("FDM ADR1", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("FDM ADR1", StringSubstr(l_timeframe_92, 0), 12, "Arial Bold", CadetBlue);
   ObjectSet("FDM ADR1", OBJPROP_CORNER, 0);
   ObjectSet("FDM ADR1", OBJPROP_XDISTANCE, 210);
   ObjectSet("FDM ADR1", OBJPROP_YDISTANCE, 2);
   ObjectCreate("FDM ADR2", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("FDM ADR2", "Avg Daily Range:", 10, "Arial Bold", CadetBlue);
   ObjectSet("FDM ADR2", OBJPROP_CORNER, 0);
   ObjectSet("FDM ADR2", OBJPROP_XDISTANCE, 375);
   ObjectSet("FDM ADR2", OBJPROP_YDISTANCE, 2);
   ObjectCreate("FDM ADR3", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("FDM ADR3", DoubleToStr(li_28, 0), 12, "Arial Bold", Orange);
   ObjectSet("FDM ADR3", OBJPROP_CORNER, 0);
   ObjectSet("FDM ADR3", OBJPROP_XDISTANCE, 505);
   ObjectSet("FDM ADR3", OBJPROP_YDISTANCE, 2);
   ObjectCreate("FDM ADR4", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("FDM ADR4", "Prev 01 Day Range:", 10, "Arial ", LightSteelBlue);
   ObjectSet("FDM ADR4", OBJPROP_CORNER, 0);
   ObjectSet("FDM ADR4", OBJPROP_XDISTANCE, 125);
   ObjectSet("FDM ADR4", OBJPROP_YDISTANCE, 20);
   ObjectCreate("FDM ADR5", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("FDM ADR5", DoubleToStr(li_12, 0), 12, "Arial Bold", Orange);
   ObjectSet("FDM ADR5", OBJPROP_CORNER, 0);
   ObjectSet("FDM ADR5", OBJPROP_XDISTANCE, 260);
   ObjectSet("FDM ADR5", OBJPROP_YDISTANCE, 20);
   ObjectCreate("FDM ADR6", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("FDM ADR6", "Prev 05 Days Range:", 10, "Arial ", LightSteelBlue);
   ObjectSet("FDM ADR6", OBJPROP_CORNER, 0);
   ObjectSet("FDM ADR6", OBJPROP_XDISTANCE, 125);
   ObjectSet("FDM ADR6", OBJPROP_YDISTANCE, 35);
   ObjectCreate("FDM ADR7", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("FDM ADR7", DoubleToStr(li_16, 0), 12, "Arial Bold", Orange);
   ObjectSet("FDM ADR7", OBJPROP_CORNER, 0);
   ObjectSet("FDM ADR7", OBJPROP_XDISTANCE, 260);
   ObjectSet("FDM ADR7", OBJPROP_YDISTANCE, 35);
   ObjectCreate("FDM ADR8", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("FDM ADR8", "Prev 10 Days Range:", 10, "Arial ", LightSteelBlue);
   ObjectSet("FDM ADR8", OBJPROP_CORNER, 0);
   ObjectSet("FDM ADR8", OBJPROP_XDISTANCE, 375);
   ObjectSet("FDM ADR8", OBJPROP_YDISTANCE, 20);
   ObjectCreate("FDM ADR9", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("FDM ADR9", DoubleToStr(li_20, 0), 12, "Arial Bold", Orange);
   ObjectSet("FDM ADR9", OBJPROP_CORNER, 0);
   ObjectSet("FDM ADR9", OBJPROP_XDISTANCE, 505);
   ObjectSet("FDM ADR9", OBJPROP_YDISTANCE, 20);
   ObjectCreate("FDM ADR10", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("FDM ADR10", "Prev 20 Days Range:", 10, "Arial ", LightSteelBlue);
   ObjectSet("FDM ADR10", OBJPROP_CORNER, 0);
   ObjectSet("FDM ADR10", OBJPROP_XDISTANCE, 375);
   ObjectSet("FDM ADR10", OBJPROP_YDISTANCE, 35);
   ObjectCreate("FDM ADR11", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("FDM ADR11", DoubleToStr(li_24, 0), 12, "Arial Bold", Orange);
   ObjectSet("FDM ADR11", OBJPROP_CORNER, 0);
   ObjectSet("FDM ADR11", OBJPROP_XDISTANCE, 505);
   ObjectSet("FDM ADR11", OBJPROP_YDISTANCE, 35);
   ObjectCreate("FDM ADR12", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("FDM ADR12", "Room UP:", 10, "Arial ", LightSteelBlue);
   ObjectSet("FDM ADR12", OBJPROP_CORNER, 0);
   ObjectSet("FDM ADR12", OBJPROP_XDISTANCE, 600);
   ObjectSet("FDM ADR12", OBJPROP_YDISTANCE, 20);
   ObjectCreate("FDM ADR13", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("FDM ADR13", DoubleToStr(li_32, 0), 12, "Arial Bold", Orange);
   ObjectSet("FDM ADR13", OBJPROP_CORNER, 0);
   ObjectSet("FDM ADR13", OBJPROP_XDISTANCE, 700);
   ObjectSet("FDM ADR13", OBJPROP_YDISTANCE, 20);
   ObjectCreate("FDM ADR14", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("FDM ADR14", "Room DN:", 10, "Arial ", LightSteelBlue);
   ObjectSet("FDM ADR14", OBJPROP_CORNER, 0);
   ObjectSet("FDM ADR14", OBJPROP_XDISTANCE, 600);
   ObjectSet("FDM ADR14", OBJPROP_YDISTANCE, 35);
   ObjectCreate("FDM ADR15", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("FDM ADR15", DoubleToStr(li_36, 0), 12, "Arial Bold", Orange);
   ObjectSet("FDM ADR15", OBJPROP_CORNER, 0);
   ObjectSet("FDM ADR15", OBJPROP_XDISTANCE, 700);
   ObjectSet("FDM ADR15", OBJPROP_YDISTANCE, 35);
   double l_ima_100 = iMA(Symbol(), PERIOD_D1, 1, 0, MODE_SMMA, PRICE_HIGH, 0);
   double l_ima_108 = iMA(Symbol(), PERIOD_D1, 1, 0, MODE_EMA, PRICE_LOW, 0);
   double ld_unused_116 = iMA(Symbol(), PERIOD_D1, 1, 0, MODE_SMMA, PRICE_HIGH, 1);
   double ld_unused_124 = iMA(Symbol(), PERIOD_D1, 1, 0, MODE_EMA, PRICE_LOW, 1);
   ObjectCreate("high", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("high", DoubleToStr(l_ima_100, Digits), 12, "Arial Bold", Orange);
   ObjectSet("high", OBJPROP_CORNER, 0);
   ObjectSet("high", OBJPROP_XDISTANCE, 890);
   ObjectSet("high", OBJPROP_YDISTANCE, 20);
   ObjectCreate("high2", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("high2", "DailyHigh", 9, "Arial Bold", CadetBlue);
   ObjectSet("high2", OBJPROP_CORNER, 0);
   ObjectSet("high2", OBJPROP_XDISTANCE, 890);
   ObjectSet("high2", OBJPROP_YDISTANCE, 2);
   ObjectCreate("low", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("low", DoubleToStr(l_ima_108, Digits), 12, "Arial Bold", Orange);
   ObjectSet("low", OBJPROP_CORNER, 0);
   ObjectSet("low", OBJPROP_XDISTANCE, 830);
   ObjectSet("low", OBJPROP_YDISTANCE, 20);
   ObjectCreate("low2", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("low2", "DailyLow", 9, "Arial Bold", CadetBlue);
   ObjectSet("low2", OBJPROP_CORNER, 0);
   ObjectSet("low2", OBJPROP_XDISTANCE, 830);
   ObjectSet("low2", OBJPROP_YDISTANCE, 2);
   double l_ima_132 = iMA(Symbol(), 0, 1, 0, MODE_EMA, PRICE_CLOSE, 0);
   ObjectCreate("high3", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("high3", DoubleToStr(l_ima_132, Digits), 12, "Arial Bold", Coral);
   ObjectSet("high3", OBJPROP_CORNER, 0);
   ObjectSet("high3", OBJPROP_XDISTANCE, 890);
   ObjectSet("high3", OBJPROP_YDISTANCE, 35);
   ObjectCreate("high4", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("high4", DoubleToStr(l_ima_132, Digits), 12, "Arial Bold", Coral);
   ObjectSet("high4", OBJPROP_CORNER, 0);
   ObjectSet("high4", OBJPROP_XDISTANCE, 830);
   ObjectSet("high4", OBJPROP_YDISTANCE, 35);
   ObjectCreate("low4", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("low4", "T/Day", 9, "Arial ", LightSteelBlue);
   ObjectSet("low4", OBJPROP_CORNER, 0);
   ObjectSet("low4", OBJPROP_XDISTANCE, 790);
   ObjectSet("low4", OBJPROP_YDISTANCE, 20);
   ObjectCreate("low5", OBJ_LABEL, WindowFind("FDM ADR"), 0, 0);
   ObjectSetText("low5", "Price", 9, "Arial ", LightSteelBlue);
   ObjectSet("low5", OBJPROP_CORNER, 0);
   ObjectSet("low5", OBJPROP_XDISTANCE, 790);
   ObjectSet("low5", OBJPROP_YDISTANCE, 37);
   return (0);
}