My First Walk-Forward

Hello everyone,

It seems I'm making some progress learning this incredible tool, AmiBroker, and I'm finally doing my first Walk-Forward. I've configured it in Easy Mode (EOD) and set the dates shown in the image.

I've also attached the AFL I use, where you can see the 5 variables being optimized.

_SECTION_BEGIN("Sistema3");

//Ajustar Manualmente Parámetros (Periodicidad, Trades...)

//TIPO DE SISTEMA
SetBacktestMode(backtestRotational);

//OPTIMIZACIONES
//Número de Posiciones
NumPos =Optimize("NumPos",2,1,5,1);

//Valores N (ROC Rápido) y M (ROC Lento)
N=Optimize("N",2,1,12,1);
M=Optimize("M",10,1,12,1);
Exclude = (N > M);

//Periodo para Volatilidad
J=Optimize("J",46,1,50,1);

//SETTINGS
SetOption("InitialEquity", 10000000 );
SetOption ("MaxOpenPositions", NumPos);
SetOption ("AllowPositionShrinking", True);
SetOption("CommissionMode", 2);
SetOption( "CommissionAmount", 0.5 ); 
SetOption("MinShares",1);
SetOption( "AllowSameBarExit", True ); 
SetOption( "ReverseSignalForcesExit", True );
RoundLotSize = 1;
SetOption("worstRankheld",NumPos);
SetPositionSize (100/NumPos, spsPercentOfEquity);


//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;

//Usamos Corte para que no pasen IA menores a 0
Corte=0;
Corte = Optimize("Corte",0,0,100,25);

//REGLAS 
Score=IIf(InerciaAlcista<Corte,0, Max (InerciaAlcista,0));
PositionScore=Score;

// EXPLORADOR
/*
Hay que entender algo importante si utilizo Delay (parto de Periodicidad Semanal), cuando el Viernes a Cierre yo pase el Explorador, 
me mostrará la IA de esta semana que ha acabado y cerrado ahora, es decir, la IA que el sistema utilizará para Comprar el Lunes próximo (la próxima semana).
En cambio, si el mismo viernes a cierre de semana pasara el Backtest, me mostrará la IA de la semana anterior, la que usó para comprar esta semana que ha terminado
*/

// Mostrar en el explorador
Filter = 1;

if ( Status( "actionex" ) == actionExplore ) 
{
	SetSortColumns(2, -4);

	Nombre = FullName();
	AddTextColumn ( Nombre, "Nombre", 1.2, IIf(Score>0, colorGreen, colorRed));
	AddColumn(InerciaAlcista, "IAlcista Actual", 1.2);
	InerciaAlcistaBacktest = Ref(InerciaAlcista, -1);// Ajuste para ver lo que usa el backtest (de semana anterior)
	AddColumn(InerciaAlcistaBacktest, "IAlcista Backtest", 1.2);
}

// --- Ordena en Backtest ---
if ( Status( "action" ) == actionBacktest ) SetSortColumns(3);

_SECTION_END();

My Watchlist has 12 tickers for 12 global indices ($SPY, $BVSP, $N225, $NIF, etc.).
My Ami version is the Professional Edition 64-bit, 6.93.0.

My question is about the speed at which this walk-forward is being performed and the CPU usage. I've attached an image of the Task Manager where you can see the data needed to answer.

Is it normal for it to only use 17-19% of the CPU and tell me it's going to take 18 hours? Why isn't my CPU being used at 100%?
Screenshot_132

My database is from NorgateData, in case that's the bottleneck.

I've read several threads on this topic, but I don't quite understand how I can improve it in any way.

Thank you very much.

1 Like

Thanks Dr. Tomasz,
I've read that thread and others, but I don't understand much of it.
I still don't know if 18% CPU usage is normal or if I can improve it.
I'm sorry for being so ignorant.

In short: it is normal for simple formulas, your formula is not complex enough to fully saturate CPU. It takes more time to access the data (and that is limited by data source, disk, memory, NOT the CPU) than to process due to relative simplicity of the formula.

1 Like