Hi Mark,
No answers, but a few comments for you to consider:
1) By my count on TradeStation you have something like 27,000 bars of
data. That might be too much data allowing Builder to find some really
sweet trades which end up dominating the results. What happens to the
returns when you throw out the top and bottom 5% of trades and look at
the 90% remaining?
2) In my experience I'd reduce population size and up the generations.
Maybe 500/20 instead? Should be roughly the same amount of compute
time.
3) You don't say whether you had and IS-OOS setting in Builder. If you
didn't, try it. If you did then what was the date where you changed
and did you reset the runs based on any criteria?
4) I think the real thing you need to determine is whether the results
fell off after 1 month because the model died or did the character of
the market change? What would happen if you built new models using
data from 1/1999-1/2001 and then looked at the results over the last
11 years? Would there be times where the models excelled and other
times where they failed?
Good luck,
Mark
I have taken a different approach with the OOS. Instead of discounting it,
I have reserved an additional set of OOS data, an OOS-2, if you will.
As an example, I am using five and a half years of 30 minute bars for the
strategy. I am using 4 years for the IS, and 1 year for the OOS. If (and
only if) I find something I like (I have about 12-15 things I look at before
I decide if I like something), then I will look at the OOS-2 period from the
last 6 months. If that 6 months fails, then the strategy is rejected. No
exceptions.
In spite of my rigor here, I have still terminated (for poor performance)
about 1/3 of the strats that made it through this process. This has given
me about 5-6 strategies that seem to be working for me.
I can't say I have seen the strategies "quickly fade", although in the 6
months I have been working with them, there have been some ebs and flows. I
do monitor them individually by reviewing their equity curves, maximum
drawdowns, maximum consecutive losses, total profit, average profit per
trade, etc. If they fail to perform in these areas, then I can and do
suspend them.
I also have a few additional tests I run on the strategies before letting
them do actual trading for me. I have found many of the AB strategies are
incomplete (to me), and they do not have certain protective stops, profit
taking exits, time exits, etc. So I run some tests to see if I can limit my
risk or increase my gain by adding some extra code in these areas. I have
created simple strategy modules (similar to the TS strategy modules that do
just one type of exit), and I add them to the chart that has the AB strategy
I am testing. So far this has been helpful, and I sometimes keep one of the
modules active with the AB strategy.
I was also testing some market condition filters to see if there are times
when a trade should not be taken. When I was working with strategies that
produced a higher number of trades, I saw some potential here, but the 5
years of 30 minute bars have not given me the confidence to insert any of
the filters because the number of trades would be reduced to the point where
I am concerned about over-fitting.
Steve
*********************************************************
Strategy Traders Forum - A place where TradeStation users
can share ideas and resources for their mutual benefit.
www.strategytraders.org
*********************************************************
So, what might be? Well, there are lots of other metrics that
characterize trading systems. The question is, which ones are
predictive, not which ones look nice in retrospect. Take a look at
some of the work at meyersanalytics.com
Mike Bryant
-----Original Message-----
Subject: Re: Strategies quickly fade
I can tell you a "robustness" feature I would like to see.
I would like to see all of the strategy combinations coded in some way so
they can be recognized as a unique strategy. I am not talking about the
parameter settings. I know this sounds overwhelming, but even if a strategy
combination was labeled as "ACEFG" or longer, it would let us answer some
questions about the viability of the parameters. For example, if on
separate IS and OOS summary pages, we found that 52 versions (i.e.,
different parameters) were used on a single strategy, we would have more
confidence the strategy was not just finding a peak performance point.
Perhaps an easier approach would be to have AB scan the strategy list and
identify how many different strategies there are and how many parameter
variations there are.
This would make it easier to pull out the robust strategies. It would also
give us something we can filter and manipulate in excel so those of us with
different outcome criteria can view things differently. It would also make
it much easier to take the more robust of the core strategies and test their
optimization ranges. Those that look good can easily be run through a WFO.
Steve
I’ve talked about this a bit before on the forum, I believe. If it were only a matter of updating the metrics, it’d be done. Unfortunately, adding constraints for the build metrics will require a major reworking of parts of the build algorithm and will require some research/experimentation. Those familiar with optimization theory and algorithms know that constrained optimization is probably an order of magnitude more difficult than unconstrained optimization. It’s on my list, though.
The problem with adding multiple items on the reset on OOS performance option is that the more you add, the closer the OOS segment comes to being in-sample data. Keeping it less restrictive means you’re violating the separation of OOS and in-sample less.
Mike Bryant
Subject: Re: Strategies quickly fade
As you update the build metrics, please consider allowing the capability to specify "greater than or equal to" and "less than or equal to"
A couple of ideas for you to consider down the road:
1) A program I bought years ago called Trading Solutions actually
divided the data into 3 regions. I forget the name of the regions but
the use was (more or less) as follows, keeping in mind that I haven't
used the program in at least 6 years:
a) In-sample data for model generation
b) A second area used for correlation. IIRC they used this second area
like you use your OOS area today when you do resets, but also checked
that the results correlated in some way with the IS region. (I.e. -
not that they just made money.)
c) A third area that was truly OOS.
I think someone else here (mandelmus maybe?) suggested 3 areas. Maybe
a model like that above would make sense for Builder some day.
The other thing I'd like to see, which I cannot imagine would be all
that difficult, is to make the OOS reset driven by some _percentage_
of whatever the IS parameter was. I.e. - Instead of resetting if
profit < 0, reset if OS profit/trade is less than 75% of whatever the
profit/trade was IS, or even that the OOS fitness value is < 80% of
the IS fitness value, etc.. To me a good model OOS is one that
performs more or less like IS. Maybe a feature like that wouldn't be
as hard to integrate into your current setup?
And still, please consider something like Kelly Ratio as a single
Build metric. Targeting a Kelly Ratio range of 15%-20% for instance
could be pretty powerful.
Just some ideas.
Cheers,
Mark
On paper yes, but in real life no, that doesn't actually work very
well in Builder today.
Yes, you can set Builder to target those two values. Let's assume you
choose Avg. Trade = $200 & Avg. Win at $300. Builder unfortunately
emphasizes very heavily ANY solution that _exactly_ hits _one_ of
those values, creates a high fitness number, and then eliminates
solutions that have come close to both values but not exactly hit
either one.
This would be my first use of the ">=" request in the metrics section.
If I told Builder I'd be happy with ANY solution that had an average
trade >= $175 AND an average win >= $250 then I've effectively set a
minimum ratio that I'm happy with and Builder can keep the solutions
that are most appropriate for my interests.
Cheers,
Mark
Mike Bryant
-----Original Message-----
Subject: Re: Strategies quickly fade
With regard to whether it might be useful as a metric or whether we could
accomplish the same thing by maximizing both the win/loss ratio and the
percentage of wins, the result is likely to be different if you maximize
Kelly. If you simply include the win/loss ratio and the percentage of wins
as build metrics in Builder, they'll be added together in a linear
combination, which is how the fitness is computed. This will produce a much
different function of those two metrics than the Kelly formula provides.
Therefore, maximizing the Kelly formula may give different results than
maximizing the fitness composed from the two metrics.
I'll be adding a bunch of new metrics to the next release, including Kelly.
Mike Bryant
-----Original Message-----
Subject: Re: Strategies quickly fade
Rick, glad to see the Kelly fraction coming up in the feature requests
again, but are you sure that's the right formula? I have code a Kelly
optimization metric into NinjaTrader and Multicharts, but the formula
I used was Kelly f = W -((1-W)/R, where W = %wins, and R = avgWin/
avgLoss.
Actually, this is not quite correct since, technically, this formula
only applies to situations where the payoff is a Bernoulli
distribution, with all wins being the same size and all losses the
same size. You find this some gambling situations but not in
financial markets where profits and losses are all over the place. If
you want to target geometric growth when trading the markets, you are
supposed to use Optimal f. But I suspect this is a bit academic
since I don't think the calculated numbers are all that different - at
Really great news from my perspective. Thanks Mike! I look forward to
trying it out.
Without committing to anything, what's your best guess at a time frame
on the next release? Weeks? Months?
Cheers,
Mark
Spent a few days (weeks) now with this product - I'm an end of day
trader... I think it's clean this way having cash at the end of the
day.
I'm more interested in getting the methodology right - that I'm not
curve fitting in the method I apply to getting a working strategy.
I notice that most of the strategies I build - last only about one
month before they go bad.
So to prove myself right, I wrote a harness to apply my build
methodology to about 50 ETFs...
In summary it is:
* 10 minute bars from 2009 to 2011-09-30
* Default build goals and options
* Trade from 9:40 to 3:50
* Sample size of 2000 with 5 generations
* Retain top 400
From that group I got 19 working strategies.
NOW - to choose which strategy to trade I simply chose that with the
highest significance from the OOS set.. Am I curve fitting here ??
I ran the 19 through portfolio backtester in parallel and found that
they were good for one month.
As an aside, I repeated the exercise removing the "Trade from 9:40 to
3:50" and that group lasted til the end of December before going
bad...
What am I doing wrong? I'm thinking maybe I don't have a significant
number of trades?
I don’t believe anyone is suggesting using Kelly f for position sizing, which, as you note, is impractical to say the least. The idea is to use it as measure of strategy performance or fitness. For example, if you calculate the Kelly f value for a strategy based on trading single lots, a strategy with a Kelly f of 50% is presumably much better than one with a Kelly f value of 10%. Nothing to do with position sizing.
Mike Bryant
From: adaptrad...@googlegroups.com [mailto:adaptrad...@googlegroups.com] On Behalf Of James Tann
Sent: Sunday, March 11, 2012 7:46 PM
To: adaptrad...@googlegroups.com
Subject: Re: Strategies quickly fade
Am I missing something here? I have looked at the Kelley formula and would not use that as a fitness function or for any other criteria since the assumptions it uses are for essentially a normal curve and as we all know, this is far from the case. It is fun to see how much money one would make if they use Optimal F or a maximized Kelley, but my experience over the last 40 years is that is a certain way for your "risk of ruin" to be 100%. Anyone trading at anything near the optimal f or Kelley will surely blow out his account sooner or later. At least that is what I have read, studied and always thought was true. If I am mistaken, sure would like to understand this and why.
Mike Bryant
I don't want to over-emphasize any value there may be in including Kelly f
as part of the optimization process. My personal opinion is that the
bottom-line result may be no better than a simple weighted average of the
same metrics, which is what Builder currently offers. However, depending on
the metrics you choose for optimization, the math clearly shows that it's
different than optimizing a weighted average, which is the only point I was
making.
Mike Bryant
Not that it matters but I agree with everything you pointed out. The
only thing I'd consider in addition is that (in my mind) this isn't
about _only_ maximizing an individual metric like Kelly. For instance
one might look maximize for profit with a higher weighting while
minimizing Kelly with a lower weighting, etc. simply to investigate
what the solution space looks like and not necessarily to even find a
strategy to trade. If lower Kelly ratios produce better OOS results
then in general we gain info about where to put targets.
Where I'm personally interested is in what the solution space looks
like when you allow us to target ranges of build metrics. What do the
solutions look like with a Kelly target between 10-15% vs the
solutions between 20-30%, etc., giving no preference to any value
within the range. I.e. - 10% is as valid as 12.5% is as valid as 15%.
Now, way down the road, if you were couple targeting of ranges with
the ability to do resets based on something like a percentage of the
OOS vs. in-sample reset metric (i.e - Kelly OOS was 16% while Kelly
in-sample was 18%, etc.) I suspect we might move toward solutions
that begin to address the title of this thread, but I have no data to
back that up.
And thanks much for the release target dates. I'll consider it an
early, on-time or even late birthday (4/5) present! ;-)
Cheers,
Mark
Mike Bryant
Let’s see… I’m updating Builder, working on a cure for cancer, solving global warming, and ending world hunger. … Oh wait, I had to drop those last three because I’ve been busy with Builder.
Mike Bryant
Subject: Re: Strategies quickly fade
May I ask, which other projects are you working on?