I've changed like your recommandation : it returns
Error 053: ^GSPC unavailable at this time
Load NAS100 prices.. 5100 h0.00 0.00 0.00

Trade: model2 2017-06-30
Lookback period (145 bars)
Error 030: asset ^GSPC missing in INITRUN
Error 011: Function KAMA called with invalid parameters (no price)
Error 011: Function EMA called with invalid parameters (no price)



the script is :

function run()
{
NumYears=15;
StartDate = 20100101;
EndDate = 20171231;
BarPeriod = 60*24;
LookBack = 145;
set(PRELOAD);


//asset("^GSPC");
//if(is(INITRUN))
assetHistory("^GSPC",FROM_AV);
asset("^GSPC");
vars Price = series(priceClose());
vars high=series(priceHigh());
vars low=series(priceLow());
vars zerolag=series(KAMA(Price,10));
vars fastema = series(EMA(Price,50));
vars slowema = series(EMA(Price,80));
/////////////////////////////////
vars slowema = series(EMA(Price,80));
asset("NAS100");
if(fastema[0]>slowema[0])
{
enterLong();
}
if(fastema[0]<slowema[0])
{
exitLong();
}

printf("%.2f ",zerolag[0]);
printf("%.2f ",fastema[0]);
printf("%.2f ",slowema[0]);
}