Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 10/06/26 05:32
Purchase A8 full licence version
by jcl. 10/05/26 12:12
Respect History setting for Z systems
by AndrewAMD. 10/02/26 15:43
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (JeyKey II, VoroneTZ), 14,153 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
JimSimons, julienp, julienper, KelleyAbbey, Yopachi
19246 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,835
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

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