In 2.49.3 (and probably prior), BR_LOCAL+BR_LEISURE do no work in Train for closing trades:
Code
function run() {
	
	set(LOGFILE);
	NumYears=1;
	
        BarPeriod=15;
	
	BarZone=ET;
		
	StartWeek=71800;
	EndWeek=51701;
	
	set(PARAMETERS);
	
BarMode = BR_WEEKEND+BR_NOSHIFT+BR_LOCAL+BR_LEISURE;

MaxLong=-1;

	asset("EUR/USD");
		
	  AssetMarketZone=ET; 
	  AssetMarketStart = 1800;
	  AssetMarketEnd = 1701;

int i=optimize(5,5,6,1);
	
	int etTod = ltod(ET,0);
	
	if(etTod==1500) enterLong();
	
	if (etTod>AssetMarketEnd-1 and etTod<AssetMarketStart)
		exitLong();		
}
In Test, the script opens 1 trade and never closes it - as expected.

But in Train, it opens/closes 105 trades.
Quote
Parameter 1 step 1: 5.00 => 0.07 24/81
Parameter 1 step 2: 6.00 => 0.07 24/81
Selected p1[1] = +5.50 => 0.05


2) Also, the manual states for BR_LOCAL: " ...This also affects bar generation when set before the first asset call."
This doesn't seem to work:
Quote
[92: Mon 22-01-03 22:00] -0.0920 -0.0920 0/1 1.12981/1.12993\1.12969/1.12974 -0.00004
[93: Mon 22-01-03 22:30c] -0.40 -0.40 0/1 1.12975/1.12977\1.12943/1.12943 -0.00004
Can't exit [EUR/USD::L08401] outside market hours

[94: Mon 22-01-03 22:45c] -0.29 -0.29 0/1 1.12943/1.12962\1.12943/1.12954 -0.00004
Can't exit [EUR/USD::L08401] outside market hours

[95: Mon 22-01-03 23:00] -0.28 -0.28 0/1 1.12954/1.12965\1.12951/1.12955 -0.00004
[96: Mon 22-01-03 23:15] -0.0620 -0.0620 0/1 1.12955/1.12978\1.12955/1.12977 -0.00004


3) If trade closing happens to fall 'outside market hours' -what will happen in Live? Will a trade be closed at 'market open'?
If yes, it makes sense to make this consistent across Train-Test-Live. OR mention this nuance explicitly in the manual.


Please also check if BR_NOSHIFT works in Train.




Last edited by Zheka; 06/02/22 15:41.