Posted By: AdamWu
Plot multiple assets - 07/13/20 14:46
Hi everyone, I have trouble to plot multiple assets at the same time.
Update: I found a way:
Update: I found a way:
Code
vars Prices[3]; vars smas[3]; function run() { StartDate = 20200710; // My Assets File assetList("AssetsFXCMLite"); int cnt=0; BarPeriod = 1440; while(loop(Assets)){ asset(Loop1); Prices[cnt] = series(priceClose()); smas[cnt] = series(SMA(Prices[cnt],10)); cnt++; } asset(Assets[0]); PlotWidth = 600; PlotHeight1 = 500; PlotHeight2 = 500; int i; for(i=0;i<cnt;i++){ plot(strf("%s",Assets[i]),Prices[i],NEW,BLACK); plot(strf("sma for %s",Assets[i]),smas[i],0,BLUE); } }