I think this is the relevant text. You're setting LookBack after you call asset in your loop.

The place of an asset call (if any) in the script matters. All variables and flags that affect the creation of bars, such as BarPeriod, BarZone, LookBack, Detrend, StartDate, EndDate, TICKS, BarMode, UpdateDays, AssetList, History etc. must be set before calling asset(). Otherwise the simulation period is unknown at asset loading and either a default period is used, or the script will produce an Error 030 message. All parameters specific to an asset, such as Spread, Commission, etc., as well as all functions that use asset parameters or prices, such as price(), optimize(), advise(), etc. must be used after calling asset().

Last edited by strimp099; 02/18/21 06:45.