Gamestudio Links
Zorro Links
Newest Posts
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
Release 2.68 replacement of the .par format
by Martin_HH. 09/23/25 20:48
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,175 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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,806
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,806
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