Well, this is embarrassing. This fix did not work with an example I was working on!

It seems that set(TICKS) flag is preventing it from working.
When the flag is commented out, it only trades one asset.
When the flag is not commented out, testing does not work at all.

See code below.

JCL please help.

(edit) PS. This is Renko bar code from the manual with random trading algo also from the manual.

Code:
int bar(vars Open, vars High, vars Low, vars Close)
{	
	var BarRange = 0.0030;
	var OpenDiff;
	var CloseDiff;
	
	OpenDiff = abs(Close[0]-Open[1]);
	CloseDiff = abs(Close[0]-Close[1]);
	if(OpenDiff < CloseDiff) {
	// If this matches we have a valley or peak
	  Open[0] = Open[1];
	} else {                              
	// This is for when we are moving with the trend
	  Open[0] = round(Close[1],BarRange);
	}
	if(Close[0]-Open[0] >= BarRange) {  // Going up
	  Close[0] = Open[0]+BarRange;
	  High[0] = Close[0];
	  Low[0] = Open[0];
	  return 1;
	}
	if(Open[0]-Close[0] >= BarRange) { // Going Down
	  Close[0] = Open[0]-BarRange;
	  High[0] = Open[0];
	  Low[0] = Close[0];
	  return 1;
	}
	return 4;
}

function run()
{
	set(PLOTNOW);
	set(TICKS);
	BarPeriod = 60;
	StartDate = 2015;
  	Weekend = 0;
	Verbose = 15;
	
	//asset("EUR/USD");
	//set(NFA);
	//if(is(FIRSTRUN)) brokerCommand(SET_MAGIC,4711007);
	set(LOGFILE);
  
   vars Open = series(priceOpen());
	vars High = series(priceHigh());
	vars Low = series(priceLow());
	vars Close = series(priceClose());
	vars Price = series(price());
	ColorUp = BLUE;
	ColorDn = MAGENTA;

	
	while(asset(loop("EUR/USD","GBP/USD","AUD/USD","USD/CAD"))){

	Lots = 10;
	Stop = 5*ATR(20);
	TakeProfit = 5*ATR(20);
	if(NumOpenTotal > 2) {
		exitLong();
		exitShort();
	} else if (!is(LOOKBACK)) {
		printf("\nLots %.0f, Stop %.5f, PIPCost %.4f, Risk %.2f",
			Lots, Stop, PIPCost, Lots*(Stop+Spread)/PIP*PIPCost);
		if(price(0) > price(1))//&& between(Close[0],rRealLowerBand,rRealUpperBand)) 
		//if(random() > 0) 
			enterLong();
		else 
			enterShort();
	}
  }
  
	PlotScale = 6;
	PlotWidth = 10000;
	PlotHeight1 = 500;
	PlotHeight2 = 200;
}


Last edited by Finstratech; 12/23/15 00:57.