Sorry, Tomasz, I shouldn't make those mistakes anymore; I'm not that new to it 
My version: 6.93.0
I'm attaching the AFL:
_SECTION_BEGIN("Sistema3");
//TIPO DE SISTEMA
SetBacktestMode(BacktestRegular);
OptimizerSetEngine("cmae");
//OPTIMIZACIONES
//Número de Posiciones
NumPos =Optimize("NumPos",1,1,5,1);
//Valores N (ROC Rápido) y M (ROC Lento)
N=Optimize("N",8,1,12,1);
M=Optimize("M",10,1,12,1);
//Ponderaciones ROC Rápido, ROC Lento y Volatilidad
Pond_R=Optimize("Pond_R",0.4,0.1,1,0.1);
Pond_L=Optimize("Pond_L",0.2,0.1,1,0.1);
Pond_J=Optimize("Pond_J",0.4,0.1,1,0.1);
//Periodo para Volatilidad
J=Optimize("J",14,1,50,1);
//Corte
Corte=Optimize("Corte",0,0,100,10);
// Condición de exclusión (combinaciones inválidas)
epsilon=0.0001;
Exclude = (N > M) OR abs((Pond_R + Pond_L + Pond_J) - 1) > epsilon;
//SETTINGS
SetOption("InitialEquity", 1000000 );
SetOption ("MaxOpenPositions", NumPos);
SetOption ("AllowPositionShrinking", True);
SetOption("CommissionMode", 2);
SetOption( "CommissionAmount", 0.5 );
SetOption("MinShares",1);
SetOption( "AllowSameBarExit", True );
SetOption( "ReverseSignalForcesExit", True );
SetTradeDelays(1,1,1,1);
RoundLotSize = 1;
SetPositionSize (100/NumPos, spsPercentOfEquity);
Buy = Sell = Short=Cover=0;
BuyPrice = Open;
SellPrice = Open;
IAOK = IANOK =0;
//CÁLCULO INDICADORES
ROC_rapido = ROC (C,N);
ROC_lento = ROC (C,M);
F1 = ROC_rapido + ROC_lento;
ATRvol = ATR (J);
F2 = ATRvol/MA(C,J);
InerciaAlcista = F1/F2;
//REGLAS DEL SISTEMA
//Entrada
IAOK = InerciaAlcista>Corte;
Buysetup = IAOK;
Buy = Buysetup;
//Salida
IANOK = InerciaAlcista<=Corte;
Sellsetup = IANOK;
Sell = Sellsetup;
//Para Desempate
PositionScore = IIf(Buy ==1, InerciaAlcista, -InerciaAlcista);
//Eliminar Señales Repetidas
Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell, Buy);
_SECTION_END();
As I indicated at the beginning, when running the optimization on this code, on one side it says Running and on the other it says 100% complete, remaining 0 sec.
I'm also aware that OptimizerSetEngine("cmae") doesn't take the Exclude function into account, but I don't know how to do it to avoid the combinations I don't want.