//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+

#property indicator_chart_window

int TFs[10]={ 0, 1, 5, 15, 30, 60, 240, 1440, 10080, 43200 };
string TFns[10]={ "", "M1  ", "M5  ", "M15 ", "M30 ", "H1  ", "H4  ", "D1  ", "W1  ", "MN  " };
int dgt=1; int dgt2=0;

string curr[8]={"USD", "EUR", "GBP", "CHF", "JPY", "AUD", "CAD", "NZD" };  // CCFp
string curr2[8]={"USD", "EUR", "GBP", "CHF", "JPY", "CAD", "AUD", "NZD"};  // ForexCurrencyIndex
//string curr2[8]={"EUR", "GBP", "AUD", "CHF", "JPY", "NZD", "CAD", "USD" };  // FXCORRELATOR_BASIC_FREE
string curr3[10]={"EUR", "USD", "GBP", "JPY" };  // 

string tpairs[29] = {"",
"EURUSD", "GBPUSD", "USDJPY", "USDCHF", "USDCAD", "AUDUSD", "NZDUSD", "GBPCHF", "GBPJPY", "EURAUD",
"EURCHF", "EURJPY", "EURGBP", "EURCAD", "CHFJPY", "AUDNZD", "AUDJPY", "CADJPY", "EURNZD", "GBPNZD",
"CADCHF", "AUDCAD", "GBPAUD", "GBPCAD", "AUDCHF", "NZDCAD", "NZDCHF", "NZDJPY" };

int spairs[29];
double spairs_sum[29];
int spairs_dst[29];
string s2pairs[29];

double cs[10][10];
double ct[8], ct2[8];
double cti[2][8];
double csum[8];

string ap, comm;
int tfc, chart_tfnr;
datetime currentbar=0;

int gi_136 = 20;
int gi_144 = 1;
int gia_192[7] = {5, 15, 30, 60, 240, 1440, 10080};
string gsa_196[28];
string gsa_200[7] = {"M5", "M15", "M30", "H", "H4", "D", "W1"};
string gsa_204[8] = {"USD", "EUR", "GBP", "CHF", "JPY", "CAD", "AUD", "NZD"};
string gsa_208[28] = {"EURUSD", "GBPUSD", "USDCHF", "USDJPY", "USDCAD", "AUDUSD", "NZDUSD", "EURGBP", "EURCHF", "EURJPY", "EURCAD", "EURAUD", "EURNZD", "GBPCHF", "GBPJPY", "GBPCAD", "GBPAUD", "GBPNZD", "CHFJPY", "CADCHF", "AUDCHF", "NZDCHF", "CADJPY", "AUDJPY", "NZDJPY", "AUDCAD", "NZDCAD", "AUDNZD"};
int gia_212[56] = {1, 0, 2, 0, 0, 3, 0, 4, 0, 5, 6, 0, 7, 0, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 3, 4, 5, 3, 6, 3, 7, 3, 5, 4, 6, 4, 7, 4, 6, 5, 7, 5, 6, 7};
double gda_216[8][7];
double gda_220[8][7];
double gda_224[8][7];
int gia_228[5][5];
int gi_232 = 0;
int j, i, n, t;


//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
{
   if ((Digits==3) || (Digits==5)) { dgt=10; dgt2=1; }

   ap=Symbol();
   tfc=Period();
   chart_tfnr=tf2nr(Period());
   ArrayInitialize(spairs,0);
   ArrayInitialize(spairs_sum,0);
   for (int i=1;i<34;i++) { s2pairs[i]=""; gsa_196[i]=gsa_208[i]; }

   return(0);
}

//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+

int deinit()
{
   return(0);
}

int tf2nr(int tfc)
{
   switch(tfc) {
      case 1: return(1);
      case 5: return(2);
      case 15: return(3);
      case 30: return(4);
      case 60: return(5);
      case 240: return(6);
      case 1440: return(7);
      case 10080: return(8);
      case 43200: return(9);
   }
   return(0);
}

int getcurrnr(string cr)
{
   for (int np=0;np<8;np++)
   {
      if (cr==curr2[np]) { return(np); }
   }
   return(0);
}

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
{
   if (currentbar!=iTime(Symbol(),Period(),0))
   {

      ArrayCopy(gda_220, gda_216, 0, 0, WHOLE_ARRAY);
      ArrayInitialize(gda_216, 0);
      ArrayInitialize(gda_224, 0);

/*
      for (i = 0; i <= 6; i++) 
         for (j = 0; j <= 27; j++) 
            SetCurrencyValue(gsa_196[j], gia_192[i], i);

      for (i = 0; i <= 6; i++) 
         for (j = 0; j <= 27; j++) 
            SetCurrencyValuePrev(gsa_196[j], gia_192[i], i);

      for (int t = 0; t < 7; t++) 
      {
         Print("CV : " + gda_216[0][t] + "," + gda_216[1][t] + "," + gda_216[2][t] + "," + gda_216[3][t] + "," 
            + gda_216[4][t] + "," + gda_216[5][t] + "," + gda_216[6][t] + "," + gda_216[7][t]);
         Print("CV_PREV : " + gda_224[0][t] + "," + gda_224[1][t] + "," + gda_224[2][t] + "," + gda_224[3][t] + ","
            + gda_224[4][t] + "," + gda_224[5][t] + "," + gda_224[6][t] + "," + gda_224[7][t]);

      }
*/

      ArrayInitialize(spairs,0);
      ArrayInitialize(spairs_sum,0);
      ArrayInitialize(spairs_dst,0);

      currentbar=iTime(Symbol(),Period(),0);
      ArrayInitialize(cs,0);
      ArrayInitialize(csum,0);
      comm="\n\n";
      for(int i=2;i<9;i++)
      {
         ArrayInitialize(ct,0);
         ArrayInitialize(ct2,0);
         ArrayInitialize(cti,0);

         for (j = 0; j <= 27; j++) 
            SetCurrencyValue(gsa_196[j], gia_192[i-2], i-2);

         for (int k = 0; k < 8; k++) 
         {
            double cc1=gda_216[k][i-2];
            cs[i][k]=cc1;
            ct[k]=cc1; ct2[k]=cc1;
            cs[i][k]=cc1;
            //Print("TF: ", TFns[i], " k: ", k, " cc: ", DoubleToStr(cc1,10), " curr: ", curr2[k]);
         }

/*
         for(int j=0;j<8;j++)
         {
            //double cc=iCustom(Symbol(), TFs[i], "CCFp_v1.0.2b_gy", 3, 6, 3, 5, j, 0);
            double cc=iCustom(Symbol(), TFs[i], "FXCORRELATOR_BASIC_FREE_VERSION", 20, 1, j, 0);
            cs[i][j]=cc;
            ct[j]=cc; ct2[j]=cc;
            //cti[1][j]=cc;
            //cti[2][j]=j;
            //Print("TF: ", TFns[i], " j: ", j, " cc: ", DoubleToStr(cc,10), " curr: ", curr2[j]);
         }
*/

         string line1=TFns[i]+": ";
         string cv1="";
         string cp1="", cp2="";
         string c1="";
         for(int n=0;n<8;n++)
         {
            t=ArrayMaximum(ct);
            //line1=line1+curr[t]+" | ";
            //line1=line1+curr2[t]+" ("+DoubleToStr(ct[t],6)+") | ";
            line1=line1+curr2[t];
            cv1=cv1+curr2[t]+"|";
            if (ct[t]>=4) { line1=line1+" (+)"; }
            if (ct[t]<=-4) { line1=line1+" (-)"; }
            line1=line1+" | ";
            c1=curr2[t];
            for(int r=1;r<29;r++)
            {
               cp1=StringSubstr(tpairs[r],0,3);
               cp2=StringSubstr(tpairs[r],3,3);

               int cp1n=getcurrnr(cp1);
               int cp2n=getcurrnr(cp2);
               //Print("1: ", cp1, " nr: ", cp1n, " s: ", DoubleToStr(ct2[cp1n],10), " 2: ", cp2, " nr: ", cp2n, " s: ",DoubleToStr(ct2[cp2n],10) );
               spairs_sum[r]=spairs_sum[r]+(ct2[cp1n]-ct2[cp2n]);

               if (cp1==c1)
               {
                  if(StringFind(cv1,cp2)==-1) { spairs[r]++; }
               }
            }
            double w1=(n+1)*((1+((8-n+1)/10))*(1+(i/10)));
            csum[t]=csum[t]+(n+1)*w1;
            //Print("n: ", n, " max: ", t, " line1: ", line1);
            ct[t]=-100000;
         }
         comm=comm+line1+"\n";
      }

      line1="";
      for(n=0;n<8;n++)
      {
         t=ArrayMaximum(csum);
         //line1=line1+curr2[t]+" | ";
         line1=curr2[t]+" | "+line1;
         //Print("n: ", n, " max: ", t, " line1: ", line1);
         csum[t]=-100000;
      }
      line1="\n\n------------- SUM TF:\n"+line1;

      comm=comm+line1+"\n";

      line1="\n\n------------- PAIRS:\n";
      spairs_sum[0]=-100000;
      for(n=1;n<29;n++)
      {
         t=ArrayMaximum(spairs_sum);
         //line1=line1+tpairs[n]+": "+DoubleToStr(spairs[n],0)+" \n";
         line1=line1+tpairs[t]+": "+DoubleToStr(spairs[n],0)+"      ("+DoubleToStr(spairs_sum[t],4)+")\n";
         spairs_sum[t]=-100000;
      }

      comm=comm+line1+"\n";

      Comment(comm);
      Print(comm);
   }

   return(0);
}

//+------------------------------------------------------------------+

void SetCurrencyValue(string ap, int tfc, int tfnr) {
   ArrayInitialize(gia_228, 0);
   int l40 = 0;
   int l44 = 0;
   int l48 = 0;
   int l52 = 0;
   int l56 = 0;
   int l60 = 0;
   int l64 = 0;
   int l68 = 0;
   int l72 = 0;
   int l76 = 0;
   int l80 = 0;
   int l84 = 0;
   int l88 = 0;
   int l92 = 0;
   int l96 = 0;
   int l100 = 0;
   int l104 = 0;
   int l108 = 0;
   int l112 = 0;
   int l116 = 0;
   int l120 = 0;
   int l124 = 0;
   double ld_128 = 0;
   double ld_136 = 0;
   for (int sh = gi_136; sh >= 1; sh--) {
      if (iMA(ap, tfc, 50, 0, MODE_SMA, PRICE_CLOSE, sh) > iMA(ap, tfc, 100, 0, MODE_SMA, PRICE_CLOSE, sh)) l40++;
      if (iMA(ap, tfc, 50, 0, MODE_SMA, PRICE_CLOSE, sh) < iMA(ap, tfc, 100, 0, MODE_SMA, PRICE_CLOSE, sh)) l84++;
      if (iMA(ap, tfc, 30, 0, MODE_SMA, PRICE_CLOSE, sh) > iMA(ap, tfc, 50, 0, MODE_SMA, PRICE_CLOSE, sh)) l44++;
      if (iMA(ap, tfc, 30, 0, MODE_SMA, PRICE_CLOSE, sh) < iMA(ap, tfc, 50, 0, MODE_SMA, PRICE_CLOSE, sh)) l88++;
      if (iMA(ap, tfc, 10, 0, MODE_EMA, PRICE_CLOSE, sh) > iMA(ap, tfc, 30, 0, MODE_SMA, PRICE_CLOSE, sh)) l48++;
      if (iMA(ap, tfc, 10, 0, MODE_EMA, PRICE_CLOSE, sh) < iMA(ap, tfc, 30, 0, MODE_SMA, PRICE_CLOSE, sh)) l92++;
      if (iLow(ap, tfc, sh) > iMA(ap, tfc, 100, 0, MODE_SMA, PRICE_CLOSE, sh)) l52++;
      if (iHigh(ap, tfc, sh) < iMA(ap, tfc, 100, 0, MODE_SMA, PRICE_CLOSE, sh)) l96++;
      if (iClose(ap, tfc, sh) > iMA(ap, tfc, 50, 0, MODE_SMA, PRICE_CLOSE, sh)) l56++;
      if (iClose(ap, tfc, sh) < iMA(ap, tfc, 50, 0, MODE_SMA, PRICE_CLOSE, sh)) l100++;
      if (iClose(ap, tfc, sh) > iMA(ap, tfc, 30, 0, MODE_SMA, PRICE_CLOSE, sh)) l60++;
      if (iClose(ap, tfc, sh) < iMA(ap, tfc, 30, 0, MODE_SMA, PRICE_CLOSE, sh)) l104++;
      if (iMA(ap, tfc, 50, 0, MODE_SMA, PRICE_CLOSE, sh - 1) > iMA(ap, tfc, 50, 0, MODE_SMA, PRICE_CLOSE, sh)) l64++;
      if (iMA(ap, tfc, 50, 0, MODE_SMA, PRICE_CLOSE, sh - 1) < iMA(ap, tfc, 50, 0, MODE_SMA, PRICE_CLOSE, sh)) l108++;
      if (iMA(ap, tfc, 30, 0, MODE_SMA, PRICE_CLOSE, sh - 5) > iMA(ap, tfc, 30, 0, MODE_SMA, PRICE_CLOSE, sh)) l68++;
      if (iMA(ap, tfc, 30, 0, MODE_SMA, PRICE_CLOSE, sh - 5) < iMA(ap, tfc, 30, 0, MODE_SMA, PRICE_CLOSE, sh)) l112++;
   }
   if (iAO(ap, tfc, 0) > 0.0) l72++;
   if (iAO(ap, tfc, 0) < 0.0) l116++;
   if (iSAR(ap, tfc, 0.01, 0.1, 0) > iHigh(ap, tfc, 0)) l120++;
   if (iSAR(ap, tfc, 0.01, 0.1, 0) < iLow(ap, tfc, 0)) l76++;
   if (iADX(ap, tfc, 14, PRICE_CLOSE, MODE_PLUSDI, 0) > iADX(ap, tfc, 14, PRICE_CLOSE, MODE_MINUSDI, 0)) l80++;
   if (iADX(ap, tfc, 14, PRICE_CLOSE, MODE_PLUSDI, 0) < iADX(ap, tfc, 14, PRICE_CLOSE, MODE_MINUSDI, 0)) l124++;
   if (l40 == gi_136) { ld_128 += 0.12987; ld_136 -= 0.12987; }
   if (l84 == gi_136) { ld_128 -= 0.12987; ld_136 += 0.12987; }
   if (l44 == gi_136) { ld_128 += 0.12987; ld_136 -= 0.12987; }
   if (l88 == gi_136) {  ld_128 -= 0.12987;  ld_136 += 0.12987; }
   if (l48 == gi_136) { ld_128 += 0.12987; ld_136 -= 0.12987; }
   if (l92 == gi_136) { ld_128 -= 0.12987; ld_136 += 0.12987; }
   if (l52 == gi_136) { ld_128 += 0.12987; ld_136 -= 0.12987; }
   if (l96 == gi_136) { ld_128 -= 0.12987; ld_136 += 0.12987; }
   if (l56 == gi_136) { ld_128 += 0.12987; ld_136 -= 0.12987; }
   if (l100 == gi_136) { ld_128 -= 0.12987; ld_136 += 0.12987; }
   if (l60 == gi_136) { ld_128 += 0.12987; ld_136 -= 0.12987; }
   if (l104 == gi_136) { ld_128 -= 0.12987; ld_136 += 0.12987; }
   if (l64 == gi_136) { ld_128 += 0.12987; ld_136 -= 0.12987; }
   if (l108 == gi_136) { ld_128 -= 0.12987; ld_136 += 0.12987; }
   if (l68 == gi_136) { ld_128 += 0.12987; ld_136 -= 0.12987; }
   if (l116 == gi_136) { ld_128 -= 0.12987; ld_136 += 0.12987; }
   if (l72 == 1) { ld_128 += 0.12987; ld_136 -= 0.12987; }
   if (l116 == 1) { ld_128 -= 0.12987; ld_136 += 0.12987; }
   if (l76 == 1) { ld_128 += 0.12987; ld_136 -= 0.12987; }
   if (l120 == 1) { ld_128 -= 0.12987; ld_136 += 0.12987; }
   if (l80 == 1) { ld_128 += 0.12987; ld_136 -= 0.12987; }
   if (l124 == 1) { ld_128 -= 0.12987; ld_136 += 0.12987; }
   for (int l_index_144 = 0; l_index_144 <= 27; l_index_144++)
      if (gsa_196[l_index_144] == ap) break;
   int li_32 = 2 * l_index_144;
   int li_36 = l_index_144 << 1 + 1;
   int li_20 = gia_212[li_32];
   int li_24 = gia_212[li_36];
   gda_216[li_20][tfnr] += ld_128;
   gda_216[li_24][tfnr] += ld_136;
}

void SetCurrencyValuePrev(string ap, int tfc, int tfnr) {
   ArrayInitialize(gia_228, 0);
   int l40 = 0;
   int l44 = 0;
   int l48 = 0;
   int l52 = 0;
   int l56 = 0;
   int l60 = 0;
   int l64 = 0;
   int l68 = 0;
   int l72 = 0;
   int l76 = 0;
   int l80 = 0;
   int l84 = 0;
   int l88 = 0;
   int l92 = 0;
   int l96 = 0;
   int l100 = 0;
   int l104 = 0;
   int l108 = 0;
   int l112 = 0;
   int l116 = 0;
   int l120 = 0;
   int l124 = 0;
   double ld_128 = 0;
   double ld_136 = 0;
   for (int sh = gi_136; sh >= 1; sh--) {
      if (iMA(ap, tfc, 50, 0, MODE_SMA, PRICE_CLOSE, sh + gi_144) > iMA(ap, tfc, 100, 0, MODE_SMA, PRICE_CLOSE, sh + gi_144)) l40++;
      if (iMA(ap, tfc, 50, 0, MODE_SMA, PRICE_CLOSE, sh) < iMA(ap, tfc, 100, 0, MODE_SMA, PRICE_CLOSE, sh)) l84++;
      if (iMA(ap, tfc, 30, 0, MODE_SMA, PRICE_CLOSE, sh + gi_144) > iMA(ap, tfc, 50, 0, MODE_SMA, PRICE_CLOSE, sh + gi_144)) l44++;
      if (iMA(ap, tfc, 30, 0, MODE_SMA, PRICE_CLOSE, sh) < iMA(ap, tfc, 50, 0, MODE_SMA, PRICE_CLOSE, sh)) l88++;
      if (iMA(ap, tfc, 10, 0, MODE_EMA, PRICE_CLOSE, sh + gi_144) > iMA(ap, tfc, 30, 0, MODE_SMA, PRICE_CLOSE, sh + gi_144)) l48++;
      if (iMA(ap, tfc, 10, 0, MODE_EMA, PRICE_CLOSE, sh + gi_144) < iMA(ap, tfc, 30, 0, MODE_SMA, PRICE_CLOSE, sh + gi_144)) l92++;
      if (iLow(ap, tfc, sh + gi_144) > iMA(ap, tfc, 100, 0, MODE_SMA, PRICE_CLOSE, sh + gi_144)) l52++;
      if (iHigh(ap, tfc, sh + gi_144) < iMA(ap, tfc, 100, 0, MODE_SMA, PRICE_CLOSE, sh + gi_144)) l96++;
      if (iClose(ap, tfc, sh + gi_144) > iMA(ap, tfc, 50, 0, MODE_SMA, PRICE_CLOSE, sh + gi_144)) l56++;
      if (iClose(ap, tfc, sh + gi_144) < iMA(ap, tfc, 50, 0, MODE_SMA, PRICE_CLOSE, sh + gi_144)) l100++;
      if (iClose(ap, tfc, sh + gi_144) > iMA(ap, tfc, 30, 0, MODE_SMA, PRICE_CLOSE, sh + gi_144)) l60++;
      if (iClose(ap, tfc, sh + gi_144) < iMA(ap, tfc, 30, 0, MODE_SMA, PRICE_CLOSE, sh + gi_144)) l104++;
      if (iMA(ap, tfc, 50, 0, MODE_SMA, PRICE_CLOSE, sh - (gi_144 + 5)) > iMA(ap, tfc, 50, 0, MODE_SMA, PRICE_CLOSE, sh + gi_144)) l64++;
      if (iMA(ap, tfc, 50, 0, MODE_SMA, PRICE_CLOSE, sh - (gi_144 + 5)) < iMA(ap, tfc, 50, 0, MODE_SMA, PRICE_CLOSE, sh + gi_144)) l108++;
      if (iMA(ap, tfc, 30, 0, MODE_SMA, PRICE_CLOSE, sh - (gi_144 + 5)) > iMA(ap, tfc, 30, 0, MODE_SMA, PRICE_CLOSE, sh + gi_144)) l68++;
      if (iMA(ap, tfc, 30, 0, MODE_SMA, PRICE_CLOSE, sh - (gi_144 + 5)) < iMA(ap, tfc, 30, 0, MODE_SMA, PRICE_CLOSE, sh + gi_144)) l112++;
   }
   if (iAO(ap, tfc, gi_144 + 0) > 0.0) l72++;
   if (iAO(ap, tfc, gi_144 + 0) < 0.0) l116++;
   if (iSAR(ap, tfc, 0.01, 0.1, gi_144 + 0) > iHigh(ap, tfc, gi_144 + 0)) l120++;
   if (iSAR(ap, tfc, 0.01, 0.1, gi_144 + 0) < iLow(ap, tfc, gi_144 + 0)) l76++;
   if (iADX(ap, tfc, 14, PRICE_CLOSE, MODE_PLUSDI, gi_144 + 0) > iADX(ap, tfc, 14, PRICE_CLOSE, MODE_MINUSDI, gi_144 + 0)) l80++;
   if (iADX(ap, tfc, 14, PRICE_CLOSE, MODE_PLUSDI, gi_144 + 0) < iADX(ap, tfc, 14, PRICE_CLOSE, MODE_MINUSDI, gi_144 + 0)) l124++;
   if (l40 == gi_136) { ld_128 += 0.12987; ld_136 -= 0.12987;   }
   if (l84 == gi_136) { ld_128 -= 0.12987; ld_136 += 0.12987;   }
   if (l44 == gi_136) { ld_128 += 0.12987; ld_136 -= 0.12987;   }
   if (l88 == gi_136) { ld_128 -= 0.12987; ld_136 += 0.12987;   }
   if (l48 == gi_136) { ld_128 += 0.12987; ld_136 -= 0.12987;   }
   if (l92 == gi_136) { ld_128 -= 0.12987; ld_136 += 0.12987;   }
   if (l52 == gi_136) { ld_128 += 0.12987; ld_136 -= 0.12987;   }
   if (l96 == gi_136) { ld_128 -= 0.12987; ld_136 += 0.12987;   }
   if (l56 == gi_136) { ld_128 += 0.12987; ld_136 -= 0.12987;   }
   if (l100 == gi_136) { ld_128 -= 0.12987; ld_136 += 0.12987;   }
   if (l60 == gi_136) { ld_128 += 0.12987; ld_136 -= 0.12987;   }
   if (l104 == gi_136) { ld_128 -= 0.12987; ld_136 += 0.12987;   }
   if (l64 == gi_136) { ld_128 += 0.12987; ld_136 -= 0.12987;   }
   if (l108 == gi_136) { ld_128 -= 0.12987; ld_136 += 0.12987;   }
   if (l68 == gi_136) { ld_128 += 0.12987; ld_136 -= 0.12987;   }
   if (l112 == gi_136) { ld_128 -= 0.12987; ld_136 += 0.12987;   }
   if (l72 == 1) { ld_128 += 0.12987; ld_136 -= 0.12987;   }
   if (l116 == 1) { ld_128 -= 0.12987; ld_136 += 0.12987;   }
   if (l76 == 1) { ld_128 += 0.12987; ld_136 -= 0.12987;   }
   if (l120 == 1) { ld_128 -= 0.12987; ld_136 += 0.12987;   }
   if (l80 == 1) { ld_128 += 0.12987; ld_136 -= 0.12987;   }
   if (l124 == 1) { ld_128 -= 0.12987; ld_136 += 0.12987;   }
   for (int l_index_144 = 0; l_index_144 <= 27; l_index_144++)
      if (gsa_196[l_index_144] == ap) break;
   int li_32 = 2 * l_index_144;
   int li_36 = l_index_144 << 1 + 1;
   int li_20 = gia_212[li_32];
   int li_24 = gia_212[li_36];
   gda_224[li_20][tfnr] += ld_128;
   gda_224[li_24][tfnr] += ld_136;
}