Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, dr_panther), 1,275 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 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: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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