Spirit, thanks for your response. I have been busy with studies and work the last weeks. I have decided to reaproach this script by adding a filter that measures volatility. I could have used ATR but for some reason I found Alligator interesting so here it is the script and the results:

script:
Click to reveal..

function run()
{
//set(PARAMETERS);
StartDate = 2002;
EndDate = 2008;
NumWFOCycles = 10;
LookBack = 2000;
vars Price = series(price());
var period = 500;
vars Trend = series(LowPass(Price,period));

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

vars Meanness = series(MMI(Price,200));
vars Filter = series(LowPass(Meanness,period));

Alligator(series(MedPrice()));
var diff = FisherN(series(abs(rBlue-rGreen) + abs(rGreen-rRed)),500);
vars diffs = series(diff);
var Threshold = 2.5;//0.1;//1.0;//1.5;//2.5

static bool Filter2;
if (crossOver(diffs,Threshold) or crossUnder(diffs,-Threshold))
Filter2 = true;
if (crossUnder(diffs,Threshold) or crossOver(diffs,-Threshold))
Filter2 = false;

if( valley(Trend) ){
exitShort(); // close opposite position
if(falling(Filter) and Filter2)
enterLong();
} else if( peak(Trend) ) {
exitLong();
if(falling(Filter) and Filter2)
enterShort();
}
set(LOGFILE); // log all trades
}


performance report:
Click to reveal..

Walk-Forward Test Workshop4_2Pc EUR/USD - performance report

Simulation period 01.05.2002-31.12.2008
Test period 30.11.2004-31.12.2008
WFO test cycles 9 x 2742 bars (23 weeks)
Training cycles 10 x 15538 bars (134 weeks)
Monte Carlo cycles 200
Lookback time 2000 bars (17 weeks)
Assumed slippage 10.0 sec
Spread 2.3 pips (roll -0.10/0.04)
Contracts per lot 1000.0

Gross win/loss 117$ / -44$ (+941p)
Average profit 18$/year, 1.48$/month, 0.07$/day
Max drawdown -34$ 47% (MAE -42$ 58%)
Total down time 41% (TAE 9%)
Max down time 68 weeks from Jul 2007
Largest margin 5.00$
Trade volume 17479$ (4278$/year)
Transaction costs -3.02$ spr, 0.10$ slp, -0.88$ rol
Capital required 34$

Number of trades 17 (5/year, 1/week, 1/day)
Percent winning 41%
Max win/loss 42$ / -16$
Avg trade profit 4.28$ 55.4p (+215.8p / -56.9p)
Avg trade slippage 0.01$ 0.1p (+0.6p / -0.3p)
Avg trade bars 151 (+346 / -14)
Max trade bars 542 (4 weeks)
Time in market 10%
Max open trades 1
Max loss streak 6 (uncorrelated 6)

Annual return 52%
Profit factor 2.65 (PRR 1.25)
Sharpe ratio 0.75
Kelly criterion 1.08
R2 coefficient 0.385
Ulcer index 6.0%
Prediction error 125%

Confidence level AR DDMax Capital

10% 103% 14$ 17$
20% 93% 17$ 19$
30% 85% 18$ 21$
40% 82% 20$ 22$
50% 77% 21$ 23$
60% 73% 22$ 24$
70% 67% 25$ 27$
80% 62% 28$ 29$
90% 55% 32$ 33$
95% 50% 36$ 36$
100% 33% 58$ 54$

Portfolio analysis OptF ProF Win/Loss Wgt% Cycles

EUR/USD .166 2.65 7/10 100.0 ./XX//\\\
EUR/USD:L .169 3.14 5/6 88.4 ..\///\\\
EUR/USD:S .147 1.60 2/4 11.6 .//\...\.

plot:
Click to reveal..




As you can see, I used Alligator lines closeness as a measure of volatility, I normalize their differences and when they go out of a threshold (which is higher the less volatile the market is) I consider it a signal to buy or sell.

This has turned the loser system into a winning one with good Sharpe Ratio for a trend system and an ulcer of 6%. What do you think? Do you think It has any bias or curve fitting? I look forward to hearing your inputs. Thanks!