Gamestudio Links
Zorro Links
Newest Posts
Camera always moves upwards?
by clonman. 11/13/25 14:04
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
Training with the R bridge does not work
by frutza. 11/05/25 00:46
Zorro 2.70
by opm. 10/24/25 03:44
Alpaca Plugin v1.4.0
by TipmyPip. 10/20/25 18:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, AndrewAMD), 21,112 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sheliepaley, Blueguy, blobplayintennis, someone2, NotEBspark
19177 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Symbols Loop #487853
10/17/23 08:20
10/17/23 08:20
Joined: Sep 2023
Posts: 18
Freiburg
S
steyr Offline OP
Newbie
steyr  Offline OP
Newbie
S

Joined: Sep 2023
Posts: 18
Freiburg
Hello there,

i want to trade several symbols f.i. EUR/USD ; AUD/USD ; GER30

The problem:

Since I have three functions in my script: the bar(), where I utilize different candlestick patterns; the run() where the initialization settings are located; and also the symbol loop and the tick() function, as I need to open or close positions within a bar. Does anyone have an idea on how I could incorporate the loop into my extraordinary script?"

The Code snippet:

Code
int bar(vars Open,vars High,vars Low,vars Close)
{
       //Volume Based bars or sth. else
}

function run()
{
	
	
	Capital = 1000;
	set(PARAMETERS|LOGFILE|PLOTNOW);
	StartDate = 20120101;
	EndDate = 20230101;    //StartDate + 0100; // 1 month
	StopFactor = 0;
	

	while(asset(loop("EUR/USD","GER30","AUD/USD"))) // the asset Loop
        {
        // normally i have to put the strategy conditions into this while-loop, unfortunately it is into the tick()
        }


}

	
function tick()
{
        if(trend) enterLong();
        else enterShort();
}


thank you for your Help



Last edited by steyr; 10/17/23 08:24.
Re: Symbols Loop [Re: steyr] #487854
10/17/23 11:23
10/17/23 11:23
Joined: Feb 2017
Posts: 1,809
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,809
Chicago
Check out the for(listed_assets) macro, which can be used outside of run().

Re: Symbols Loop [Re: steyr] #487864
10/19/23 18:22
10/19/23 18:22
Joined: Sep 2023
Posts: 18
Freiburg
S
steyr Offline OP
Newbie
steyr  Offline OP
Newbie
S

Joined: Sep 2023
Posts: 18
Freiburg
Thanks Andrew, i will try it laugh


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1