6 registered members (AndrewAMD, Ayumi, degenerate_762, 7th_zorro, VoroneTZ, HoopyDerFrood),
1,268
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Walk Forward Analysis Equity Curve
#482740
03/22/21 01:04
03/22/21 01:04
|
Joined: Mar 2021
Posts: 24
antoniorenar
OP
Newbie
|
OP
Newbie
Joined: Mar 2021
Posts: 24
|
Hello,
In the 2 last lines of the code below I've tried to plot the walk forward analysis equity curve. Nevertheless, when I press the "Train" button I only obtain the parameter graphs. And if I then press the "result" button, I still don't get the walk forward equity curve. May anyone help me to solve the problem, please?
#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); //ENTRIES: if( NumOpenLong==0 and priceClose(0)>priceClose(1) ) enterLong(); if( NumOpenShort==0 and priceClose(0)<priceClose(1) ) enterShort(); //EXITS: Stop = stoploss*PIP; TakeProfit = stopprofit*PIP; //PLOT EQUITY CURVE (WALK FORWARD): set(PLOTNOW); plotWFOCycle(Equity,0); }
|
|
|
Re: Walk Forward Analysis Equity Curve
[Re: antoniorenar]
#482777
03/27/21 21:31
03/27/21 21:31
|
Joined: Aug 2020
Posts: 59 London
Neb
Junior Member
|
Junior Member
Joined: Aug 2020
Posts: 59
London
|
I think you made a couple of mistakes probably. First, you need to make series from priceClose().
vars Closes = series(priceClose());
if( NumOpenLong==0 and Closes[0]>Closes[1]) enterLong(); if( NumOpenShort==0 and Closes[0]<Closes[1]) enterShort();
I also commented line:
//plotWFOCycle(Equity,0);
And then, did traing and test and after that Zorro plotted me equity line.
Maybe it helps ?
Neb
Last edited by Neb; 03/27/21 21:36.
|
|
|
Re: Walk Forward Analysis Equity Curve
[Re: Neb]
#482794
03/29/21 23:16
03/29/21 23:16
|
Joined: Mar 2021
Posts: 24
antoniorenar
OP
Newbie
|
OP
Newbie
Joined: Mar 2021
Posts: 24
|
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!
|
|
|
|