1 registered members (AbrahamR),
717
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Doubt about Capital and Required Capital, nothing is enough!
#453246
07/13/15 18:19
07/13/15 18:19
|
Joined: Nov 2013
Posts: 123
Mithrandir77
OP
Member
|
OP
Member
Joined: Nov 2013
Posts: 123
|
I have a doubt about Capital required, in the manual it states in the definition of the Capital variable: Capital Initial invested capital in units of the account currency (default = 0 = no initial capital). This has no effect on trading, but on calculating the strategy performance in the simulation. Set this to the initial capital when the strategy reinvests profits; make sure that it exceeds the required capital for avoiding negative equity on the account. Zorro then calculates CAGR instead of AR and determines performance parameters from the invested capital instead of the required capital.
I have trouble understanding what it is underlined. For instance, I have a portfolio trained with WFO and I test without reinvestment and I get that the Capital required is 342$ , here are all the stats:
BackTest TradePortofolio1 EUR/USD
Simulated account AssetsFix.dta
Bar period 1 hour
Test period 01.05.2009-31.12.2014
Lookback time 2000 bars (17 weeks)
Monte Carlo cycles 200
Assumed slippage 10.0 sec
Spread 0.3 pips (roll -0.12/0.05)
Commission 0.60
Contracts per lot 1000.0
Gross win/loss 5854$ / -3712$ (+24596p)
Average profit 378$/year, 32$/month, 1.45$/day
Max drawdown -259$ 12% (MAE -423$ 20%)
Total down time 74% (TAE 84%)
Max down time 40 weeks from Jan 2013
Max open margin 154$
Max open risk 475$
Trade volume 938088$ (165522$/year)
Transaction costs -21$ spr, -3.30$ slp, -28$ rol, -48$ com
Capital required 342$
Number of trades 801 (142/year, 3/week, 1/day)
Percent winning 61%
Max win/loss 89$ / -48$
Avg trade profit 2.67$ 30.7p (+136.6p / -137.9p)
Avg trade slippage -0.00$ -0.0p (+0.4p / -0.7p)
Avg trade bars 145 (+163 / -115)
Max trade bars 1874 (16 weeks)
Time in market 338%
Max open trades 16
Max loss streak 8 (uncorrelated 7)
Annual return 110%
Profit factor 1.58 (PRR 1.43)
Sharpe ratio 1.09
Kelly criterion 1.07
R2 coefficient 0.747
Ulcer index 7.1%
Prediction error 23%
Cycle performance 1.61 1.58 1.49 1.64 1.56
Confidence level AR DDMax Capital
10% 137% 168$ 276$
20% 133% 180$ 285$
30% 129% 190$ 293$
40% 126% 200$ 300$
50% 121% 218$ 313$
60% 117% 234$ 324$
70% 112% 254$ 339$
80% 104% 289$ 365$
90% 97% 326$ 391$
95% 91% 362$ 418$
100% 73% 502$ 519$
So, ok, I set Capital to 1000 which is more than 342 and I train factors and test with reinvestment and I get that the capital required is 4119, here are the details
BackTest TradePortofolio1 EUR/USD
Simulated account AssetsFix.dta
Bar period 1 hour
Test period 01.05.2009-31.12.2014
Lookback time 2000 bars (17 weeks)
Monte Carlo cycles 200
Assumed slippage 10.0 sec
Spread 0.3 pips (roll -0.12/0.05)
Commission 0.60
Contracts per lot 1000.0
Capital invested 1000$
Gross win/loss 166247$ / -116792$ (+24596p)
Average profit 8726$/year, 727$/month, 34$/day
Max drawdown -4986$ 10% (MAE -9231$ 19%)
Total down time 67% (TAE 95%)
Max down time 25 weeks from Jul 2012
Max open margin 3934$
Max open risk 6831$
Trade volume 36525302$ (6444733$/year)
Transaction costs -822$ spr, -165$ slp, -675$ rol, -1886$ com
Capital required 4119$
Number of trades 801 (142/year, 3/week, 1/day)
Percent winning 61%
Max win/loss 4708$ / -1474$
Avg trade profit 62$ 30.7p (+168.1p / -188.0p)
Avg trade slippage -0.21$ -0.1p (+0.6p / -1.2p)
Avg trade bars 145 (+163 / -115)
Max trade bars 1874 (16 weeks)
Time in market 338%
Max open trades 16
Max loss streak 8 (uncorrelated 7)
Annual growth rate 100%
Profit factor 1.42 (PRR 1.29)
Sharpe ratio 1.21
Kelly criterion 0.17
R2 coefficient 0.918
Ulcer index 5.9%
Prediction error 23%
Cycle performance 1.48 1.39 1.29 1.52 1.42
Confidence level AR DDMax Capital
10% 164% 1912$ 5325$
20% 159% 2131$ 5484$
30% 157% 2225$ 5552$
40% 153% 2436$ 5707$
50% 150% 2569$ 5803$
60% 148% 2720$ 5913$
70% 144% 2900$ 6044$
80% 141% 3101$ 6190$
90% 135% 3451$ 6445$
95% 130% 3815$ 6710$
100% 113% 5253$ 7756$
and then if I set Capital to 5000 and test, the capital required increases and so on... So what is the relationship between Capital and Capital required? In this example, do I need 1000 or 4119 to start running the strategy? I mean, if I try to make sure that the Capital variable is more than the Capital required from the performance report, then when I test it is not enough, how come? Thanks for your help!
|
|
|
Re: Doubt about Capital and Required Capital, nothing is enough!
[Re: jcl]
#453256
07/14/15 17:43
07/14/15 17:43
|
Joined: Nov 2013
Posts: 123
Mithrandir77
OP
Member
|
OP
Member
Joined: Nov 2013
Posts: 123
|
When you set the Capital variable to a value x, and then get "Required Capital" > x, increasing Capital won't help of course because the required capital rises linearly with it. The lower limit is the required capital _without reinvestment_. The required capital is calculated from the maximum drawdown, so your capital must be higher when that happens, but not necessarily at the begin. Otherwise limit the reinvestment factor so that you won't get negative equity. OK, when I don't reinvest it is clear, I have to initially invest the capital required to avoid negative equity in case of drawdowns. The thing is when reinvesting...How can I know the initial capital of the strategy in order to be on the safe side? With your explanation Jcl and rereading the definition of capital required: Required initial capital for trading the strategy. For strategies that reinvest profits (Capital variable nonzero), the displayed value is the minimum initial capital for avoiding a margin call in the test period. Otherwise it's the sum of normalized drawdown and maximum margin. This amount would be required when the strategy is entered at the worst possible moment of the simulation, i.e. directly at the balance peak preceding the largest drawdown. I guess in my example that if I start the reinvesting strategy with 1000 I have to maintain 3119 in the account for re margin in case of being near a margin call. Is that correct? Could you share how is it the capital required calculated when reinvesting? Maybe that clarifies more my doubt. Edit: I am using for setting the margin the formula from the workshop 6: Margin = OptimalF * Capital * sqrt(1 + max(0,WinTotal-LossTotal)/Capital);
Last edited by Mithrandir77; 07/14/15 18:03.
|
|
|
Re: Doubt about Capital and Required Capital, nothing is enough!
[Re: Mithrandir77]
#453285
07/16/15 14:19
07/16/15 14:19
|
Joined: Nov 2013
Posts: 123
Mithrandir77
OP
Member
|
OP
Member
Joined: Nov 2013
Posts: 123
|
Yes, I am also afraid of overcomplicating things but still, there are things that are not clear and I would like to clarify them because when reinvesting I want to avoid undercapitalization risk. Anyway, I think I am progressing towards understanding finally. Just two more questions and thanks again for your patience! 1) You say "Capital required is just max margin plus max drawdown" but both in the test without reinvesting quoted above: Max drawdown -259$ 12% (MAE -423$ 20%) ... Max open margin 154$ ... Capital required 342$ 259 + 154 == 413 != 342 And with reinvestment: Max drawdown -4986$ 10% (MAE -9231$ 19%) ... Max open margin 3934$ ... Capital required 4119$ 4986 + 3934 == 8920 != 4119 Or is it Capital required = max(Open margin + Drawdown) in the simulation period? I am not being picky about numbers here, I want to know where the 4119 comes from since it is 4x the amount I invested. 2) Are MonteCarlo figures valid when reinvesting? These are the ones from my test: Confidence level AR DDMax Capital 10% 164% 1912$ 5325$ 20% 159% 2131$ 5484$ 30% 157% 2225$ 5552$ 40% 153% 2436$ 5707$ 50% 150% 2569$ 5803$ 60% 148% 2720$ 5913$ 70% 144% 2900$ 6044$ 80% 141% 3101$ 6190$ 90% 135% 3451$ 6445$ 95% 130% 3815$ 6710$ 100% 113% 5253$ 7756$ ie, cain I say that when reinvesting with 95% confindence I will have 130% AR, 3815 DDMAX, etc? PS: Here is the equity curve from the test with 1000 invested and reinvesting, I see no negative equity -blue below zero- so I am more assured from that point.
|
|
|
Re: Doubt about Capital and Required Capital, nothing is enough!
[Re: Mithrandir77]
#453295
07/17/15 12:54
07/17/15 12:54
|
Joined: Jul 2000
Posts: 27,986 Frankfurt
jcl
Chief Engineer
|
Chief Engineer
Joined: Jul 2000
Posts: 27,986
Frankfurt
|
1) For calculating the required capital, drawdown is normalized to 3 years. Otherwise you would get a different required capital depending on the length of the test period, even with no reinvestment. You can find details on the "Performance" page of the manual.
2) Yes, the figures are still "valid" with reinvesting, but are mostly irrelevant. When the reinvestment changes, all figures depending on it such as max drawdown, annual return, required capital etc. also change. What you see are their temporary, more or less random values at the end of the simulation. That's why the performance of a system with reinvestment is not measured with annual return, but with CAGR, and most of the usual performance figures have not much meaning anymore.
|
|
|
Re: Doubt about Capital and Required Capital, nothing is enough!
[Re: Mithrandir77]
#453298
07/17/15 15:11
07/17/15 15:11
|
Joined: Nov 2013
Posts: 123
Mithrandir77
OP
Member
|
OP
Member
Joined: Nov 2013
Posts: 123
|
Oh, I had forgot about normalized drawdown. Now it is clear! Also taking a closer look at the equity curve I see that the max drawdown is near 5000 so that would be were the 4119 comes from since I have no negative equity.
So looking at the performance without reinvestment
Number of trades 801 (142/year, 3/week, 1/day) Annual return 110% Profit factor 1.58 (PRR 1.43) Sharpe ratio 1.09 Kelly criterion 1.07 R2 coefficient 0.747 Ulcer index 7.1% Prediction error 23% Cycle performance 1.61 1.58 1.49 1
And since I have 4 parameters that I optimized, that gives 142 trades per year/ 4 parameters= 35.5 trades per year per parameter which is enough for a statistically significant optimizing (though it is by convention, it comes from the fact that a sample of 20 or 30 is enough to 'build' a normal distribution), I guess that it's a tradeable stategy, although I would like to raise Sharpe a lil bit maybe to 1. 5
Great as always Jcl, thanks for the patience explaining this topic. Money Management is one of the most difficult ones in trading for me.
Last edited by Mithrandir77; 07/17/15 15:49.
|
|
|
|