Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
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
4 registered members (NewbieZorro, Grant, TipmyPip, AndrewAMD), 13,346 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
Need help with learning code #432983
11/20/13 16:42
11/20/13 16:42
Joined: Jul 2013
Posts: 110
B
bfleming Offline OP
Member
bfleming  Offline OP
Member
B

Joined: Jul 2013
Posts: 110
I'm making my way through Workshop 6 and pretty much understand it. But I have a question about how to trade different assets using different algorithms. IN the workshop we have:

while(asset(loop("EUR/USD","USD/JPY")))
while(algo(loop("TRND","CNTR")))
{
if(strstr(Algo,"TRND"))
tradeTrend();
else if(strstr(Algo,"CNTR"))
tradeCounterTrend();
}

But this trades both TRND and CNTR on EUR/USD and USD/JPY. How would I write the code if I want, for example, EUR/USD to only trade TRND and USD/JPY to only trade CNTR?

On another note, if I want an algo to open several positions for a trade, could someone point to where the manual explains how to do this.

Many thanks!!

Re: Need help with learning code [Re: bfleming] #433009
11/21/13 09:00
11/21/13 09:00
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
You can combine conditions with "and", for instance:

if(strstr(Algo,"TRND") and strstr(Asset,"EUR/USD"))
tradeTrend();

Re: Need help with learning code [Re: jcl] #433012
11/21/13 09:45
11/21/13 09:45
Joined: Jul 2013
Posts: 110
B
bfleming Offline OP
Member
bfleming  Offline OP
Member
B

Joined: Jul 2013
Posts: 110
Many thanks!

And if I want an algo to open several positions at once, rather than increasing lot size, with each positions, for example, having a different take profit - could you point me to where I can learn how to code that?

Again, many thanks!!

Re: Need help with learning code [Re: bfleming] #433016
11/21/13 10:48
11/21/13 10:48
Joined: May 2013
Posts: 627
Bonn
Sundance Offline
User
Sundance  Offline
User

Joined: May 2013
Posts: 627
Bonn
Hi bfleming,

look at http://zorro-trader.com/manual/en/trade.htm

There is an example at the bottom of the page

Re: Need help with learning code [Re: Sundance] #433017
11/21/13 11:21
11/21/13 11:21
Joined: Jul 2013
Posts: 110
B
bfleming Offline OP
Member
bfleming  Offline OP
Member
B

Joined: Jul 2013
Posts: 110
Thanks for the pointer, Sundace. But I'm still not able to find anything about opening several positions at once for the same trade entry. Any ideas?

Re: Need help with learning code [Re: bfleming] #433018
11/21/13 11:29
11/21/13 11:29
Joined: May 2013
Posts: 627
Bonn
Sundance Offline
User
Sundance  Offline
User

Joined: May 2013
Posts: 627
Bonn
There is no function like enterLong to fire up several trades in one step. Just use enterLong in a loop. Taking a trade only needs some seconds.

Re: Need help with learning code [Re: Sundance] #433021
11/21/13 11:45
11/21/13 11:45
Joined: Jul 2013
Posts: 110
B
bfleming Offline OP
Member
bfleming  Offline OP
Member
B

Joined: Jul 2013
Posts: 110
Ah, ok. Thanks. Will play around with that and see how far I get on my own before I have another question :))

Many thanks for your help!!


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1