for(int xx=ST2;xx>=ST1;xx--)
{
double INDyK1=Equity_4I_Pairs(Symbol1,Symbol2,Symbol3,Symbol4,ST2,TF
(xx),LOT111,LOT222,LOT333,LOT444);
//Alert("=== ИНДЮК № "+(string)(ST2-xx)+" === "+(string)INDyK1);
if(INDyK1>MaXIMUM1[variant][w]) { MaXIMUM1[variant][w]=INDyK1; }
if(INDyK1<MiNIMUM1[variant][w]) { MiNIMUM1[variant][w]=INDyK1; }
if(INDyK1>SUM_EQWY*(ST2-xx)*TREND)
{
TREND_UP_1++;
}
if(INDyK1<(-1)*SUM_EQWY*(ST2-xx)*TREND)
{
TREND_DOWN_1++;
}
if(INDyK1<SUM_EQWY*(ST2-xx)*TREND && INDyK1>(-1)*SUM_EQWY*(ST2-xx)*TREND)
{
NO_TREND_1++;
}
if(xx==ST1)
{
RAZNOST1=MaXIMUM1[variant][w]-MiNIMUM1[variant][w];
if(TREND_UP_1>TREND_DOWN_1 && (TREND_UP_1/NO_TREND_1)>=TREND_NAL){TREND_UP=true;}
if(TREND_UP_1<TREND_DOWN_1 && (TREND_DOWN_1/NO_TREND_1)>=TREND_NAL){TREND_DOWN=true;}
}
}
for(int xx=ST2;xx>=ST1;xx--)
{
double INDyK1=Equity_4I_Pairs(Symbol1,Symbol2,Symbol3,Symbol4,ST2,TF,(xx),LOT111,LOT222,LOT333,LOT444);
double MNK_INDyK=INDyK1-(SUM_EQWY*(ST2-xx)*TREND);
SUMMA_MNK_1=SUMMA_MNK_1+(MNK_INDyK*MNK_INDyK);
if(xx==ST1){SUMMA_MNK_1=SUMMA_MNK_1/(ST2-ST1);}
}