Hi, here is the code, which is simply the copy of workshop 7 with slight changes:
#include <profile.c>
function run()
{
MaxBars = 4320; //half a year
BarPeriod = 60; // H1
Weekend = 1; // don't merge Friday and Sunday bars
LookBack = 3; // only 3 bars needed
NumWFOCycles = 13;
Capital = 1000;
asset("USD/JPY");
set(RULES+FACTORS+TESTNOW);
if(Train) Hedge = 2; // for training, allow long + short
if(ReTrain) {
UpdateDays = -1;
SelectWFO = -1;
reset(FACTORS); // don't re-train factors
}
//
Margin = 0.5 * OptimalF * Capital * sqrt(1 + ProfitClosed/Capital);
if(adviseLong(PATTERN+2,0,
priceHigh(2),priceLow(2),priceClose(2),
priceHigh(1),priceLow(1),priceClose(1),
priceHigh(1),priceLow(1),priceClose(1),
priceHigh(0),priceLow(0),priceClose(0)) > 50)
reverseLong(1);
if(adviseShort() > 40)
reverseShort(1);
}
If you comment the line with asset(...) and set the pair in list box of console you`ll receive different result.