Ok here is a nice improvement (I think). Again... PLEASE poke holes in this, let me know where you think it would not be wise to trade.

I sorted the .fac file by OptimalF value from highest to lowest. Then I picked the top 16 performing pairs (16 seems to be the limit for training before running out of memory).

Quote:
Walk-Forward Test Workshop5_3cream_dusktrader portfolio - performance report

Simulation period 21.05.2010-25.07.2013
Test period 02.04.2012-25.07.2013
WFO test cycles 4 x 527 bars (18 weeks)
Training cycles 5 x 2986 bars (103 weeks)
Lookback time 500 bars (17 weeks)
Assumed slippage 10.0 sec

Gross win/loss 2646$ / -1320$ (+13585p)
Average profit 1011$/year, 84$/month, 3.89$/day
Max drawdown -131$ 10% (MAE -283$ 21%)
Total down time 13% (TAE 94%)
Max down time 18 weeks from Sep 2012
Largest margin 453$
Trade volume 254483$ (194117$/year)
Transaction costs -74$ spr, -7.47$ slp, 28$ rol
Capital required 651$

Number of trades 216 (165/year, 4/week, 1/day)
Percent winning 49%
Max win/loss 178$ / -49$
Avg trade profit 6.14$ 62.9p (+25$ / -12$)
Avg trade slippage -0.03$ -0.4p (+0.03$ / -0.10$)
Avg trade bars 96 (+133 / -60)
Max trade bars 929 (32 weeks)
Time in market 990%
Max open trades 18
Max loss streak 9 (uncorrelated 8)

Annual return 509%
Profit factor 2.00 (PRR 1.65)
Sharpe ratio 1.82
Kelly criterion 2.11
OptimalF .344
Ulcer index 8%
Prediction error 37%

Portfolio analysis OptF ProF Win/Loss Cycles

AUDCAD avg .170 1.23 25/23 /XXX
AUDJPY avg .534 5.26 17/8 /\X/
CHFJPY avg .265 1.93 3/5 \\//
EURAUD avg .111 1.26 10/21 /\X/
EURCHF avg .119 1.15 7/8 \\\/
EURDKK avg .999 3.98 5/3 ./\/
EURGBP avg .502 3.90 3/1 \///
EURJPY avg .293 3.10 6/9 \\//
GBPAUD avg .304 1.54 20/25 \/X/
GBPCHF avg .591 2.15 7/5 .//\
GBPJPY avg .126 1.45 3/2 \//\

AUDCAD:L .196 1.24 14/12 /\/\
AUDCAD:S .144 1.23 11/11 //\/
AUDJPY:L .760 8.67 13/3 .\//
AUDJPY:S .308 3.41 4/5 /\\/
CHFJPY:L .265 1.93 3/5 \\//
CHFJPY:S .000 ---- 0/0 ....
EURAUD:L .094 1.16 5/7 /\//
EURAUD:S .128 1.33 5/14 /\\/
EURCHF:L .170 1.21 4/3 \\\/
EURCHF:S .068 1.09 3/5 .\\/
EURDKK:L .999 3.98 5/3 ./\/
EURDKK:S .000 ---- 0/0 ....
EURGBP:L .502 3.90 3/1 \///
EURGBP:S .000 ---- 0/0 ....
EURJPY:L .293 3.10 6/9 \\//
EURJPY:S .000 ---- 0/0 ....
GBPAUD:L .182 1.34 8/12 \/\/
GBPAUD:S .426 1.75 12/13 \///
GBPCHF:L .668 2.39 5/3 .//\
GBPCHF:S .515 1.71 2/2 .//\
GBPJPY:L .126 1.45 3/2 \//\
GBPJPY:S .000 ---- 0/0 ....


Code:
// Workshop 5: Counter trend trading, optimized ////////////////

function reverseShort(int MaxTrades)
{
	// update the stops and profit targets of open trades
	if(Stop > 0) exitShort(0,priceClose()+Stop);
	if(TakeProfit > 0) exitShort(0,-(priceClose()-TakeProfit));
 
	// if MaxTrades is not reached, open a new trade
	if(NumOpenShort < MaxTrades)
	{
		// reinvest the square root of profits
		//var MarginShort = sqrt(WinShort-LossShort)*OptimalFShort;
		//Margin = clamp(MarginShort, 5, 300); //max $300 per trade
		enterShort();
	}

	// otherwise, close all opposite trades
	else if(!mode(HEDGING)) exitLong();
	return 0;
}

function reverseLong(int MaxTrades)
{
	// update the stops and profit targets of open trades
	if(Stop > 0) exitLong(0,priceClose()-Stop);
	if(TakeProfit > 0) exitLong(0,-(priceClose()+TakeProfit));
 
	// if MaxTrades is not reached, open a new trade
	if(NumOpenLong < MaxTrades)
	{
		// reinvest the square root of profits
		//var MarginLong = sqrt(WinLong-LossLong)*OptimalFLong;
		//Margin = clamp(MarginLong, 5, 300); //max $300 per trade
		enterLong(); }

	//otherwise, close all opposite trades
	else if(!mode(HEDGING)) exitShort();
	return 0;
}

function run()
{
	set(PARAMETERS+FACTORS+NFA);  // generate and use optimized parameters
	BarPeriod = 240;	// 4 hour bars
	LookBack = 500;
	StartDate = 2002;
	//EndDate = 2009;
	NumWFOCycles = 5; // activate WFO

	if(ReTrain) {
		UpdateDays = -1;	// update price data from the server 
		SelectWFO = -1;	// select the last cycle for re-optimization
	}

// portfolio loop
	while(asset(loop("EURDKK","GBPCHF","EURUSD","GBPJPY","GBPNZD","AUDJPY","AUDCAD","EURJPY",
		"CHFJPY","EURGBP","GBPCAD","GBPAUD","EURAUD","EURCHF","EURNZD","NZDCHF")))
	{	
		// calculate the buy/sell signal
		vars Price = series(price());
		vars DomPeriod = series(DominantPeriod(Price,30));
		var LowPeriod = LowPass(DomPeriod,500);
		vars HP = series(HighPass(Price,LowPeriod*optimize(1,0.5,2)));
		vars Signal = series(Fisher(HP,500));
		var Threshold = optimize(1,0.5,2,0.1);

		Stop = optimize(4,2,8) * ATR(100);
		Trail = 4*ATR(100);

		//when training, force all trades so we can see what would be profitable via OptimalF
		if(is(TRAINMODE))
		{
			if(crossUnder(Signal,-Threshold)) reverseLong(1);
			else if(crossOver(Signal,Threshold)) reverseShort(1);
		}

		//when testing/trading only trade those known profitable via OptimalF
		if(is(TESTMODE) || (TRADEMODE)) 
		{
			//Allow more long trades for known-more-profitable
			if(crossUnder(Signal,-Threshold) && (OptimalFLong >= .15)) reverseLong(3); //known very big win
			else if(crossUnder(Signal,-Threshold) && (OptimalFLong >= .1)) reverseLong(2); //known big win
			else if(crossUnder(Signal,-Threshold) && (OptimalFLong >= .001)) reverseLong(1); //known win
	
			//Allow more short trades for known-more-profitable
			else if(crossOver(Signal,Threshold) && (OptimalFShort >= .15)) reverseShort(3); //known very big win
			else if(crossOver(Signal,Threshold) && (OptimalFShort >= .1)) reverseShort(2); //known big win
			else if(crossOver(Signal,Threshold) && (OptimalFShort >= .001)) reverseShort(1); //known win
		}

	} //while loop

	PlotWidth = 1000;
	PlotHeight1 = 600;
}