Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (SBGuy), 712 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 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: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
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: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
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: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
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: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
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 | chip programmers | 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