Sie sind auf Seite 1von 22

60

40

20

0 500 1000 1500 2000 2500

2000

-2000

-4000

0 500 1000 1500 2000 2500

Figure 1: Top : P&L curve from 19990101 to 20101110 of marko on NG


using factors {{′ CL8′ < 1, 0 >}{′ CL8′ < 2, 0 >}} τ = 150. Bottom :
corresponding positions. The Bump on the P&L curve happens on a week
end starting on 20001201 (friday). The Sharpe (starting after this bump to
last date) is 1.75. To make this curve flat we have to set the broker’s fee to
145$ ! (the tick value of NG is 10$)

1 NG : marko methods
Marko on NG with factors {{′ CL8′ < 1, 0 >}{′CL8′ < 2, 0 >}} (and τ = 150
days) gives the P&L curve of Fig 1. More or less the same curve can be
obtained using LCO as a factor, i.e., {{′LC8′ < 1, 0 >}{′ LC8′ < 2, 0 >}}.
The Sharpe is basically the same, however it performs a little less. Mixing
the 2 methods makes the Sharpe slightly higher. Mixing the factors does not
work, they are too much correlated.

2 Marko methods : how to dynamically choose


the factors
Marko is based on trying to allocate money on synthetic assets of the forms :
(i)
rt+1 ft where rt is the return between time t − 1 and t of the asset we want

1
(i)
to trade on and ft is the ith factor computed at time t. For this purpose,
we compute the empirical mean of these assets (using a moving average).
The whole idea of Marko lies on the fact that there are assets i for which
this means is ”significantly” non zero. If for an asset i, this mean is ”close”
to zero, we a priori do not want to include the corresponding factor. That
should give a rule for dynamically adapt the choices of factors. The main
problem is to define what we mean by being ”close” to 0 or ”significantly
different” from 0.
To compute corresponding confidence interval we cannot assume that
these assets are gaussian... it does not make any sense (fat tails!). One thing
(i)
is sure, if the absolute value of ft is highly correlated to the absolute value
of rt+1 but the signs are completely independent, we do not want to select
the corresponding factor. Thus if ǫt is a normalized Gaussian white noise, the
(i) (i) (i)
factor gt = ǫt ft should not be selected since the mean of the asset rt+1 gt is
0. So one can build confidence intervals using this artificial asset considering
(i) (i)
both rt+1 and ft are deterministic. So rt+1 gt is gaussian of mean 0 and
2 (i) (i)
variance rt+1 (ft )2 . When the asset rt+1 ft has a mean which is inside the
(i)
confidence interval of the noise asset rt+1 gt we then just temporarily remove
this factor.

3 AD with markosp
OK, let’s play with that idea on AD8 with the method markosp (two factors
{{′ AD8′ < 1, 0 >}{′ SP 8′ < 1, 0 >}} and τ = 300). On Fig 2 we display
the results using confidence interval 90% (red), 85% (green) and 80% (blue).
The top are the P&L curves (black is original markosp, the other curves have
been artificially shifted to match the first 50th point of the black curve). The
bottom figures are the empirical mean of each factor (black curve) and the
confidence interval. We discover something surprising : basically the AD
factor is responsible the money made after the 2008 crisis whereas
the SP factor is responsible for the money made before the crisis.

2
300000

200000

100000

0
0 500 1000 1500 2000 2500
FACTOR AD

0.4

0.3

0.2

0.1

0 500 1000 1500 2000 2500


FACTOR SP

0.2

0.15

0.1

0.05

0 500 1000 1500 2000 2500

Figure 2: Testing markosp (two factors {{′ AD8′ < 1, 0 >}{′ SP 8′ < 1, 0 >}}
and τ = 300) on AD using confidence intervals thresholding of the factors.
Backtesting from 20000101 to 20101001. The top are the P&L curves
(black is original markosp, the other curves have been artificially shifted to
match the first 50th point of the black curve). The bottom figures are the
empirical mean of each factor (black curve) and the confidence interval. SR
3 is 1 (to compute this SR we removed
of black curve is 1.40 and of blue curve
the first year to avoid the big peak).
4 CD with markosp4
4.0.1 Working on The original markosp4
OK, let’s play with that idea on CD8 with the method markosp4 (three
factors {{′ US8′ < 1, 0 >}{′SP 8′ < 1, 0 >}{′ SP 8′ < 1, 1 >}} and τ = 300).
Backtesting from 20000101 to 20101001. On Fig 3 we display the same
thing as we did for AD in the previous section. We see in this figure that
lately no factor are selected ⇒ the model is out !. Moreover The
fact that it took so much time to detect that the factors are no
longer valid is partly due to the 2008 crisis and the fact τ is large
(300).

4.0.2 Adding xCGB as a factor


We can add the factor {′ xCGB ′ < 1, 0 >} corresponding to the canadian
index (from 20050101, we don’t have it before). The P&L (Fig. 4) is clearly
better, at least on the first two thirds. The same figure shows that the
factor xCGB is always selected using a 80% confidence interval. Though it
looks like we have the same problem as before lately : the only
valid factor is xCGB but it looks like it is valid just due to the
reminiscence of the 2008 crisis.

4.0.3 Adding a ”random” factor


Let us add now, to the original markosp4 a factor picked up randomly, for
instance CL8 and use 80% confidence intervals. Fig. 5 shows that it does
not pertubate that much the results.

5 CU with markosp3m
Let’s do the same thing on CU and markosp3m. It has 5 factors {{′ US8′ <
1, 1 >}{′ SP 8′ < 1, 0 >}{′ SP 8′ < 1, 1 >}{′ SP 8′ < 2, 0 >}{′F V 8′ < 1, 1 >}}.
Let us point out that tau is much smaller than before : τ = 50. This is an
important point, in the sense that it makes the method much more adaptive
than the previous ones (remember that markosp and markosp4 suffer today
oft he influence the crisis due to the large τ ). Fig. 6 shows the results of
using confidence intervals of 70%. We see clearly the stability of the

4
150000

100000

50000

0
0 500 1000 1500 2000 2500
FACTOR US
0.15

0.1

0.05

0
0 500 1000 1500 2000 2500
FACTOR SP(open/close)
0.1
0.08
0.06
0.04
0.02

0 500 1000 1500 2000 2500


FACTOR SP(close/close)
0.1
0.08
0.06
0.04
0.02

0 500 1000 1500 2000 2500

Figure 3: Testing markosp4 (3 factors {{′ US8′ < 1, 0 >}{′ SP 8′ < 1, 0 >
}{′ SP 8′ < 1, 1 >}} τ = 300) on CD using confidence intervals thresholding
of the factors. Backtesting from 20000101 to 20101001. SR of black curve is
1.08 and of blue curve is 0.91.

5
100000

50000

0
0 250 500 750 1000 1250
FACTOR CGB
0.6

0.5

0.4

0.3

0.2

0.1
0 250 500 750 1000 1250

Figure 4: Same as Fig 3 adding the factor {′ xCGB ′ < 1, 0 >} on CDand
starting at 20050101. at the top are the P&L curves : black (bottom) is
corresponds to the orginal markosp, black (middle) to the original markosp
with the xCGB factor added and blue one to markosp + xCGB factor +
thresholding at 80%. Bottom figure shows the mean of the xCGB factor and
the 80% confidence interval (it is always above). SR of black curve is 1.89
and of blue curve is 1.89.

6
150000

100000

50000

0
0 500 1000 1500 2000 2500

0.03

0.02

0.01

0 500 1000 1500 2000 2500

Figure 5: Same as Fig 3 adding the factor {′ CL8′ < 1, 0 >} on CD and
using confidence intervals 80%. At the top are the P&L curves : black (thin)
corresponds to the original markosp with confidence interval (i.e., blue curve
of Fig 3), black (thick) to the original markosp with the CL8 factor added.
Bottom figure shows the mean of the CL8 factor and the 80% confidence
interval (it is always above).

7
factors (going in and out regularly!). I think the small τ is a real
advantage! Why did we used 70% instead of the usual 80% ? Well clearly
this percentage has to be adapted with the scale. It is not clear the exact
relation. However, it is clear that if τ is decreases, the noisy asset
is going to have a bigger variance so the confidence intervals (at a
fixed percentage) is going to be wider.... so we will remove more
often some factors.

6 Let’s go back on AD
6.1 Using markosp
In the light of the remark we just said, it is clear that we want to use small
τ ’s in marko methods. What if we try to do so for AD? Could we have
something that adapts to what happenned lately ? For that test we are
running markosp (as in the section 3 but now we are going to use τ = 50
instead of τ = 300 and confidence interval of 70%. This is what is shown in
Fig. 7

6.2 Using multisp


We can do the same thing using multisp. Fig. 8 shows the use of confidence
interval with τ = 300 and 9 shows the use of confidence intervals using τ = 50

7 Let’s go back on CD with markosp4


So we do the same thing as in the section 4.0.1 (using the factor CGB) but
using τ = 50 and confidence interval of 30%. See Fig. 10

8 Go back on NG
We apply the same procedure on the previous results on NG. Figure 11
applies a thresholding of 75% on the original method described on Section
12 (τ = 150). Figure 12 uses τ = 50 and threshold 70%. And finally, to

8
100000
80000
60000
40000
20000
0
0 500 1000 1500 2000 2500
FACTOR US8
0.4
0.3
0.2
0.1

0 500 1000 1500 2000 2500


FACTOR SP8(open/close)
0.2
0.15
0.1
0.05

0 500 1000 1500 2000 2500


FACTOR SP8(close/close)
0.3
0.2
0.1

0 500 1000 1500 2000 2500


FACTOR SP8(-2)
0.2
0.15
0.1
0.05

0 500 1000 1500 2000 2500


FACTOR_FV8
0.8
0.6
0.4
0.2

0 500 1000 1500 2000 2500

Figure 6: Testing markosp3m (5 factors {{′ US8′ < 1, 1 >}{′ SP 8′ < 1, 0 >
}{′ SP 8′ < 1, 1 >}{′ SP 8′ < 2, 0 >}{′ F V 8′ < 1, 1 >}} and τ = 50) on CU
using confidence intervals thresholding (70%) of the factors. Backtesting
from 20000101 to 20101001. SR of black curve is 1.69 and of blue curve
is 1.40.

9
100000

75000

50000

25000

0 500 1000 1500 2000 2500


FACTOR AD8
2.5

1.5

0.5

0 500 1000 1500 2000 2500


FACTOR SP8

0.8

0.6

0.4

0.2

0 500 1000 1500 2000 2500

Figure 7: Testing markosp (two factors {{′ AD8′ < 1, 0 >}{′ SP 8′ < 1, 0 >}}
with τ = 50) on AD using confidence interval (60%) thresholding of the
factors. Backtesting from 20000101 to 20101001. The top are the P&L
curves (black is without thresholding and blue is with thresholding). SR of
black curve is 0.4 and of blue curve is 0.87.

10
10000
8000
6000
4000
2000
0
0 500 1000 1500 2000 2500
FACTOR SP
5e-05
4e-05
3e-05
2e-05
1e-05

0 500 1000 1500 2000 2500


FACTOR AD
6e-05
4e-05
2e-05

0 500 1000 1500 2000 2500

Figure 8: Testing multisp (two factors {{′ AD8′ < 1, 0 >}{′ SP 8′ < 1, 1 >}}
with τ = 300) on AD using confidence interval (80%) thresholding of the
factors. Backtesting from 20000101 to 20101001. SR of black curve is
1.44 and of blue curve is 1.50.

11
12500
10000
7500
5000
2500
0
0 500 1000 1500 2000 2500
FACTOR SP
0.0002
0.00015
0.0001
5e-05

0 500 1000 1500 2000 2500


FACTOR AD

0.0003
0.0002
0.0001
0
0 500 1000 1500 2000 2500

Figure 9: Testing multisp (two factors {{′ AD8′ < 1, 0 >}{′ SP 8′ < 1, 1 >}}
with τ = 50) on AD using confidence interval (50%) thresholding of the
factors. Backtesting from 20000101 to 20101001. SR of black curve is
1.32 and of blue curve is 1.23.

12
80000
60000
40000
20000
0
0 250 500 750 1000 1250
FACTOR US8
0.5
0.4
0.3
0.2
0.1

0 250 500 750 1000 1250


FACTOR SP8(open/close)
0.25
0.2
0.15
0.1
0.05

0 250 500 750 1000 1250


FACTOR SP8

0.3
0.2
0.1

0 250 500 750 1000 1250


FACTOR CGB
1.5
1
0.5

0 250 500 750 1000 1250

Figure 10: Testing markosp4 (4 factors {{′ US8′ < 1, 0 >}{′SP 8′ < 1, 0 >
}{′ SP 8′ < 1, 1 >}{′ CGB ′ < 1, 0 >}} τ = 50) on CD using confidence
intervals (60%) thresholding of the factors. Backtesting from 20050101
to 20101001. SR of black curve is 1.55 and of blue curve is 1.59.

13
stabilize this last figure we use in Fig. 13 τ = 50, threshold 70% but we add
the LC8 factors (lag -1 and -2).

9 SF with markosp3m
Let’s do the same thing on SF and markosp3m. It has 5 factors {{′ US8′ <
1, 1 >}{′ SP 8′ < 1, 0 >}{′ SP 8′ < 1, 1 >}{′ SP 8′ < 2, 0 >}{′F V 8′ < 1, 1 >}}
τ = 50. Fig. 14 shows the results of using confidence intervals of 55%. Let
us point out that using 70% gives relatively bad results !!

10 JY with markosp3
Let’s do the same thing on JY and markosp3. It has 5 factors {{′ US8′ <
1, 1 >}{′ SP 8′ < 1, 0 >}{′ SP 8′ < 1, 1 >}{′ SP 8′ < 2, 0 >}{′F V 8′ < 1, 1 >}}
τ = 300. Fig. 15 shows the results of using confidence intervals of 80%. We
can try to use tau = 50 on JY. Results are shown on Fig. 18. If we use
confidence intervals of 70% the reslut are really bad, so we used 45%.

11 BP with markosp3
Let’s do the same thing on BP and markosp3. It has 5 factors {{′ US8′ <
1, 1 >}{′ SP 8′ < 1, 0 >}{′ SP 8′ < 1, 1 >}{′ SP 8′ < 2, 0 >}{′F V 8′ < 1, 1 >}}
τ = 300. Fig. 17 shows the results of using confidence intervals of 80%.
We can try to use tau = 50 on BP. Results are shown on Fig. ??. I used
confidence intervals of 80%.

14
150000

100000

50000

0 500 1000 1500 2000 2500


FACTOR CL8
0.4

0.3

0.2

0.1

0 500 1000 1500 2000 2500


FACTOR CL8(-2)
0.3

0.2

0.1

0 500 1000 1500 2000 2500

Figure 11: Top : P&L curve from 19990101 to 20101110 of marko on NG


using factors {{′CL8′ < 1, 0 >}{′ CL8′ < 2, 0 >}} τ = 150 thresholded 75%.
(see figure ). SR pf black curve 0.6 and of blue curve is 1.09

15
50000

-50000

-100000

-150000

0 500 1000 1500 2000 2500


FACTOR CL8
1

0.8

0.6

0.4

0.2

0 500 1000 1500 2000 2500


FACTOR CL8(-2)
0.6

0.4

0.2

0 500 1000 1500 2000 2500

Figure 12: Top : P&L curve from 19990101 to 20101110 of marko on NG


using factors {{′ CL8′ < 1, 0 >}{′ CL8′ < 2, 0 >}} τ = 50 thresholded 70%.
(see figure ). SR pf black curve -0.11 and of blue curve is 0.46

16
125000
100000
75000
50000
25000
0
0 250 500 750 1000 1250
FACTOR LC8

0.6
0.4
0.2

0 250 500 750 1000 1250


FACTOR LC8(-2)
0.6

0.4

0.2

0 250 500 750 1000 1250


FACTOR CL8
0.5
0.4
0.3
0.2
0.1

0 250 500 750 1000 1250


FACTOR CL8(-2)
0.6

0.4

0.2

0 250 500 750 1000 1250

Figure 13: Top : P&L curve from 20050101 to 20101110 of marko on NG


using factors {{′ CL8′ < 1, 0 >}{′ CL8′ < 2, 0 >}{′ LC8′ < 1, 0 >}{′ LC8′ <
2, 0 >}} τ = 50 thresholded 70%. The thick black curve at the top is without
thresholding and with τ = 150 (SR is 1.71). The thin black curve is τ = 50
no thresholding (SR = 0.67) and the blue one is τ = 50 thresholded with
70% (SR is 1.21).
17
100000
75000
50000
25000
0
0 500 1000 1500 2000 2500
FACTOR US8
0.5
0.4
0.3
0.2
0.1

0 500 1000 1500 2000 2500


FACTOR SP8(close/open)
0.25
0.2
0.15
0.1
0.05
0
0 500 1000 1500 2000 2500
FACTOR SP8
0.4
0.3
0.2
0.1

0 500 1000 1500 2000 2500


FACTOR SP8(-2)
0.2
0.15
0.1
0.05

0 500 1000 1500 2000 2500


FACTOR FV8

0.6
0.4
0.2

0 500 1000 1500 2000 2500

Figure 14: Testing markosp3m (5 factors {{′ US8′ < 1, 1 >}{′SP 8′ < 1, 0 >
}{′ SP 8′ < 1, 1 >}{′ SP 8′ < 2, 0 >}{′ F V 8′ < 1, 1 >}} and τ = 50) on SF
using confidence intervals thresholding (65%) of the factors. Backtesting
from 20000101 to 20101001. SR of black curve is 1.58 and of blue curve
is 1.18.

18
150000
100000
50000
0
0 500 1000 1500 2000 2500
FACTOR US8
0.1
0.075
0.05
0.025

0 500 1000 1500 2000 2500


FACTOR SP8(close/open)
0.06
0.04
0.02

0 500 1000 1500 2000 2500


FACTOR SP8
0.125
0.1
0.075
0.05
0.025
0 500 1000 1500 2000 2500
FACTOR SP8(-2)
0.06
0.04
0.02

0 500 1000 1500 2000 2500


FACTOR FV8
0.6
0.4
0.2

0 500 1000 1500 2000 2500

Figure 15: Testing markosp3 (5 factors {{′ US8′ < 1, 1 >}{′SP 8′ < 1, 0 >
}{′ SP 8′ < 1, 1 >}{′ SP 8′ < 2, 0 >}{′ F V 8′ < 1, 1 >}} and τ = 300) on JY
using confidence intervals thresholding (80%) of the factors. Backtesting
from 20000101 to 20101001. SR of black curve is 1.29 and of blue curve
is 1.08.

19
100000
75000
50000
25000
0
0 500 1000 1500 2000 2500
FACTOR US8
0.4
0.3
0.2
0.1

0 500 1000 1500 2000 2500


FACTOR SP8(close/open)
0.2
0.15
0.1
0.05
0 500 1000 1500 2000 2500
FACTOR SP8
0.5
0.4
0.3
0.2
0.1
0 500 1000 1500 2000 2500
FACTOR SP8(-2)
0.25
0.2
0.15
0.1
0.05
0 500 1000 1500 2000 2500
FACTOR FV8
1
0.8
0.6
0.4
0.2
0 500 1000 1500 2000 2500

Figure 16: Testing markosp3 (5 factors {{′ US8′ < 1, 1 >}{′SP 8′ < 1, 0 >
}{′ SP 8′ < 1, 1 >}{′ SP 8′ < 2, 0 >}{′F V 8′ < 1, 1 >}}. However we changed
the value of τ = 50) on JY using confidence intervals thresholding (45%) of
the factors. Backtesting from 20000101 to 20101001. SR of black curve
is 1.27 and of blue curve is 0.78.

20
150000
100000
50000
0
0 500 1000 1500 2000 2500
FACTOR US8
0.1
0.08
0.06
0.04
0.02
0 500 1000 1500 2000 2500
FACTOR SP8(close/open)
0.125
0.1
0.075
0.05
0.025
0 500 1000 1500 2000 2500
FACTOR SP8
0.1
0.08
0.06
0.04
0.02
0 500 1000 1500 2000 2500
FACTOR SP8(-2)
0.06
0.04
0.02

0 500 1000 1500 2000 2500


FACTOR FV8
0.25
0.2
0.15
0.1
0.05
0 500 1000 1500 2000 2500

Figure 17: Testing markosp3 (5 factors {{′ US8′ < 1, 1 >}{′SP 8′ < 1, 0 >
}{′ SP 8′ < 1, 1 >}{′ SP 8′ < 2, 0 >}{′ F V 8′ < 1, 1 >}} and τ = 300) on BP
using confidence intervals thresholding (80%) of the factors. Backtesting
from 20000101 to 20101001. SR of black curve is 1.15 and of blue curve
is 1.36.

21
76000
56000
36000
16000
-4000
-24000
0 500 1000 1500 2000 2500
FACTOR US8
0.4
0.3
0.2
0.1

0 500 1000 1500 2000 2500


FACTOR SP8(close/open)
0.25
0.2
0.15
0.1
0.05
0 500 1000 1500 2000 2500
FACTOR SP8
0.3
0.2
0.1

0 500 1000 1500 2000 2500


FACTOR SP8(-2)
0.2
0.15
0.1
0.05
0 500 1000 1500 2000 2500
FACTOR FV8
1
0.8
0.6
0.4
0.2
0 500 1000 1500 2000 2500

Figure 18: Testing markosp3 (5 factors {{′ US8′ < 1, 1 >}{′SP 8′ < 1, 0 >
}{′ SP 8′ < 1, 1 >}{′ SP 8′ < 2, 0 >}{′F V 8′ < 1, 1 >}}. However we changed
the value of τ = 50) on BP using confidence intervals thresholding (80%)
of the factors. Backtesting from 20000101 to 20101001. SR of black
curve is 0.17 and of blue curve is 1.

22

Das könnte Ihnen auch gefallen