Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (wandaluciaia, AndrewAMD, 1 invisible), 765 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 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: 45
A
AdamWu Offline OP
Newbie
AdamWu  Offline OP
Newbie
A

Joined: May 2020
Posts: 45
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,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
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