2 registered members (howardR, sleakz),
706
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: The Financial Hacker
[Re: jcl]
#455704
10/28/15 02:05
10/28/15 02:05
|
Joined: Apr 2014
Posts: 482 Sydney, Australia
boatman
Senior Member
|
Senior Member
Joined: Apr 2014
Posts: 482
Sydney, Australia
|
jcl, love your post about the Cold Blood Index. I posted a comment there, but will post it here for the Zorro community as well. Let me know if you'd prefer future comments to be posted to the financial hacker site only.
My comment:
Great post and thank you for sharing. I was looking for a solution like this recently in order to objectively decide when to pull out of a strategy. I settled on a modification of your second example, where an allowance is made for the drawdown to grow with time. The modification I made was to use the confidence intervals for the maximum drawdown calculated by Zorro’s Monte Carlo engine rather than the maximum drawdown of the backtest. The limitation is that we don’t know the confidence intervals for the maximum drawdown length – only the maximum drawdown depth. I used the maximum drawdown length calculated for the backtest and considered where the backtest drawdown depth lay in relation to the confidence intervals calculated via Monte Carlo to get a feel for whether it was a reasonable value.
I like your Cold Blood Index a lot. It is more meaningful than the approach I used, but it does suffer from a similar drawback – that is, being a function of the balance curve in the backtest. If you accept that the balance curve obtained in the backtest is one possible outcome amongst an infinite number of possibilities due to the random nature of individual trade results, then the result obtained with the Cold Blood Index is likewise one possible outcome amongst many.
(As an aside, this condition can be validated by examining the autocorrelation of the backtest returns series with various lags using either Zorro, R or some other statistical tool. Nearly every strategy I’ve experimented with, and definitely the few that I’ve taken live, have all shown statistically insignificant return autocorrelations).
I think your (fantastic) idea of the Cold Blood Index could be improved by incorporating the algorithm into a Monte Carlo routine that creates many unique balance curves by randomly sampling the backtested trade results, and running it separately on each curve. Obviously the computation time would become significant, so the additional effort would only be worth it having confirmed that the returns series exhibits statistically insignificant autocorrelation.
Is this something that would be possible with Zorro, or do you think it would be a more efficient use of time to attempt it directly within R?
Thanks for sharing your research. I learn a lot from every post.
|
|
|
Re: The Financial Hacker
[Re: madpower2000]
#462746
10/24/16 20:29
10/24/16 20:29
|
Joined: Aug 2016
Posts: 61
dr_panther
Junior Member
|
Junior Member
Joined: Aug 2016
Posts: 61
|
I found a very interesting technique to multiply trade variations on your blog, but I don't get it right, please can you tell me, what I am doing wrongly. My expectation based on the bog would be to get print 10, 20, 50... but what I actually get is just 10.
function run()
{
StartDate=20160104;
StartDate=20160105;
int Period;
int Periods[10] = { 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000 };
while(asset(loop("EUR/USD" )))
{
Period = Periods[optimize(1,1,10,1)-1];
printf("Period: %02d, ",Period) ;
}
}
|
|
|
Re: The Financial Hacker
[Re: jcl]
#462765
10/26/16 10:52
10/26/16 10:52
|
Joined: Aug 2016
Posts: 61
dr_panther
Junior Member
|
Junior Member
Joined: Aug 2016
Posts: 61
|
Sorry, if my questions about that are ignorant, but after many hours of testing, I still don't understand the output. My understanding is that the optimize function should generate multiple outputs similar to this code:
function run()
{
set(PARAMETERS|LOGFILE);
StartDate=20160106;
EndDate=20160107;
BarPeriod = 1440;
LookBack =0;
int Period;
int Periods[10] = { 10, 20, 50 };
int i;
while(asset(loop("EUR/USD" )))
for (i=0;i<3;i++)
{
Period = Periods[i]; //
print(TO_ANY,"Period: %d, ",Period) ;
}
}
When I press "Trade", the log file looks like that
[1: Thu 07.01.16 00:00] (1.07497)Period: 10, Period: 20, Period: 50,
however the following code :
function run()
{
set(PARAMETERS|LOGFILE);
StartDate=20160106;
EndDate=20160107;
BarPeriod = 1440;
LookBack = 0;
int Periods[10] = { 10, 20, 50 };
while(asset(loop("EUR/USD" )))
{
int Period = Periods[optimize(1,1,3,1)-1];
print(TO_ANY,"Period: %d, ",Period) ;
}
}
generates:
[1: Thu 07.01.16 00:00] (1.07497)Period: 10,
I wonder how the optimize function can be used to create multiple variations of the trends. Additionally I would like to know if the optimize function is comparable with the for loop. Thanks for you patients, jcl :))
|
|
|
|