Gamestudio Links
Zorro Links
Newest Posts
FXCM => AVA Trade Plugin???
by Martin_HH. 11/25/26 21:59
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
New Zorro version 3.15
by jcl. 11/09/26 09:24
Removing outliers from files
by jcl. 11/04/26 10:30
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (JeyKey II), 8,409 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How to set a pair trading order right #469570
11/22/17 14:15
11/22/17 14:15
Joined: Nov 2016
Posts: 55
Taipei
ytc Offline OP
Junior Member
ytc  Offline OP
Junior Member

Joined: Nov 2016
Posts: 55
Taipei
How to set it right if I want to long 1 lot A while short X lot B for pair trading? My simply guess would be

asset(A);
reverseLong(1);
asset(B);
reverseShort(X);

Is this correct?

Re: How to set a pair trading order right [Re: ytc] #469581
11/23/17 08:04
11/23/17 08:04
Joined: Jul 2000
Posts: 28,149
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,149
Frankfurt
Almost, but the reverse.. functions need not be used - enterLong/Short is ok.

Re: How to set a pair trading order right [Re: jcl] #469585
11/23/17 10:21
11/23/17 10:21
Joined: Nov 2016
Posts: 55
Taipei
ytc Offline OP
Junior Member
ytc  Offline OP
Junior Member

Joined: Nov 2016
Posts: 55
Taipei
Wouldn't enterLong/Short make consecutive orders in the same direction?

Re: How to set a pair trading order right [Re: ytc] #469587
11/23/17 11:44
11/23/17 11:44
Joined: Jul 2000
Posts: 28,149
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,149
Frankfurt
Yes, if it triggers several times in the same direction. You can limit the number of open trades with MaxLong/MaxShort.

Re: How to set a pair trading order right [Re: jcl] #469589
11/23/17 13:00
11/23/17 13:00
Joined: Nov 2016
Posts: 55
Taipei
ytc Offline OP
Junior Member
ytc  Offline OP
Junior Member

Joined: Nov 2016
Posts: 55
Taipei
Thank you, jcl.

Re: How to set a pair trading order right [Re: jcl] #469598
11/24/17 01:29
11/24/17 01:29
Joined: Nov 2016
Posts: 55
Taipei
ytc Offline OP
Junior Member
ytc  Offline OP
Junior Member

Joined: Nov 2016
Posts: 55
Taipei
I though the difference between enterLong and reverseLong is that reverseLong updates order status but enterLong doesn't.
So what are the downsides using reverseLong/Short in pair trading?

Last edited by ytc; 11/24/17 01:40.
Re: How to set a pair trading order right [Re: ytc] #469600
11/24/17 07:35
11/24/17 07:35
Joined: Jul 2000
Posts: 28,149
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,149
Frankfurt
You called it wrongly. It had not opened X lots, it had set the limit to X trades. And it is depreciated, since it was replaced by MaxLong/Short.

Re: How to set a pair trading order right [Re: jcl] #469601
11/24/17 08:36
11/24/17 08:36
Joined: Nov 2016
Posts: 55
Taipei
ytc Offline OP
Junior Member
ytc  Offline OP
Junior Member

Joined: Nov 2016
Posts: 55
Taipei
Oh! Thanks for the help.By the way, I didn't see MaxLong/Short info for enterLong/Short on the mannual. Where should I set MaxLong parameter for enterLong? one after TrailSetp?

Last edited by ytc; 11/24/17 08:44.
Re: How to set a pair trading order right [Re: ytc] #469602
11/24/17 10:46
11/24/17 10:46
Joined: Jul 2000
Posts: 28,149
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,149
Frankfurt
Before the enterLong call. Here's it in the manual: http://manual.zorro-project.com/lots.htm

Re: How to set a pair trading order right [Re: jcl] #469612
11/24/17 20:58
11/24/17 20:58
Joined: Nov 2016
Posts: 55
Taipei
ytc Offline OP
Junior Member
ytc  Offline OP
Junior Member

Joined: Nov 2016
Posts: 55
Taipei
Much appreciated.


Moderated by  Petra 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1