I have adapted my script to use the above lines and also set up BarPeriod and LookBack differently in trade mode:

Code:
BarPeriod = ifelse(is(TRADEMODE), 60, 60 * 24);
LookBack = ifelse(is(TRADEMODE), 45 * 24, 45);



I'm having some issues with Error 055 and especially 047:

Code:
Warning 055: SGO.PA first 434 bars missing
Loading LYB prices.. 32910 min, 2366 bars added
Loading MNST prices.. 32895 min, 2367 bars added
Loading VZ prices.. 32910 min, 2366 bars added
Loading AAPL prices... 32895 min, 2367 bars added
Loading BIDU prices.. 32910 min, 2366 bars added
Loading USB prices.. 32595 min, 2387 bars added
Loading FDX prices.. 32925 min, 2365 bars added
Loading DLTR prices... 32880 min, 2368 bars added
Loading MCD prices.. 32955 min, 2363 bars added
Error 047: not enough bars (87 missing)
Logout.. ok



I already tried the PRELOAD flag but that does not help I only have daily data from yahoo.
Now in trade mode the Lookback should be 45 * 24 = 1080. In the log it says ~2360 bars added. Yet it says 32955 min while 45 * 24 * 60 = 64800.

So im a bit confused now by the numbers.

In my LookBack calculation I assumed that 1 day had 24 bars and simply multiplied 45 day lookback times 24.
Now I want to trade CFDs that don't trade 24hrs/day.
Should I then set TimeFrame to -8 instead of -24 when the frame ends and use 45 * 8 as LookBack?

What can i do to make this work?