[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Pattern Filters - was Auto Optimization



PureBytes Links

Trading Reference Links

Andrew,

In a broad sense, I guess that any indicator is nothing more than a
pattern, but what I had in mind was a bit more simplistic.

We can look at graphical representations of all the popular
indicators, and visually many of them look like natural bets. But when
 you set up your backtests, few (if any) "work out of the box".

So the trick is to carefully examine the charts and try to ferret out
why the indicators work so well in certain situations but fail so
miserably at other times.

For example, if you are working with a pullback .(pb). to a moving
average system, what patterns related to the pb might be involved that
enhance the predictability of the pb.  One factor might be:

* Volatility of the price action during the pb

Backtest the effect on those pb's where it only took one or two days
to touch the ma. A high volatility pb  might indicate material bad
news related to the pb.

Then backtest those pb's where it took 2, 3, 4 or more days of
successive lower closes, lows or highs to gently move back to the ma.
So your pattern might be Ref(C, -3) < Ref(C, -4) [repeated -2 to -3,
-1 to -2, C to -1].

Similar pattern setups can be tested with volume numbers.

Seemingly insignificant price or volume patterns can make the
difference in a mech system, and sometimes there may not appear to be
any logic to it, but backtests with large numbers of setups and over
long periods of time can confirm this.

With the introduction of ranking and scoring, some patterns might be
able to be converted into scores to determine the effectiveness and
consistancy of sequential repetative patterns.

I'll post a bit more on something similar to this later.

Phsst






--- In amibroker@xxxxxxxxxxxxxxx, "Andrew" <a.perrin@xxxx> wrote:
> Phsst
> You mention "pattern Filters" & "Pattern Matching".  Could you 
> elaborate, perhaps with some AFL examples.  I've seen the Double Top 
> & Head and shoulders in the AB Library, is this the type of thing 
> your suggesting.  
> Thanks
> Andrew
> --- In amibroker@xxxxxxxxxxxxxxx, "Phsst" <phsst@xxxx> wrote:
> > <...the general vibe was that this strategy and settings were and 
> had
> > been somehow golden for forever. (of course I'm exaggerating; these
> > are smart, unpretentious people, but the underlying logic still 
> seemed
> > like that to me.)>
> > 
> > Dave,
> > 
> > Before I start here I'll preface my comments with the disclaimer 
> that
> > I am relying on memory which is not a particularly reliable thing
> > where I am concerned...
> > 
> > You're a bright guy. But don't I recall that you posted as 
> recently as
> > two or three weeks ago that you have not yet developed a profitable
> > mechanical trading system using AB? Hey, I could be wrong and if I 
> am
> > then I apologize.
> > 
> > I should probably stop here and wait for a response, but time is 
> not
> > on any of our sides, so I'll press on <g>...
> > 
> > I would speculate that your original premise was correct in that a 
> few
> > people here do in fact have strategies and settings that have been
> > reliable over a *very* long period of time and that there is no
> > exaggreation in that assumption.
> > 
> > < but I kept hearing things like "CCI(something)", and "MA(this) 
> cross
> > MA(that)", with some single test and/or optimization period to 
> back it
> > up.>
> > 
> > You cannot judge anything based upon what you think you have heard
> > here. If nothing else, you can count on the fact that those who 
> have
> > good profitable trading systems here are NOT going to part with 
> them
> > easily.
> > 
> > <I concluded that what you'd  recommend depended to a huge degree 
> on
> > what dates you looked at. that's one of the main reasons why I 
> wrote
> > this, to automate optimization over a bunch of time periods, and 
> see
> > if things stayed constant and/or profitable.  neither. 
> sowhattheheck.?
> > 
> > My advice is to quit taking the recommendations of others, and quit
> > assuming that anything depends to a 'huge degree' upon what dates 
> are
> > looked at.
> > 
> > I'll go even further in a positive direction:
> > 
> > Look at conventional wisdom related to indicators, but NEVER STOP
> > THERE... be sure to go the extra distance and complicate the issue 
> by
> > adding EXTRA pattern filters to your backtests.
> > 
> > By combining conventional wisdom with pattern filtering, you might
> > discover that there are in fact long term strategies that make
> > predictable profits under known mkt conditions. 
> > 
> > As usual, I always take too long to get to my point...
> > 
> > You have abandoned the basic search for 'root' strategies in favor 
> of
> > developing a complex 'auto optimization' piece of code that seeks 
> to
> > ferret profits out of improbable strategies.
> > 
> > Here is my advice to you...
> > 
> > Focus upon backtesting basic technical strategies combined with
> > pattern matching. Then, only after you find promising trading
> > opportunities should you seek to optimize the various aspects of 
> the
> > stradegy.
> > 
> > I might be wrong, but I suspect that all of your effort related to
> > this 'auto optimization' code is not going to yield you any results
> > until you have done the more basic task of developing 'core'
> > strategies that show promise.
> > 
> > Again, as usual I've talked too much and worn out my welcome.
> > 
> > Best regards,
> > 
> > Phsst
> > 
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "Dave Merrill" <dmerrill@xxxx> 
> wrote:
> > >   Isn't there some aspect of past performance (results) that can
> > "persist"
> > > for some time.  That is to say, that a stock or mutual fund that 
> is
> > > profitable for awhile (esp from a backtest or ranking 
> perspective)
> > does not
> > > and probably will not remain profitable "forever".  However, it 
> can
> > and does
> > > remain a good performer for some period.
> > > 
> > > you'd think so, wouldn't you? what's the point of backtesting
> > anything ever,
> > > if the future can't be at least kind of, sort of, approximately,
> > > semi-fake-estimated from what happened in the past?
> > > 
> > > but I kept hearing things like "CCI(something)", and "MA(this) 
> cross
> > > MA(that)", with some single test and/or optimization period to 
> back
> > it up.
> > > people didn't usually talk about optimizing over one time 
> period, then
> > > testing with those optimal settings for a while *after* that, 
> then
> > > optimizing again later, etc.. the general vibe was that this
> > strategy and
> > > settings were and had been somehow golden for forever. (of 
> course I'm
> > > exaggerating; these are smart, unpretentious people, but the 
> underlying
> > > logic still seemed like that to me.) when I optimized some of 
> those same
> > > things myself, over different time periods, I concluded that 
> what you'd
> > > recommend depended to a huge degree on what dates you looked at.
> > that's one
> > > of the main reasons why I wrote this, to automate optimization 
> over
> > a bunch
> > > of time periods, and see if things stayed constant and/or 
> profitable.
> > > neither.
> > > 
> > > sowhattheheck.
> > > 
> > >   What parameter(s) measure this?  It probably changes over time 
> but it
> > > seems a combination of return along with absence of large 
> volatility
> > is a
> > > key measure.  The UPI or UI or even CAR/Mdd seems like it 
> captures
> > more than
> > > just raw return.  While this seems more true for mutual funds 
> (actively
> > > managed ones at that), it can also be true for certain stocks in 
> certain
> > > industries.
> > > 
> > > 
> > > 
> > >   Just rambling out loud..I have not had time to try your
> > system----can it
> > > optimize against CAR/Mdd? for example?
> > > 
> > > 
> > > 
> > >   Ken
> > > 
> > > as shipped, the framework comes with two metrics to choose from,
> > profit per
> > > bar, and net bars on the right side of the market per bar, 
> meaning
> > basically
> > > this:
> > >   ((bars long and rising + bars short and falling) - (bars long 
> and
> > falling
> > > + bars short and rising)) / number of bars
> > > 
> > > both metrics can penalize the score by a selectable percentage 
> of max
> > > drawdown. for instance, at zero penalty, MDD doesn't effect the
> > score; at
> > > 50%, 20% MDD reduces the score by 10%; at 100%, by 20%.
> > > 
> > > you can also add your own metrics, AND OBVIOUSLY YOU SHOULD, 
> because
> > neither
> > > of these are that great, or none of the trading rules tested 
> are, or
> > > something. another one I've thought of is some kind of measure 
> of the
> > > smoothness of the equity curve, which is MDD is a crude look at.
> > many of the
> > > standard metrics are something of a pain to code on the results 
> of the
> > > Equity function. hopefully, at some point tomasz will give us 
> AB's full
> > > suite of report metrics, as functions that work off Equity.if you
> > haven't
> > > check the framework out yet, I'd suggest waiting for the
> > new-and-improved
> > > v1.1, due out soon.
> > > 
> > > dave


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/