Portfolio Optimization

Discussions about the testing and simulation of mechanical trading systems using historical data and other methods. Trading Blox Customers should post Trading Blox specific questions in the Customer Support forum.
Forum Mgmnt
Roundtable Knight
Roundtable Knight
Posts: 1842
Joined: Tue Apr 15, 2003 11:02 am
Contact:

Post by Forum Mgmnt » Thu Jul 20, 2006 7:44 pm

If one tested with enough data and used the same numbers across markets I think this can make sense.

I find that the character of short moves and long moves is definitely different. There are good human psychology reasons for this. You don't get the equivalent of a bubble blowoff in a move down. Move's like Gold and Silver recently never happen in inverse.

- Forum Mgmnt

BARLI
Roundtable Knight
Roundtable Knight
Posts: 650
Joined: Sat Jan 17, 2004 6:01 pm
Location: USA

Post by BARLI » Thu Jul 20, 2006 8:23 pm

has anyone done any research about what side trends more: long or short? In stocks , there's a tendancy to go Long , since Mutual Funds and "investors" never short stocks. In futures it's a different story, I dont think that there are 50/50 trends up and trends down, of course it all depends how we define the trend, what time frame, etc...

ecritt
Roundtable Knight
Roundtable Knight
Posts: 134
Joined: Sat Aug 28, 2004 3:44 am
Location: Phoenix, AZ
Contact:

Post by ecritt » Thu Jul 20, 2006 11:05 pm

RedRock wrote:Forum Mgmnt,

I am curious as to your thoughts on optimizing the same set of rules on a portfolio with different parameters for long and short entry and exit. Is this curve fitting, or do longs and shorts deserve different parameter sets?

Thanks,
rr
I can't make a case for this with respect to short-term or medium-term systems. However, for very long-term systems the basic rules of arithmetic come into play. The downside is less than 100% while the upside is potentially unlimited. In this sense the expectancy of going short is fundamentally different from that of going long.

Forum Mgmnt
Roundtable Knight
Roundtable Knight
Posts: 1842
Joined: Tue Apr 15, 2003 11:02 am
Contact:

Post by Forum Mgmnt » Thu Jul 20, 2006 11:15 pm

With respect to there being a 100% limit to going short in futures this is sometimes not the case.

I remember having a gentlemen's argument with Rich Dennis about this as I was short sugar at 6.50 or so. He said, "How low can it go?". I told him that I kept picking up 1.5 to 2 cents every time I rolled and that that could keep going indefinitely. It turned out I made about 9.5 cents in a little over a year shorting Sugar from 6.5.

So I guess this was about 150% short. It was also an extremely easy move to ride as almost no one was shorting and it was very smooth.

- Forum Mgmnt

BARLI
Roundtable Knight
Roundtable Knight
Posts: 650
Joined: Sat Jan 17, 2004 6:01 pm
Location: USA

Post by BARLI » Thu Jul 20, 2006 11:40 pm

c.f. what year was that sugar trade?

Forum Mgmnt
Roundtable Knight
Roundtable Knight
Posts: 1842
Joined: Tue Apr 15, 2003 11:02 am
Contact:

Post by Forum Mgmnt » Fri Jul 21, 2006 9:21 am

It actually started before we started in 1983 but went on for over a year in 1984 and 1985.

- Forum Mgmnt

rabidric
Roundtable Knight
Roundtable Knight
Posts: 243
Joined: Mon Jan 09, 2006 7:45 am

Post by rabidric » Fri Jul 21, 2006 10:59 am

great thread. i see the pros and cons for individual vs group optimization, but here is something i thought of, as a possible weakness in combined portfolio optimization.


say you take a simple one size fits all approach to parameter optimizing, you need to be aware that you are open to considerable skew in the contribution of some markets over others.

e.g. your optimizer spits out 41/264 MA cross combo or whatever , as the best parameters for a 20 strong portfolio over the last 10 years, but when you look closely you see that 50% of your profits came from a couple of large size trades in short rates that went forever in one direction.

ok so the example is contrived, but my point is that by using one-size fits all, you may end up with a bunch of products that just tick over, offering little profit contribution compared to a few big hitting products , and also offering little additional diversification benefits when you look into it deeper.

of course,in the future any product could have it's day in the [super trending]sun, but if you have unwittingly biased your parameters towards soaking up long trends in rates and these then range for the next decade while remaining products(c.f.'s group 2 perhaps) start having explosive medium term trends with harsh retraces/capitulations then your long term optimized system is gonna fall on it's ass.

it probably wouldn't hurt to take these historically lame duck products for your one size fits all strat/params , and assign them their own subset parameters(though not necessarily different params for each one).

stancramer
Roundtable Fellow
Roundtable Fellow
Posts: 60
Joined: Sat Feb 07, 2004 10:34 am
Location: Washington DC

Post by stancramer » Fri Jul 21, 2006 12:04 pm

There are a few well-known, standard procedures for avoiding the Scary Monster that rabidric describes:
  • Backtest over many many years of past history
  • Test (and trade) a large portfolio having at least five markets from each of the eight commodity sectors
  • Use an optimization criterion that prizes smoothness of the equity curve, such as the R-squared correlation between the equity curve and a perfectly straight line
  • Apply minimum-liquidity filters, to keep illiquid runts like Propane and Milk and LIBOR out of the portfolio
The great advantage of testing a lot of markets over a lot of time is that it shows you whether or not you've got a repeatable, long-lived "edge". Two or three good trades in two or three temporarily hot markets, won't make much of an impact on a 45 market portfolio tested for 18 years. Instead, what you'll see is the average performance of the average market, times 45.

Additionally, if you emphasize smoothness (as institutional investors do), when a system has an accidental supersized monster huge profit trade in a small portfolio (so the big guy isn't diluted by 44 other little guys), the resulting kink-up in the equity curve is penalized, not rewarded. A smooth equity curve provides a smooth ride with few bumps and jounces (drawdowns), which is what institutions crave. Many individuals prefer a smooth ride too.

Turtle40
Roundtable Knight
Roundtable Knight
Posts: 201
Joined: Wed Oct 19, 2005 1:53 pm
Location: Guernsey, Channel Islands

Post by Turtle40 » Fri Jul 21, 2006 2:47 pm

From my experience testing combinations of markets in trend type systems, I have found that "less can be more".
By which I mean that I try to avoid the highly corrlated markets within each group.

I recently deleted HU from my portfolio because of its correlation to CL, and also the SF went as well due to the correlation with EC.
What I found is that although the overall returns may be slightly lower, drawdowns decreased more, giving an improved MAR value.

I rationalise this by the fact that with highly correlated markets, they tend to give signals on the same day, and if the trades go wrong, then it magnifies losses. Of course the opposite is true for winners.

I have found that a portfolio of 16 markets that a)trend best, and b)are as little correlated to each other, produces consistently better results with all the trend based systems, as oppose to all 38 standard TB futures.

Perhaps this is a form of incorrect optimisation, but it does seem to work.

-Turtle40

BARLI
Roundtable Knight
Roundtable Knight
Posts: 650
Joined: Sat Jan 17, 2004 6:01 pm
Location: USA

Post by BARLI » Fri Jul 21, 2006 6:54 pm

no one wanted that sugar at 1984-1985 period, turned out to be a good short trade
Image

you mean you got those "extra" 3 cents profit from the differences between different contract months(SBN84, SBV84 etc) when you rolled them?



rabidric, I also noticed that flaw of portfolio optimization when 2 or 3 trades will make most profits in Eurodollar or whatever that trends well and will be ranked #1 in optimization results. Has anyone been thinking that there's a commodity market that should be used as "standard" market and its parameter would closely fit all other markets for profitability?

Forum Mgmnt
Roundtable Knight
Roundtable Knight
Posts: 1842
Joined: Tue Apr 15, 2003 11:02 am
Contact:

Post by Forum Mgmnt » Fri Jul 21, 2006 7:22 pm

BARLI wrote:you mean you got those "extra" 3 cents profit from the differences between different contract months(SBN84, SBV84 etc) when you rolled them?
Precisely. since everyone thought the price wouild go up, the farther out contracts were always 1.5 to 2.0 cents higher so I'd exit a 5 and roll into a short positin in the new contract a 6.5 it would drop to 5 and I'd do it again. Smooth trend, easy to ride. I was short 1,200 contracts for almost a year.

- Forum Mgmnt

rabidric
Roundtable Knight
Roundtable Knight
Posts: 243
Joined: Mon Jan 09, 2006 7:45 am

Post by rabidric » Wed Jul 26, 2006 12:45 pm

ok this is a bit of a topic drift but

stancramer wrote:[*]Use an optimization criterion that prizes smoothness of the equity curve, such as the R-squared correlation between the equity curve and a perfectly straight line




Many individuals prefer a smooth ride too.


sure sure, you are quoting from educated traders standard wisdom. though that path has it's own demons.

consider the following assertion on the essence of speculating:

"over time, participants get rewarded for taking on risk that others do not wish to bear"

now consider , that if you are giving too high a priority to optimizing smoothness in historical results, you are actually removing large chunks of risk from the raw performance by drilling down on problematic periods.

paradoxically, this has the effect of removing excess return:risk from the strategy in walkforward application , as you succumbed to the basic human nature of risk aversion in the application of your historical optimization.

It is my opinion that to make standout return:risk you must be prepared to have a rough ride, and take paths that others would rather steer clear of(e.g. in your optimising do not go out of your way to prioritize smoothness).

FYI i trade a portfolio of just 3-6 mkts where i prefer to slightly fit the strat to each mkt, and i can use more than one single strat per mkt. i execute intraday to control offside positions. the older i get the more i become skeptical of large sample size backtest optimization. for each mkt i prefer to break history into episodes and rank recent episodes more highly. i then review every 6 months to check for loose trends in parameter creep, and refit somewhere in the middle of a projected parameter "bucket" for each mkt.

this approach outperforms a simulation 5yr walkforward from 2000 i did of a large multimarket portfolio optimized for smoothness over 15years to 2000. go figure.

like i said before, great thread, keep it goin.

BARLI
Roundtable Knight
Roundtable Knight
Posts: 650
Joined: Sat Jan 17, 2004 6:01 pm
Location: USA

Post by BARLI » Wed Jul 26, 2006 1:24 pm

I've,personally, never tried to optimize equity qurve, that's a pure curve fitting, its no use for a trader. Recently, I got W.D. Gann's old courses dated back to 20's -50's to get some fresh ideas(at least for me cos I've never seen his stuff). It was confirming that each market has its own personality. Back at Gann's days they traded Eggs, he was talking about "adjusting" his system for the Eggs market. rabidric, nice thoughts about folks not willing to take a trade and those who take it are usually rewarded.

Forum Mgmnt
Roundtable Knight
Roundtable Knight
Posts: 1842
Joined: Tue Apr 15, 2003 11:02 am
Contact:

Post by Forum Mgmnt » Thu Jul 27, 2006 4:03 pm

rabidric wrote:It is my opinion that to make standout return:risk you must be prepared to have a rough ride, and take paths that others would rather steer clear of(e.g. in your optimising do not go out of your way to prioritize smoothness).
This is probably the first time I've seen anyone state this very important truth.

There is no doubt in my mind that systems and styles which offer a rougher ride will hold up more over the long run because not as many traders and certainly almost no institutional money wants the ride.

You will make more money if you can take the pain. Unfortunately, you will make little or none if you think you can but it ends up that you can't.

- Forum Mgmnt

BARLI
Roundtable Knight
Roundtable Knight
Posts: 650
Joined: Sat Jan 17, 2004 6:01 pm
Location: USA

Post by BARLI » Thu Jul 27, 2006 4:28 pm

Forum Mgmnt wrote: You will make more money if you can take the pain. Unfortunately, you will make little or none if you think you can but it ends up that you can't.

- Forum Mgmnt
I believe it should put a bit differently:
You will make more money if you can take the TRADE others dont want to take. Unfortunately, you will make little or none if you think you can but it ends up that you can't.


From your sugar trade example, you were shorting while others were sceptical of shorting it and wanted to buy(kept scaling up on the way down) and that actually caused them lots of pain while you were making money. I like the sentence:

If there's a lot of pain, there's No gain

RedRock
Roundtable Knight
Roundtable Knight
Posts: 941
Joined: Fri Jan 30, 2004 3:54 pm
Location: Chicago

Post by RedRock » Thu Jul 27, 2006 5:03 pm

c.f. and company,

Would it be possible to build a routine into TBB which could track parameter drift and graph the trend?

Can 'robustness' as measured with walk fwd data, be reduced to a single number. Which could be used to optimize on the parameter set which is not smoothest, most profitable etc, but which has in actuality, showen to be the most robust?


rabidric wrote:ok this is a bit of a topic drift but




FYI i trade a portfolio of just 3-6 mkts where i prefer to slightly fit the strat to each mkt, and i can use more than one single strat per mkt. i execute intraday to control offside positions. the older i get the more i become skeptical of large sample size backtest optimization. for each mkt i prefer to break history into episodes and rank recent episodes more highly. i then review every 6 months to check for loose trends in parameter creep, and refit somewhere in the middle of a projected parameter "bucket" for each mkt.

this approach outperforms a simulation 5yr walkforward from 2000 i did of a large multimarket portfolio optimized for smoothness over 15years to 2000. go figure.

.

stancramer
Roundtable Fellow
Roundtable Fellow
Posts: 60
Joined: Sat Feb 07, 2004 10:34 am
Location: Washington DC

Post by stancramer » Thu Jul 27, 2006 5:06 pm

rabidric wrote:It is my opinion that to make standout return:risk you must be prepared to have a rough ride, and take paths that others would rather steer clear of(e.g. in your optimising do not go out of your way to prioritize smoothness).
For many people (institutions etc), the word "risk" is defined to be "standard deviation of returns". In other words, roughness-of-the-ride. Using this definition it is literally impossible to make standout return:risk ratios with a rough ride; the rougher the ride, the worse the return:risk ratio.

You can discard this definition of risk and instead just think about "return:risk ratios" themselves. They are equally well described as "gain:pain ratios". A smoother equity curve gives less pain, thus a bigger gain:pain ratio. A bumpier equity curve gives more pain, thus a smaller gain:pain ratio. If you want large return:risk, trade in a way that gives large gain:pain. Strive for smoothness.

Now if you want large returns and are willing to disregard pain (bumpiness of the ride), you have more options. There are lots of trades that the smoothness-seekers shun. You can take these trades. Some of them are profitable and a few of them are mega-profitable. Trading Natural Gas futures with a wide stop might be one example.

You may well achieve high returns, but most institutional investors won't want to allocate capital to you.

Another idea, slightly crazy-sounding, is to find a smoothness-seeker and fade him. Take the opposite side of his trades and/or his trading strategy. Here is a guy who obviously seeks smoothness: http://www.iasg.com/SnapshotPT.asp?ID=753 He tells you what strategy he uses; do the opposite, accept a bumpy ride, and you may get large returns.
Attachments
ngchart.png
Natural Gas futures, 2002-2003
ngchart.png (10.72 KiB) Viewed 10951 times

Jason
Roundtable Fellow
Roundtable Fellow
Posts: 57
Joined: Sat Apr 26, 2003 10:31 pm
Location: Oakville, Canada
Contact:

Post by Jason » Thu Jul 27, 2006 6:28 pm

Sign at the local drycleaner:

Cheap, Fast or Good - pick any two.


Trend trader's version:

Return, Robustness, Low Risk - pick any two.

:D

BARLI
Roundtable Knight
Roundtable Knight
Posts: 650
Joined: Sat Jan 17, 2004 6:01 pm
Location: USA

Post by BARLI » Thu Jul 27, 2006 9:36 pm

i'd pick robustness and low risk...

stan, trading Natural Gas with wide stops can get the one wiped out very quickly with its volatile moves. do you operate for an institution? what did you want to show by the NG chart?

rabidric
Roundtable Knight
Roundtable Knight
Posts: 243
Joined: Mon Jan 09, 2006 7:45 am

Post by rabidric » Fri Jul 28, 2006 3:04 am

Jason- very nice analogy


Stan, - ok online this is gonna come across as a bit aggressive against your posts, apologies, but here goes:

"The Industry" is awash with analysts and reports and expert opinion. It would have you believe that they can give you edge. The truth is that no prop trader worth his salt gives a rat's ass for any of that.

Likewise "the industry" would have you believe that narrow definitions on risk (e.g. standard deviation of returns) are the final word. These things are reinforced in every undergrad Economics course in the world practically. i think one should be wary of such conditioning( i've walked that path).

Now in Asset Allocation, that theory does have it's place, but i prefer looser definitions in my own trading.

e.g. risk=expectancy of loss (short term risk)
risk= expectancy of ruin(long term risk)

when i say expectancy of ruin, what i mean is, both the chance of it happening, and how much "ruin" will cost you.

e.g. if you and your investors know what you are getting into, it is quite viable to trade a strategy that returns 50% per year, but once every ten years it blows out and leaves you with only 30% of your capital. ok contrived, but it illustrates the point.

the punchline: i believe things are rarely what they seem. excessive focus on controlling short term risk or open equity variation, in my experience, will have the counterintuitive effect of increasing long term risk and instability.

Most things have a tradeoff. if there doesn't appear to be a tradeoff, chances are you just can't haven't seen it yet - and it is VERY bad...

it's like a version of 50/50/90: anytime you have a 50/50 chance of being right about something :) - there is a 90% chance you will be wrong. :cry:


within the hedge fund industry itself, the limitations of sharpe ratio style risk evaluation has been long known. some people play around with semi standard deviations etc, but any single narrow definition will restrict your vision really and compromise your evaluation if you don't look at things from a broader perspective.


final thought:
Consider the ultimate "Run winners, cut losses" holy grail system, where all losers were just a "scratch", and winners went on for months with a loose trailing stop. your profit:loss ratio is infinite, and there is zero risk of loss on any closed equity. but....measured by std dev rets, the open equity swings and open profit give back or open equity drawdown, this system probably wouldn't look so hot. in fact it might get overlooked at a casual glance. But more sophisticated investors would be Breaking Down Your Door if you could actually do it.

Getting backing for decent CAGR with highish Drawdown is not too hard if you approach the right people. The public is not the right people.

Jason- evidently i pick Return and Robustness.

8)

Post Reply