Hi Jcl,

Thank for your hints,

According to your comment, I have added the is(INITRUN) check when loading the assetList (which was not the case).

I am using now the following script for test purpose :

Code:
function run()
{
set(PLOTNOW);
set(LOGFILE);
set(PRELOAD);
Verbose=7;
StartDate = 20150615;
EndDate = 20171001;
Weekend=0;

if(is(INITRUN)) {
		assetList("AssetsStrategy.csv"); // load asset list
}

while (asset(loop(Assets)))
{

BarPeriod = 15;
MaxLong = 4;
var winprofit;
set(NFA);
vars Price = series(price());
var NbDevUp=1.7;
var NbDevDn=1.7;
BBands((series(1000*priceClose())),20,NbDevUp,NbDevDn,MAType_SMA);
vars upperBand = series(rRealUpperBand/1000);
vars lowerBand = series(rRealLowerBand/1000);
plot("Bollinger1",rRealUpperBand/1000,BAND1,BLACK);
plot("Bollinger2",rRealLowerBand/1000,BAND2,GREY);
set(PLOTNOW);
set(TICKS);

printf("n Asset  : %s ",Asset);
printf("n price  : %.8f ",Price[0]);
printf("n UpperBand  : %.8f ",upperBand[0]);
printf("n LowerBand  : %.8f ",lowerBand[0]); 

if (crossUnder(Price, lowerBand) && NumOpenLong <MaxLong)
	{

	Lots = 1;
    TakeProfit = 1.0375*price();
	winprofit = (WinLong - LossLong);
	
	printf("n Asset  : %s ",Asset);
	printf("n pip cost : %.8f ",PIPCost);
	printf("n pip  : %.8f ",PIP);
	printf("n commission cost: %.8f ",CommissionCost);
	printf("n commission : %.8f ",Commission);
	printf("n lot amount : %.8f ",LotAmount);
	printf("n lot  : %.8f ",Lots);
	printf("n spread  : %.8f ",Spread);
	printf("n price  : %.8f ",Price[0]);
	printf("n UpperBand  : %.8f ",upperBand[0]);
	printf("n LowerBand  : %.8f ",lowerBand[0]);
	printf("n win - loss in btc : %.8f ",winprofit);
	
	enterLong();
  }	
	
}
	
plot("$ Balance",Balance,NEW,BLUE); 
plot("Equity",Equity,0,GREEN); 

}



It seems that the issue is still present, maybe I have misunderstood something with the BarPeriod (but normally should not affect TMFs).





Last edited by JohanAu; 11/02/17 07:55.