
#property indicator_chart_window

int gi_76 = 25;
int gi_80 = 13;
int gi_84 = 10;
int gi_88 = 10;
int g_fontsize_92 = 8;
int gia_96[] = {1, 5, 15, 30, 60, 240};
int gia_100[] = {14, 14, 6, 6, 6, 6};
int gia_104[] = {50, 34, 14, 14, 14, 14};
string gsa_108[] = {"1m", "5m", "15m", "30m", "1h", "4h"};
string gsa_112[] = {"STOCH", "RSI", "CCI", "MACD", "EMA1", "EMA2"};
extern string Corner_Settings = "=== 0 bis 3 für jeweilige Ecke ===";
extern int Corner = 1;
extern string Stochastic_Settings = "=== Stochastic Einstellungen ===";
extern int PercentK = 8;
extern int PercentD = 3;
extern int Slowing = 3;
extern string RSI_Settings = "=== RSI Einstellungen ===";
extern int RSIP1 = 14;
extern int RSIP2 = 70;
extern string MACD_Settings = "=== MACD Einstellungen ===";
extern int FastEMA = 12;
extern int SlowEMA = 24;
extern int MACDsp = 6;
extern string EMA_Settings = "=== MA Einstellungen ===";
extern int shortP1 = 5;
extern int shortP2 = 8;
extern int longP1 = 26;
extern int longP2 = 52;
extern string My_Symbols = "=== Wingdings Symbole ===";
extern int sBuy = 233;
extern int sSell = 234;
extern int sWait = 54;
extern int sCCIAgainstBuy = 238;
extern int sCCIAgainstSell = 236;

int init() {
   IndicatorShortName("iPanel");
   return (0);
}

int deinit() {
   ObjectsDeleteAll(0, OBJ_LABEL);
   for (int l_count_0 = 0; l_count_0 < 6; l_count_0++) for (int l_count_4 = 0; l_count_4 < 6; l_count_4++) ObjectDelete("tPs" + l_count_0 + l_count_4);
   for (l_count_4 = 0; l_count_4 < 6; l_count_4++) ObjectDelete("tInd" + l_count_4);
   for (l_count_0 = 0; l_count_0 < 6; l_count_0++) for (l_count_4 = 0; l_count_4 < 6; l_count_4++) ObjectDelete("dI" + l_count_0 + l_count_4);
   for (l_count_0 = 0; l_count_0 < 6; l_count_0++) for (l_count_4 = 0; l_count_4 < 6; l_count_4++) ObjectDelete("tI" + l_count_0 + l_count_4);
   return (0);
}

int start() {
   ObjectCreate("Indicators", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("Indicators", "iPanel_INDICATORS", 8, "Arial Bold", White);
   ObjectSet("Indicators", OBJPROP_CORNER, Corner);
   ObjectSet("Indicators", OBJPROP_XDISTANCE, 5);
   ObjectSet("Indicators", OBJPROP_YDISTANCE, 5);
   for (int l_index_0 = 0; l_index_0 < 6; l_index_0++) {
      ObjectCreate("tper" + l_index_0, OBJ_LABEL, 0, 0, 0);
      ObjectSetText("tper" + l_index_0, gsa_108[l_index_0], g_fontsize_92, "Arial Bold", White);
      ObjectSet("tper" + l_index_0, OBJPROP_CORNER, Corner);
      ObjectSet("tper" + l_index_0, OBJPROP_XDISTANCE, l_index_0 * gi_76 + 45);
      ObjectSet("tper" + l_index_0, OBJPROP_YDISTANCE, gi_88 + 6);
   }
   for (int l_index_4 = 0; l_index_4 < 6; l_index_4++) {
      for (int l_index_8 = 0; l_index_8 < 6; l_index_8++) {
         ObjectSet("tPs" + l_index_4 + l_index_8, OBJPROP_CORNER, Corner);
         ObjectSet("tPs" + l_index_4 + l_index_8, OBJPROP_XDISTANCE, l_index_4 * gi_76 + gi_84);
         ObjectSet("tPs" + l_index_4 + l_index_8, OBJPROP_YDISTANCE, l_index_8 * gi_80 + gi_88 + 6);
      }
   }
   for (l_index_8 = 0; l_index_8 < 6; l_index_8++) {
      ObjectCreate("tInd" + l_index_8, OBJ_LABEL, 0, 0, 0);
      ObjectSetText("tInd" + l_index_8, gsa_112[l_index_8], g_fontsize_92, "Arial Bold", White);
      ObjectSet("tInd" + l_index_8, OBJPROP_CORNER, Corner);
      ObjectSet("tInd" + l_index_8, OBJPROP_XDISTANCE, gi_84 - 5);
      ObjectSet("tInd" + l_index_8, OBJPROP_YDISTANCE, l_index_8 * gi_80 + 27);
   }
   for (l_index_4 = 0; l_index_4 < 6; l_index_4++) {
      for (l_index_8 = 0; l_index_8 < 6; l_index_8++) {
         ObjectCreate("dI" + l_index_4 + l_index_8, OBJ_LABEL, 0, 0, 0);
         ObjectSetText("dI" + l_index_4 + l_index_8, " ", 10, "Wingdings", Goldenrod);
         ObjectSet("dI" + l_index_4 + l_index_8, OBJPROP_CORNER, Corner);
         ObjectSet("dI" + l_index_4 + l_index_8, OBJPROP_XDISTANCE, l_index_4 * gi_76 + (gi_84 + 35));
         ObjectSet("dI" + l_index_4 + l_index_8, OBJPROP_YDISTANCE, l_index_8 * gi_80 + 27);
      }
   }
   for (l_index_4 = 0; l_index_4 < 6; l_index_4++) {
      for (l_index_8 = 0; l_index_8 < 6; l_index_8++) {
         ObjectCreate("tI" + l_index_4 + l_index_8, OBJ_LABEL, 0, 0, 0);
         ObjectSetText("tI" + l_index_4 + l_index_8, "    ", 9, "Arial Bold", Goldenrod);
         ObjectSet("tI" + l_index_4 + l_index_8, OBJPROP_CORNER, Corner);
         ObjectSet("tI" + l_index_4 + l_index_8, OBJPROP_XDISTANCE, l_index_4 * gi_76 + (gi_84 + 15));
         ObjectSet("tI" + l_index_4 + l_index_8, OBJPROP_YDISTANCE, l_index_8 * gi_80 + gi_88);
      }
   }
   for (l_index_4 = 0; l_index_4 < 6; l_index_4++) {
      if (iStochastic(NULL, gia_96[l_index_4], PercentK, PercentD, Slowing, MODE_SMA, 0, MODE_MAIN, 0) > iStochastic(NULL, gia_96[l_index_4], PercentK, PercentD, Slowing, MODE_SMA, 0, MODE_SIGNAL, 0)) ObjectSetText("dI" + l_index_4 + "0", CharToStr(sBuy), g_fontsize_92, "Wingdings", Lime);
      else {
         if (iStochastic(NULL, gia_96[l_index_4], PercentK, PercentD, Slowing, MODE_SMA, 0, MODE_SIGNAL, 0) > iStochastic(NULL, gia_96[l_index_4], PercentK, PercentD, Slowing, MODE_SMA, 0, MODE_MAIN, 0)) ObjectSetText("dI" + l_index_4 + "0", CharToStr(sSell), g_fontsize_92, "Wingdings", Red);
         else ObjectSetText("dI" + l_index_4 + "0", CharToStr(sWait), 10, "Wingdings", Khaki);
      }
   }
   for (l_index_4 = 0; l_index_4 < 6; l_index_4++) {
      if (iRSI(NULL, gia_96[l_index_4], RSIP1, PRICE_TYPICAL, 0) > iRSI(NULL, gia_96[l_index_4], RSIP2, PRICE_TYPICAL, 0)) ObjectSetText("dI" + l_index_4 + "1", CharToStr(sBuy), g_fontsize_92, "Wingdings", Lime);
      else {
         if (iRSI(NULL, gia_96[l_index_4], RSIP2, PRICE_TYPICAL, 0) > iRSI(NULL, gia_96[l_index_4], RSIP1, PRICE_TYPICAL, 0)) ObjectSetText("dI" + l_index_4 + "1", CharToStr(sSell), g_fontsize_92, "Wingdings", Red);
         else ObjectSetText("dI" + l_index_4 + "1", CharToStr(sWait), g_fontsize_92, "Wingdings", Khaki);
      }
   }
   for (l_index_4 = 0; l_index_4 < 6; l_index_4++) {
      if (iCCI(NULL, gia_96[l_index_4], gia_100[l_index_4], PRICE_TYPICAL, 0) > 0.0) {
         if (iCCI(NULL, gia_96[l_index_4], gia_100[l_index_4], PRICE_TYPICAL, 0) > iCCI(NULL, gia_96[l_index_4], gia_100[l_index_4], PRICE_TYPICAL, 1)) ObjectSetText("dI" + l_index_4 + "2", CharToStr(sBuy), g_fontsize_92, "Wingdings", Lime);
         else ObjectSetText("dI" + l_index_4 + "2", CharToStr(sCCIAgainstBuy), g_fontsize_92, "Wingdings", Red);
      } else {
         if (iCCI(NULL, gia_96[l_index_4], gia_100[l_index_4], PRICE_TYPICAL, 0) < 0.0) {
            if (iCCI(NULL, gia_96[l_index_4], gia_100[l_index_4], PRICE_TYPICAL, 0) < iCCI(NULL, gia_96[l_index_4], gia_100[l_index_4], PRICE_TYPICAL, 1)) ObjectSetText("dI" + l_index_4 + "2", CharToStr(sSell), g_fontsize_92, "Wingdings", Red);
            else ObjectSetText("dI" + l_index_4 + "2", CharToStr(sCCIAgainstSell), g_fontsize_92, "Wingdings", Lime);
         } else ObjectSetText("dI" + l_index_4 + "2", CharToStr(sWait), 10, "Wingdings", Khaki);
      }
   }
   for (l_index_4 = 0; l_index_4 < 6; l_index_4++) {
      if (iMACD(NULL, gia_96[l_index_4], FastEMA, SlowEMA, MACDsp, PRICE_CLOSE, MODE_MAIN, 0) > 0.0) {
         if (iMACD(NULL, gia_96[l_index_4], FastEMA, SlowEMA, MACDsp, PRICE_CLOSE, MODE_MAIN, 0) > iMACD(NULL, gia_96[l_index_4], FastEMA, SlowEMA, MACDsp, PRICE_CLOSE, MODE_SIGNAL, 0)) ObjectSetText("dI" + l_index_4 + "3", CharToStr(sBuy), g_fontsize_92, "Wingdings", Lime);
         else {
            if (iMACD(NULL, gia_96[l_index_4], FastEMA, SlowEMA, MACDsp, PRICE_CLOSE, MODE_MAIN, 0) < iMACD(NULL, gia_96[l_index_4], FastEMA, SlowEMA, MACDsp, PRICE_CLOSE, MODE_SIGNAL, 0)) ObjectSetText("dI" + l_index_4 + "3", CharToStr(sSell), g_fontsize_92, "Wingdings", Red);
            else ObjectSetText("dI" + l_index_4 + "3", CharToStr(sWait), g_fontsize_92, "Wingdings", Khaki);
         }
      } else {
         if (iMACD(NULL, gia_96[l_index_4], FastEMA, SlowEMA, MACDsp, PRICE_CLOSE, MODE_MAIN, 0) < 0.0) {
            if (iMACD(NULL, gia_96[l_index_4], FastEMA, SlowEMA, MACDsp, PRICE_CLOSE, MODE_MAIN, 0) < iMACD(NULL, gia_96[l_index_4], FastEMA, SlowEMA, MACDsp, PRICE_CLOSE, MODE_SIGNAL, 0)) ObjectSetText("dI" + l_index_4 + "3", CharToStr(sSell), g_fontsize_92, "Wingdings", Red);
            else {
               if (iMACD(NULL, gia_96[l_index_4], FastEMA, SlowEMA, MACDsp, PRICE_CLOSE, MODE_MAIN, 0) > iMACD(NULL, gia_96[l_index_4], FastEMA, SlowEMA, MACDsp, PRICE_CLOSE, MODE_SIGNAL, 0)) ObjectSetText("dI" + l_index_4 + "3", CharToStr(sBuy), g_fontsize_92, "Wingdings", Lime);
               else ObjectSetText("dI" + l_index_4 + "3", CharToStr(sWait), g_fontsize_92, "Wingdings", Khaki);
            }
         }
      }
   }
   for (l_index_4 = 0; l_index_4 < 6; l_index_4++) {
      if (iMA(NULL, gia_96[l_index_4], shortP1, 0, MODE_EMA, PRICE_CLOSE, 0) > iMA(NULL, gia_96[l_index_4], shortP2, 0, MODE_EMA, PRICE_CLOSE, 0)) ObjectSetText("dI" + l_index_4 + "4", CharToStr(sBuy), g_fontsize_92, "Wingdings", Lime);
      else {
         if (iMA(NULL, gia_96[l_index_4], shortP1, 0, MODE_EMA, PRICE_CLOSE, 0) < iMA(NULL, gia_96[l_index_4], shortP2, 0, MODE_EMA, PRICE_CLOSE, 0)) ObjectSetText("dI" + l_index_4 + "4", CharToStr(sSell), g_fontsize_92, "Wingdings", Red);
         else ObjectSetText("dI" + l_index_4 + "4", CharToStr(sWait), g_fontsize_92, "Wingdings", Khaki);
      }
   }
   for (l_index_4 = 0; l_index_4 < 6; l_index_4++) {
      if (iMA(NULL, gia_96[l_index_4], longP1, 0, MODE_EMA, PRICE_CLOSE, 0) > iMA(NULL, gia_96[l_index_4], longP2, 0, MODE_EMA, PRICE_CLOSE, 0)) ObjectSetText("dI" + l_index_4 + "5", CharToStr(sBuy), g_fontsize_92, "Wingdings", Lime);
      else {
         if (iMA(NULL, gia_96[l_index_4], longP1, 0, MODE_EMA, PRICE_CLOSE, 0) < iMA(NULL, gia_96[l_index_4], longP2, 0, MODE_EMA, PRICE_CLOSE, 0)) ObjectSetText("dI" + l_index_4 + "5", CharToStr(sSell), g_fontsize_92, "Wingdings", Red);
         else ObjectSetText("dI" + l_index_4 + "5", CharToStr(sWait), g_fontsize_92, "Wingdings", Khaki);
      }
   }
   return (0);
}