vars Prices[0];
vars smas[0];
function run()
{
set(PLOTNOW);
PlotWidth = 600;
PlotHeight1 = 500;
PlotHeight2 = 500;
StartDate = 20220101;
EndDate = 20220205;
BarPeriod = 1440;
//My Asset File
assetList("AssetsXY");
int cnt = 0;
int i;
//while(loop(Assets))
while(asset(loop(Assets)))
{
Prices[cnt] = series(priceClose());
smas[cnt] = series(SMA(Prices[cnt],10));
cnt++;
}
asset(Assets[0]);
for(i=0;i<cnt;i++)
{
plot(strf("Cl for %s",Assets[i]),Prices[i],NEW,BLACK);
plot(strf("SMA for %s",Assets[i]),smas[i],0,BLUE);
}
}