Gamestudio Links
Zorro Links
Newest Posts
How was this Game Rendered?
by 3run. 08/06/20 20:01
problem with adding new history
by daan. 08/06/20 19:53
wrong Entry
by daan. 08/06/20 19:52
New Zorro version 2.30
by Zheka. 08/06/20 17:40
Lookback period - no signs of live
by jcl. 08/06/20 16:23
How to plot stop TradeStopLimit
by AdamWu. 08/06/20 15:03
Chat Room for Zorro Programmers
by AdamWu. 08/06/20 14:20
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
11 registered members (mk_1, txesmi, AdamWu, Dooley, daan, jenGs, painkiller, AndrewAMD, Aweys, 1 invisible), 474 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
bigimpactsound, tzw101, Al82, Alibert, jsch
18489 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Plot multiple assets #480790
07/13/20 14:46
07/13/20 14:46
Joined: May 2020
Posts: 24
A
AdamWu Online OP
Newbie
AdamWu  Online OP
Newbie
A

Joined: May 2020
Posts: 24
Hi everyone, I have trouble to plot multiple assets at the same time.

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);
	}
}

Last edited by AdamWu; 07/13/20 14:51.
Re: Plot multiple assets [Re: AdamWu] #480792
07/13/20 15:04
07/13/20 15:04
Joined: Jul 2000
Posts: 27,307
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,307
Frankfurt
PlotMode |= PL_ALL;

https://manual.zorro-project.com/plotmode.htm

Better use different plot colors when you have many assets.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1