@jcl, thank you, what do you mean by plotting the price profile I will copy the algo, its an evolution of your code, so its not a secret... laugh I would like your help in order to improve my analysis capabilities.

@Veratyr, thank you for your post. The Algo was taken from the blog you have referred wuth minor changes.


function TFM()
{
/* Annual return 245%
Profit factor 4.23 (PRR 3.61)
Sharpe ratio 0.88
Kelly criterion 0.31
R2 coefficient 0.808
Ulcer index 10.0%
Prediction error 36%
*/
algo("TFM");
var mmiPeriod = optimize(100, 25, 600, 25 );
var lpPeriod = optimize( 90, 30, 150, 6 );
Stop = optimize(4, 2, 8, 0.5) * ATR(100);

var stopPip = Stop / PIP;
var minPip = 10;
Trail = stopPip * minPip;
TrailSlope = (minPip * 100) / stopPip;
TrailLock = optimize (0, 0, 75, 5);

vars Price = series(price());
vars Trend = series(LowPass(Price, lpPeriod));
vars MMI_Raw = series(MMI(Price, mmiPeriod));
vars MMI_Smooth = series(LowPass(MMI_Raw, mmiPeriod));

if(Train && ParCycle <= 2) {
Stop = 4 * ATR(100);
TakeProfit = 8 * ATR(100);
Trail = 0;
TrailSlope = 100;
TrailLock = 0;
}

if(falling(MMI_Smooth)) {
if(valley(Trend)) {
enterLong();
}
else if(peak(Trend)) {
enterShort();
}
}
}