Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible), 637 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 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,967
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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