I played a little with optimizing the script.

Code:
function tradeOneNightStand() {
	
  vars Price = series(price());
  vars SMAShort = series(SMA(Price, optimize(10,5,20)));
  vars SMALong = series(SMA(Price, optimize(40,30,80,5)));

  Stop = optimize(100,100,500,10) * PIP;

  var BuyStop,SellStop;

  BuyStop = HH(10) + 1*PIP;
  SellStop = LL(10) - 1*PIP;

  if (dow() == 5 && NumOpenLong == 0 && NumPendingLong == 0 && SMAShort[0] > SMALong[0] && rising(SMAShort) && rising(SMALong)) {
	Margin = 0.1 * OptimalFLong * Capital;
	enterLong(0,BuyStop);
  }

  else if (dow() == 5 && NumOpenShort == 0 && NumPendingShort == 0 && SMAShort[0] < SMALong[0] && falling(SMAShort) && falling(SMALong)) {
	Margin = 0.1 * OptimalFShort * Capital;
	enterShort(0,SellStop);			
 }	

  if (dow() != 5 && dow() != 6 && dow() != 7) {
	exitLong();
	exitShort();
  }
}


function run() {

 set(PARAMETERS+FACTORS);
 BarPeriod = 1440;
 StartDate = 2005;
 NumWFOCycles = 5;
 Capital = 50000;
 LookBack = 120;

 while(asset(loop("USD/CHF","USD/JPY","GBP/USD","EUR/USD","EUR/JPY","USD/CAD"))) 
	tradeOneNightStand();
 }


Don't forget to train first. Less trades but interesting results and a touch of security with a bit of stop.

What settings for USOil do you use in your AssetsFix? I must admit I do not really understand the information on FXCM web site. laugh

Last edited by Sphin; 10/13/15 22:35.