my journal 2

Status
Not open for further replies.
out of the bathtub

Usual eureka in the bathtub.

Ok, first we set up a scoring method. Each of the 120 systems is scored by computing an average of these four parameters:

1) back-tested sharpe ratio
2) forward-tested sharpe ratio
3) number of back-tested trades
4) number of forward-tested trades

[...written later...] There's still a problem here, to be solved: if a system makes 1 million trades and loses money, it will have a similar rating/scoring as a system which wins every time and trades 30 times. This can't be allowed. I need to find a way to weigh sharpe ratio scores by the quantity of trades made, so that if you have a good sharpe ratio and achieved it over many trades you're better than having achieved with fewer trades, but if you have a bad sharpe ratio and achieved it over many trades, you still get a worse score than both. This is going to be complex, but for sure I cannot allow all 4 parameters above to be weighing the same.

[...written later...] I also need to add something monitoring the largest loss and not allowing trading by a system whose biggest loss is more than x % of margin invested (or similar reasoning).

Each number is matched against the value recorded by the best performing system (max # of back-tested trades, highest back-tested sharpe ratio, etc.). If the system trading the most, trades 1230 times, each systems' # of trades gets divided by 1230, and we come up with 4 percentage values, which then get averaged.

This above is the scoring system.

Based on those scores we decide the candidates and also how many contracts they could potentially be allowed to trade. This decision is arbitrary. For example, we could say that systems averaging > 95% are candidates for 3 contracts, systems averaging > 75% are candidates for 2 contracts, systems > 50% are candidates for 1 contract, and less than that... they're not candidates.

The palisade's risk optimizer then decides which system trades how many contracts based first of all on the candidates we feed it, whose potential contracts are allocated or not based on an optimization which will optimize by total return, but will also have these constraints (in this specific case I am studying):

1) dd max duration in days <= 35
2) dd depth <= x dollars (in this case 18k)
3) combined sharpe >= 4.7
4) max theoretical margin <= capital available * 1.5
5) I should also find, if possible, a way to measure drawdowns lasting longer than 15 days and count how many of them there are per given combination and use the optimizer with that information. The best way to calculate this is to sum the days of all the drawdowns that last longer than 10 or 15 days or even 20 days... let's do 15 days. Otherwise it's not meaningful -- i will abolish 35 days at #1 and use the sum of those days.

In the future, all that will need to be changed will be that arbitrary decision on how many contracts to allocate based on the score, and these 4 values, listed right above this sentence.
 
Last edited:
the complex concept of "drawdown"

In the bathtub I was also wondering how I could get paid for 3 months in a row despite a drawdown that's been lasting (i was going to say "falling") for a month and a half. Well, here's how the equity line showed it can be done to me:

Snap1.jpg

I got paid at the red circles at the end of the month.

First of all, my reasoning was faulty because, as described before, a "drawdown" lasts as long as the previous peak is taken so it is wrongly called "draw-down" because in some cases the equity line could be going up during a drawdown. Or maybe one could argue it is measured wrongly in terms of days duration, which is what i argued in my earlier posts.

But, even more importantly, my reasoning was faulty, because you know what? If we reach a peak of 200k of profit on august 15th, and then we come back down to 15k of profit for the rest of the century, then we will be in a drawdown for an entire century and yet get paid every month, because, with high water mark profit, all that counts is where profit is at the end of the month. So the tricky thing is, once again, that a drawdown could last years, just because a very high peak was reached, but, provided that you didn't reach it on the last day of the month, and you measured things at the end of the month, you could have every single month profitable for the next 10 years, and yet be in a drawdown all the while. It's amazing how drawdown can be a source of fallacies and misunderstandings.
 
Last edited:
new server kicks ass

Get this. It is a laptop, and it does everything a server does plus more. More powerful in every way, it lasts hours in case of a power outage and it has a secondary connection in case one connection fails. I didn't do this, so it's not my merit, but I am just saying: the hell with those guys saying you can't run systems from home because of potential failures. If you're not eating french fries all day long, and you work your ass off, it can all be done, and be done better than an investment fund can do it.

In just 24 hours we did so much work on that netbook/laptop/server that I had to do 3 acronis .tib image files to keep track of it. So in case anything goes wrong, C: gets back the way it was at any of these 3 different stages of work today.

Now I'll get drunk to celebrate and to sleep better.

Only problem is the micro-helicopter has not arrived yet. It was supposed to arrive a week ago: I think the world is plotting against me. Someone is playing with my helicopter right now.
 
still problems with automated portfolio selection

The bathtub wasn't enough, because I still have doubts and problems about the first part of automation described here:
http://www.trade2win.com/boards/trading-journals/85510-my-journal-2-a-277.html#post1635352

The problem is that I don't intrinsically understand the sharpe ratio, due to the fact I suck at formulas and it's a pretty complex one for me.

I am now tempted to proceed practically, compare a bunch of systems, their sharpe ratios and see if they correctly assess performance in all its aspects.
 
Re: the complex concept of "drawdown"

If we reach a peak of 200k of profit on august 15th, and then we come back down to 15k of profit for the rest of the century, then we will be in a drawdown for an entire century and yet get paid every month, because, with high water mark profit, all that counts is where profit is at the end of the month. So the tricky thing is, once again, that a drawdown could last years, just because a very high peak was reached, but, provided that you didn't reach it on the last day of the month, and you measured things at the end of the month, you could have every single month profitable for the next 10 years, and yet be in a drawdown all the while. It's amazing how drawdown can be a source of fallacies and misunderstandings.

I looked into PAMM (percent allocation management module) set-ups with Dukascopy, an FX ECN broker, and they use the high-water mark system in order to allocate the % of your profits from managed accounts. Therefore the previous fund high has to be exceeded in order to divide up the winnings. Makes sense, as you'll only be adding to your drawdown by taking out funds if you haven't exceeded the previous high, however you still need to live!
 
I am confused by all these formulas. I can barely get back home and remember the address I live at. My brain is on the verge of a strike.
 
pretty good mood

The server is running fine and I've had other unmentionable personal satisfactions today.

With this toshiba laptop/netbook as they call it, whatever, now I feel like my friend hosting it: a man with power and connections. It has enough power to outlast several storm-related power outages, and two connection to withstand any type of problems with one of the two ISPs.

I am really happy. On top of everything, it's even faster than the previous one, which was a real server. This is the unbelievable part - anyway, it was not my merit but all due to my friend's expertise and hard work.

I feel so happy about things finally working well, after you work on them so much. Years of double-checking, attention, work, cells, details, bent on the laptop. Years of my work and years of other people's work. And the objective of retirement is finally getting closer.

To tell the truth I never wanted to go to work in the first place. But then I was forced by circumstances, due to being born in the wrong family.

I've been so excited in the last 48 hours that I haven't slept more than 6 hours in the last few nights, and... I don't know. I don't know when I will. Probably tonight I will calm down.

Another thing I must mention is that we're just 400 dollars away from ending the drawdown.
 
Last edited:
Ok... the previous drawdown ended yesterday, which is good. But then today we're down 3000 dollars.
 
Now the market has changed and instead of being down 3000 dollars we're up 1000 dollars.
 
some news

No more updates, because now we're out of the drawdown and it would mean just showing off.

The server is working beautifully. I'll have to increase the rent. But no money is enough for the service I am getting.

I mean: do you know what I am talking about? I am talking about not being worried that there will be disconnections, nor being worried that there will be power failures... This is everything for automated traders.

It's the last step only because you can afford a server as the last step. If you don't make money, indeed, how are you going to pay for it?

I think the server and related efforts was the decisive factor in the recent scaling up decision. More capital invested. That is why I can no longer post, because there will be more profit and then posting makes no sense if things are ok. I post to complain mostly.

I mean, everyone does, one way or another. Imagine if Soros or Warren Buffett posted here, saying they're frustrated... it's not going to happen.

Anyway.

The week went great. The drawdown ended yesterday already and today thousands were made. That figure doesn't impress me any more only because, with other people, I have gotten used to thinking it's not me, it's not all in my hands, I am being monitored... I have gotten so used to it, that my hands are tied and I don't even feel the desire to interfere and place compulsive trades. I did in the first six months. Not anymore. Besides, this thing is working so well, that I am getting convinced that my systems are more intelligent than me, despite having built them.

Having said this, the helicopter did not arrive, nor did the submarine, nor did the 3 cameras I bought. So the week did not go that well from that point of view.

I am starting to suspect people around me, suspecting someone took it. But I'll wait one more week, to see if things are late.

Then I'll write emails, but most of all I will ask to be refunded.

I can't say much more. The excitement over scaling up and, before that, the excitement due to working on the new server, both have placed me into a state of excitement that has kept from sleeping for an entire week.

Before that, there was the new bank office... as we moved from a place in rome to another place, always in rome... I can't even write any more.

I need to rest my eyes. But so much progress has been made that I am glad I have worked so hard for all this.

Had I gotten the helicopter, this progress would not have been made, so thank god for not having received it this week.

I might not even file any complaints and just be happy with whatever I'll receive. I've got to receive at least 1 item out of 5 i ordered.

Now I'll try to find an appropriate song for this post I just wrote:

 
Last edited:
As expected I didn't sleep well. Too excited.

I need to get back into my routine. But also too many people moving around the house are keeping me from that.

I've been working with palisade's riskoptimizer to come up with the best combination of systems/contracts. Now that i've added margin into the picture, it still works, but it is much slower. If finds one or two good combinations every minute.

Nothing more to add. I am exhausted from sleep deprivation.
 
understanding sharpe ratio, sortino ratio and standard deviation

The Standard deviation sons of bitches

I was recently advised by the backers to use the sortino ratio, after using for a year the sharpe ratio, before i could really even understand the sharpe ratio. Yeah, I suck at formulas.

Since I suck at formulas, this time I decided to make this really clear and simple in my head and so I went here:
http://simple.wikipedia.org/wiki/Standard_deviation

But they've got it wrong.

We can find the standard deviation of the numbers 3, 7, 7 and 19 as follows...

Step 1: find the average of 3, 7, 7, and 19...

...So, the standard deviation is 6.

6.92820323
is what excel says instead if I use this formula:
=STDEV(3,7,7,19)

So, by hopping from one science hideout to another, I found an answer on Yahoo! Answers:
I keep getting standard deviation wrong, Help?

The difference is the denominator used in the calculation of the variance.

There are two variance formulas. The first one, that you use, has N-1 as the denominator. This is the formula for calculating a SAMPLE variance that you can use to estimate characteristics of the population.

However, to calculate the variance and standard deviation of a population (when all members of the target group are known) you would use N alone, and not N-1 in the denominator.

Different texts use different notations, but the one I'm familiar with would use a Roman "s" for what you calculated, and a small Greek s, or sigma (it looks like an upside down capital Q), to represent what the answer sheet says.

If you hunt around on your calculator, you'll probably find the n and n-1 keys on your calculator.

If you look up "Variance" using the Wikipedia towards the bottom you can see an explanation of the difference under the heading "Population Variance and Sample Variance."

Source(s):
http://en.wikipedia.org/wiki/Variance

But now I am trying to figure out what the Yahoo! Answer means...

Ok, here's Italian wikipedia:
http://it.wikipedia.org/wiki/Standard_deviation

Sostanzialmente, poiché non è nota la media dell'intera popolazione, ma solo una sua stima (la media del campione), bisogna utilizzare N − 1 per ottenere uno stimatore corretto.

Questa correzione al denominatore fa sì che la nuova definizione sia un po' più grande della precedente, correggendo così la tendenza della precedente a sottostimare le incertezze soprattutto nel caso in cui si lavori con pochi dati (N piccolo).

Still not clear. Let's try here:
http://www.business-analysis-made-easy.com/Standard-Deviation-Calculator.html

Snap1.gif

So yes, I am getting a little further. Now I have learned the formula, even though I still do not understand it. The formula generally used seems to be the following one, and I will quote Simple English Wikipedia, but correct them:

In a set of values, you find the standard deviation by following these steps:

1.Find the average of all the values.
2.Subtract the average from each value, giving you their deviations.
3.Square the deviation for each value.
4.Find the average of all these squared deviations. (WRONG: sum the squared deviations and divide them by n-1)
5.Find the square root of that average.

Ok, so now Hotch (below post) and another guy have cleared it further:
http://www.une.edu.au/WebStat/unit_materials/c4_descriptive_statistics/standard_deviation.htm

The above formula is the definition for a sample standard deviation. To calculate the standard deviation for a population, N is used in the denominator instead of N-1.

This is all regarding the different standard deviation formulas.

Let me see if Hotch is right and the excel function stdevp works as he says, making it right for the Simple English Wikipedia people.

=STDEVP(3,7,7,19)
Yes, the result is "6".


The Sharpe Ratio mother ****er

Ok, so now the question remains what should we use for sharpe ratio: stdev or stdevp?

Given that I am dividing average profit by 6 or 6.9 according to your answer, it is pretty important.

I still have to point out my doubts, and they are that I think standard deviation is crap. I know what the formula is, by all means. But I still do not agree with it.

I don't see why standard deviation should not simply be the average of the absolute distances of each value from the average of the values.

Forgive my ignorance, but my logic is pissed off at all this. I am now livid at the guy who invented the standard deviation and all these mother ****ing mathematicians.

But let's keep on moving.

Now, despite still not understanding these mother ****ers and their formulas, I still wonder if, as an idiot applying the formuals without understanding them, I should use stdev or stdevp for the sharpe ratio (and sortino ratio as well).

So here's something on this:
http://hedgefundquant.blogspot.com/2011/01/understanding-sharpe-ratio.html

The Sharpe ratio is one of the simplest ratios, it is also one of the ratios which is most often miscalculated. I will explain what the Sharpe ratio is, the correct way to calculate the ratio as well as a couple of the most common errors made when performing this calculation.

Yes, like hell it is. That is why everyone gets it wrong...

This is how simple it is, in his words:

What is it?

The Sharpe ratio was created to answer the question “Given the same amount of risk, which investment provides me with the highest reward.” To do this the Sharpe ratio balances the returns in excess of a risk free benchmark with the standard deviation of the return set. This provides a uniform risk platform which funds with different risk levels can benchmark against.

Anyway, here's finally my question and his answer:

Where it can go wrong

As seen above, the Sharpe ratio is very simple, however many times it is overcomplicated and miscalculated. I will quickly go over a couple of the different common issues which cause discrepancies between our calculations and the individual calculations of independent hedge fund managers...

[...]

4. STDEV vs. STDEVP

One other gotcha that you may see if you are using Excel is the difference between STDEV and STDEVP. The difference between these two functions are described here. If you want to use excel to calculate you Sharpe, use STDEV.

Mother ****er! Why?

I started this post in an effort to clarify. I didn't clarify anything, but at least now I know what the standard deviation formulas are (only two so far). So now it's more complex than before, but I understand better the labyrinth of my ignorance.

Summary of what I learned:

There's two standard deviation formulas: one with "n-1" and one with "n". They both suck, i don't understand why they are the way they are, but now I know exactly how to calculate them and their differences (their difference is that "1" that gets subtracted when calculating the average for the sample).

The Sharpe ratio sucks even worse, but now I know that the financial mother ****ers prefer to use excel's "stdev" function for it, which means using the "n-1" version. Mother ****ers.

[...]

The Sortino asshole

Before I forget to summarize my work, let's end the post and get to the mother ****ing sortino.

After staying up late for several hours, because the backers have decided I should now use sortino mother ****er instead of sharpe mother ****er, I have finally found a good formula that is array-entered and is all self-contained and almighty, and I'll share it here for everyone's benefit:

=15.8*AVERAGE(B7:B2125)/STDEV(IF(B7:B2125<0,B7:B2125))

This is array-entered, and 15.8 is the square root of the mother ****ing trading days of one year -- yet another mother ****ing detail I have to swallow but don't understand nor digest.

B7:B2125 is the range of all the trades made in the 8 years of my system.

"IF" is there to calculate only the stdev of the mother ****ing losses.

Now what was the point of all these formulas? The point was to distract me from simply looking at how much money was made by a system and focusing on that alone. This is what all these mother ****ers are there for: to distract me with their bull****.
 
Last edited:
Re: understanding sharpe ratio, sortino ratio and standard deviation

I was told recently to use sortino ratio, after using for a year sharpe ratio, before i could even really understand sharpe ratio. Yeah, I suck at formulas.

Since I suck at formulas, this time I decided to make this really clear and simple in my head and so I went here:
http://simple.wikipedia.org/wiki/Standard_deviation

But hey, they've got it wrong, believe it or not.



6.92820323
is what excel says instead if I use this formula:
=STDEV(3,7,7,19)

The mistake all begins here, when they say (like almost everyone else):


If it were this simple, their formula could even be simplified more, like this:
1. find the average of the values
2. find the absolute distance of each value from that average
3. their average is the standard deviation

But hell no. They use the square root method, which confuses them, makes them stop reasoning (like anyone looking at a square root) and that's how they get it wrong.

So, by hopping from one science hideout to another, I found the answer on Yahoo! Answers:
I keep getting standard deviation wrong, Help?



But now I am trying to figure out what the Yahoo! Answer means...


OK....

Firstly, Excel's STDEV function approximates standard deviation, assuming you have a sample, in their example they have the whole population. So if you use STDEVP, you will get 6.

Ah, didn't see the yahoo (answering as I read).
 
Editing as I think...

I made plenty of logical mistakes in my above post so please refer to the latest modified version. I will keep modifying for the next 24 hours.

Thanks for the help and feedback.
 
If you were a fund doing your end of year analysis, then you'd want to use STDEVP. However, as you're attempting to estimate future performance, STDEV may be preferable, personally I'd take the more conservative value.
 
Hmm, I was going to say that I didn't understand your point, but I won't say it, because otherwise you'll explain it more, and make it even harder to understand. What I'll say is thanks again for the "stdevp" tip, which helped a lot.

 
Hmm, I was going to say that I didn't understand your point, but I won't say it, because otherwise you'll explain it more, and make it even harder to understand. What I'll say is thanks again for the "stdevp" tip, which helped a lot.


A sample is just if you have say 100 systems and you pick 20 systems and you want to work out the standard deviation of those and you conclude that the 100 systems have a standard deviation of x based on the sample you picked.

Standard deviation is just the average distance away from the mean. So if you have two systems and they return 30% and 70%. The mean would be 50%(the average of the two) and the average distance from the mean would be 20%, because 30% is 20% off 50% and 70% is 20% off 50%. Sorry if you knew this already.
 
Thanks for the feedback and continued readership.

I have done a lot of thinking about those ratios (sortino and sharpe mother ****ers) and related standard deviation. I don't think, in my own modest ignorant opinion, that it is as simple as you picture it.

I don't have enough knowledge to tell you how wrong I think you are in painting a simple picture... well actually I do. Here's what the formula looks like on wikipedia:

83a7338b851dcaafaf5b64353af56596.png

This is Greek to me. Don't tell me this is "just the average distance away from the mean". Don't make me prove it to you, because I don't know how to.

All right: 1, 2, 3, 4.

Their sum is 10, which, divided by 4, returns the mean, which is 2.5.

The average distance of those numbers from 2.5 is: 1.5, 0.5, 0.5, 1.5.

And the average of these four values is... 1.

So, since:
=STDEV(1,2,3,4) returns 1.290994449
=STDEVP(1,2,3,4) returns 1.118033989

This proves that at least excel (whichever st.dev. formula you use) disagrees with your concept of the standard deviation being "just the average distance away from the mean".

Anyway, welcome back to the journal and let's not start arguing immediately. Well, agree to disagree, as Ron Burgundy says:


http://en.wikipedia.org/wiki/Agree_to_disagree
 
Last edited:
a good day, so far

Hot water wasn't running, but it's summer so it was bearable.

The systems are making money, despite the concerns about the US downgrading to AA or whatever it's called. Yeah, cause the two trades open are on US treasury and it's doing good, and on Bund, and it's also doing good.

Work here at the office is not too much, and my colleague is not there, which is never a bad thing. I like him, but I get along with him better when he's not here.

And I slept ok.
 
Status
Not open for further replies.
Top