How to set a pair trading order right

Posted By: ytc

How to set a pair trading order right - 11/22/17 14:15

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?
Posted By: jcl

Re: How to set a pair trading order right - 11/23/17 08:04

Almost, but the reverse.. functions need not be used - enterLong/Short is ok.
Posted By: ytc

Re: How to set a pair trading order right - 11/23/17 10:21

Wouldn't enterLong/Short make consecutive orders in the same direction?
Posted By: jcl

Re: How to set a pair trading order right - 11/23/17 11:44

Yes, if it triggers several times in the same direction. You can limit the number of open trades with MaxLong/MaxShort.
Posted By: ytc

Re: How to set a pair trading order right - 11/23/17 13:00

Thank you, jcl.
Posted By: ytc

Re: How to set a pair trading order right - 11/24/17 01:29

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?
Posted By: jcl

Re: How to set a pair trading order right - 11/24/17 07:35

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.
Posted By: ytc

Re: How to set a pair trading order right - 11/24/17 08:36

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?
Posted By: jcl

Re: How to set a pair trading order right - 11/24/17 10:46

Before the enterLong call. Here's it in the manual: http://manual.zorro-project.com/lots.htm
Posted By: ytc

Re: How to set a pair trading order right - 11/24/17 20:58

Much appreciated.
© 2024 lite-C Forums