Hi Neb,

First of all, I apologize for my delay in replying, as I have been busy. Following your instructions, I have programmed this:

#include <profile.c>

function run()
{
set(LOGFILE);
set(PARAMETERS);

StartDate=2018;
NumYears=1;

BarPeriod = 1440;

//FOR WALK FORWARD ANALYSIS:
NumWFOCycles = 3;
DataSplit = 20;

//PARAMETERS TO BE OPTIMIZED:
int stoploss = optimize(30,10,50,10);
int stopprofit = optimize(60,20,80,10);

vars Closes = series(priceClose());

//ENTRIES:
if( NumOpenLong==0 and Closes[0]>Closes[1] ) enterLong();
if( NumOpenShort==0 and Closes[0]<Closes[1] ) enterShort();

//EXITS:
Stop = stoploss*PIP;
TakeProfit = stopprofit*PIP;

//PLOT EQUITY CURVE (WALK FORWARD):
set(PLOTNOW);
}

When I press the Train button and then Test I obtain an equity curve, but... are you sure it is the walk forward equity curve and not another equity curve with the same parameters in all the periods? How can we know it, Neb?


By the way, it is not necessary to use:

vars Closes = series(priceClose());
if( NumOpenLong==0 and Closes[0]>Closes[1]) enterLong();
if( NumOpenShort==0 and Closes[0]<Closes[1]) enterShort();

This is correct, but it also do the same as:

if( NumOpenLong==0 and priceClose(0)>priceClose(1) ) enterLong();
if( NumOpenShort==0 and priceClose(0)<priceClose(1) ) enterShort();


Thank you very much for your help, Neb!