Australian (ASX) Stock Market Forum

Howard Bandy "Quantitative Trading Systems" & systems design Q&A

Greetings all --

Some of you may be interested in reading the PowerPoint presentation of a talk I will be giving in Irvine, California, next Wednesday, May 7. "How to Build an Effective Trading System."

Download it here:
http://www.blueowlpress.com/NAAIM.html

I'll be happy to receive constructive comments. And I will discuss the points -- but probably not until after returning from the conference.

Thanks,
Howard
 
I ordered my copy on Thursday and it arrived the following Wednesday - awesome, as they say.

Howard, you note that Turtle Trading or Donchian channels are no longer successful as their use has now plugged the market inefficiency they exploited. Later you note that a particular system may no longer work because another system has 'plugged' an inefficiency.

The market surely neither knows nor cares what method the individual trader is using, and one sees and reads daily examples of 'irrational' market reaction to either breaking news, company reports or dividend announcements. Data charts of today appear to look identical to the charts printed in Schabacker or in Edwards and Magee - surely the same methods will continue to work - with the proviso that the trading opportunity will be much shorter because of computerised analysis??

On a different tack, your bibliography does not refer to Stridsman's book on Trading Systems and Money Management, which I found enormously illuminating when I first read it. Do you know it??

I am almost halfway through your text - very practical. And it is particularly helpful that you have posted the afl material on your website, thus eliminating the need for the poor reader to transcibe all the formulae into AmiBroker!

Your book is going to be one of my basic texts - thanks again!
 
Hi Skittle --

Thanks for the kind words.

I agree with you (if I understood you correctly) that systems that have failed when applied to longer holding periods may work for shorter holding periods.

And, you are correct in interpreting my thoughts that it does not matter whether it is your own trading of a system, or someone else trading of a system that is based on recognizing and removing the same inefficiency as yours -- the more either of those systems is traded profitably, the more difficult it will be for them to continue to be profitable.

Thanks for reminding me that I should reread Stridsman's work.

Thanks,
Howard
 
Hi, I am trying to build a system that I am comfortable with, no luck so far, but I am slowly learning. With walk forwarding I sort of understand the concepts bit not all of Amibroker such as CAS/MDD etc. What has me is what is No. after Begin and End. In all of the OOS it is 1. Maybe Howards new book will help. Any comments on the report would also be welcomed. Thanks
 
Hi, I am trying to build a system that I am comfortable with, no luck so far, but I am slowly learning. With walk forwarding I sort of understand the concepts bit not all of Amibroker such as CAS/MDD etc. What has me is what is No. after Begin and End. In all of the OOS it is 1. Maybe Howards new book will help. Any comments on the report would also be welcomed. Thanks

Hi Kesso --

There seem to be a couple of questions in your posting.

1. Is it CAR/MDD? CAR is Compound Annual Return. MDD is Maximum DrawDown. CAR/MDD is a good choice for many people to use as an objective function / fitness function / optimization target. It rewards equity growth while penalizing drawdown. Other good built-in metrics to use are RAR/MDD, RRR, Ulcer Performance Index, KRatio (which is almost the same as RRR).

2. The dates? Are you referring to the dates to enter in the walk forward setup? To get to that screen, use the Analysis menu, select Automatic Analysis, click the Settings button, and the Walk Forward tab.

If you are just starting, click Easy Mode EOD if you are using end-of-day data. Click Easy Mode Intraday if you are using bars shorter in time duration than a full trading day.
Start is the first day of the first in-sample period.
End is the last day of the first in-sample period.
Last is the last day of the last in-sample period. Or you can click Use today.
Step, and the pull down menu to its right, let you select the length of time between reoptimization periods. This is also the length of the out-of-sample period.
Now look down at the table that lists the dates that AmiBroker will use for each in-sample and out-of-sample period. You can see the organization. If you change Start, End, Last, or Step, you will see changes in the table.
Pick an Optimization Target from the pull-down menu. I recommend one of CAR/MDD, RAR/MDD, or RRR if you are uncertain. Those of you who have read my book, Quantitative Trading Systems, know how important the choice of objective function is, and that that choice should be made before serious testing begins.
Click OK to leave the Setup.
Use the pull-down menu next to the Optimize button and select Walk Forward Optimization. The walk forward runs will start.

For each of the steps, there will be two lines in the report.
The first line shows the results for the in-sample period, using the best set of parameter values when all of the runs are ranked using the objective function you chose.
The second line shows the results for the out-of-sample period that immediately follows that in-sample period. The same set of parameter values is used as in the line above it.

Incidentally, this is well explained, including screen capture images and worked out examples in my new book, Introduction to AmiBroker.

Hope this helps,
Howard
 
Hi Howard,

I'm enjoying reading your book and think its fantastic being able to contact an author of book through a forum.

I'm wondering if you can help me. When I run Figure 9.1 MA Cross System on ASX code GOLD, the equity line rises from July 2005, when a buy signal is issued, right up to the sell signal in August 2006. However, if you look at period from about September 2007 (the green vertical line) to May 2008 (the red vertical line) the equity line remains flat as the price of GOLD rises. Any ideas why that may be? I'm using AmiBroker 5.18.

Cheers,

CamKawa
 

Attachments

  • Capture_9.jpg
    Capture_9.jpg
    238.5 KB · Views: 40
Hi Howard,

I'm enjoying reading your book and think its fantastic being able to contact an author of book through a forum.

I'm wondering if you can help me. When I run Figure 9.1 MA Cross System on ASX code GOLD, the equity line rises from July 2005, when a buy signal is issued, right up to the sell signal in August 2006. However, if you look at period from about September 2007 (the green vertical line) to May 2008 (the red vertical line) the equity line remains flat as the price of GOLD rises. Any ideas why that may be? I'm using AmiBroker 5.18.

Cheers,

CamKawa

Hi CamKawa --

I can't tell from this distance.

If your program has an ApplyStop that was triggered, that would cause the long position to exit but would not give an arrow on the chart.

If that is not it, either post the code here or e-mail it to me in a private message and I'll look at it.

I'll be out of the the office for a few days. I am the opening speaker at a conference of the NAAIM (National Association of Active Investment Managers) in Atlanta, Georgia. You can download the PowerPoint of my talk. Go to www.blueowlpress.com and click on the NAAIM link.

Thanks,
Howard
 
If your program has an ApplyStop that was triggered, that would cause the long position to exit but would not give an arrow on the chart.
That's a good thought but I'm not using any stops.

If that is not it, either post the code here or e-mail it to me in a private message and I'll look at it.
The code I'm using is a copy and paste straight out of your book with no modifications. Figure 9.1, MACrossSystem.afl, page 128.

// MACrossSystem.afl
//
// The classic Moving Average crossover
// using simple Moving Averages
//
// Set up the lengths for the moving averages
Length1 = Param("Length1",6,1,81,2);
Length2 = Param("Length2",35,2,200,2);

// The Moving Average calculations
MA1 = MA(C,Length1);
MA2 = MA(C,Length2);

// The Buy and Sell logic
// Buy when MA1 crosses from below MA2 to above MA2.
Buy = Cross(MA1,MA2);
Sell = Cross(MA2,MA1);

// Compute the equity for the single ticker
e = Equity();
Maxe = LastValue(Highest(e));
Plot( Close, "Price", colorBlack, styleCandle );

// Plot the MA lines.
Plot(MA1,"MA1",colorGreen,styleLine);
Plot(MA2,"MA2",colorBlue,styleLine);

// Plot the Buy and Sell arrows.
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes(shape, IIf(Buy,colorGreen,colorRed), 0, IIf(Buy,Low,High));

// Plot the equity curve
Plot(e,"Equity",colorBlue,styleLine|styleOwnScale,0,Maxe);
Plot(10000,"",colorBlue,styleLine|styleOwnScale,0,Maxe);
GraphXSpace = 5;

//Figure 9.1 MA Cross System

I copied and pasted this into the formula editor, saved it, then dragged and dropped it straight onto the chart.

You can download the PowerPoint of my talk. Go to www.blueowlpress.com and click on the NAAIM link.
Thanks.
 
That's a good thought but I'm not using any stops.


Thanks.

Hi CamKawa --

Keep reading from page 128 on.

The code is an example of the traditional wisdom about buying when the fast moving average is above the slow moving average is usually wrong.

With almost any ticker, this system with these parameters loses money. The equity line stops moving because the equity dropped too low to take any more trades.

Look at page 131 where you change the PARAM to OPTIMIZE. The values that it finds to be somewhat profitable have the relative speed of the two moving averages reversed. Buy when the fast moving average crosses from above to below the slow moving average.

In other words, a moving average crossover system is often best used as a mean reversion system, rather than as a trend following system.

Thanks,
Howard
 
Hi Howard,

In your book, you mentioned several potential candidates for the objective function using the existing AB metrics. My question relate to the statistical measure of the smoothness and/or choppiness of the equity curve when its turned parabolic. After all, even for a fairly modest system that returns 5-10%pa will turn parabolic if you give it enough time purely just from compounding alone.

Howard, in your opinion, are there any metrics (AB provided or otherwise) which are more suited to the evaluation of a parabolic equity curve than others ??
 
Hi Bing --

Using percentage changes rather than price changes -- that is, using a log scale rather than a linear scale -- changes the parabolic equity line to a straight line.

Alternatively, do not compound the equity. Set the amount committed to each trade to a fixed dollar amount rather than a percentage amount. The resulting equity line will be linear, not parabolic.

But, for most testing, even a parabolic curve is linear in the region being examined.

For still better control, at greater effort, process the trade results yourself. You may be able to just load the ~~~Equity and process it, or you may have to use Custom Backtester.

Thanks,
Howard
 
Hi Bing --

Using percentage changes rather than price changes -- that is, using a log scale rather than a linear scale -- changes the parabolic equity line to a straight line.

Alternatively, do not compound the equity. Set the amount committed to each trade to a fixed dollar amount rather than a percentage amount. The resulting equity line will be linear, not parabolic.

But, for most testing, even a parabolic curve is linear in the region being examined.

For still better control, at greater effort, process the trade results yourself. You may be able to just load the ~~~Equity and process it, or you may have to use Custom Backtester.

Thanks,
Howard

Many thanks Howard, I'll try out some of your suggestions.
 
Howard, have you got any plans to write another book? If so what can you tell me about it?
 
Greetings --

Yes, I am writing now. The title will be Advanced AmiBroker. It will focus on portfolio management, risk assessment, position sizing, and similar topics. Implementation code will be AmiBroker. Some advanced programming concepts in AmiBroker, such as Custom BackTester, will be covered. The contents are still a little fluid. You can see the details as they are posted on hte book's website:
www.advancedamibroker.com

Thanks,
Howard
 
Greetings all --

We are in the process of reorganizing and freshening our websites. There will probably be periods when some of the pages will be unavailable. To ease your inconvenience, both of our books, "Quantitative Trading Systems" and "Introduction to AmiBroker" have their prices reduced by $10.00 for a short time.

Thanks,
Howard
www.quantitativetradingsystems.com
www.introductiontoamibroker.com

Greetings --

Quantitative Trading Systems -- the book -- has been updated to reflect additions that have been made to AmiBroker since the book's publication.

The information in QTS related to the design, testing, and validation of trading systems has not changed. But, since the publication of QTS in April 2007, some significant and powerful features and tools have been added to AmiBroker. This addendum brings the Quantitative Trading Systems book up to date with respect to those features.

Specifically, the ones addressed in the addendum are:
1. The Mersenne Twister random number function.
2. Automatic walk forward testing.
3. Non-exhaustive optimization.

The errata file has also been brought up to date.

Anyone who wishes to can download a copy of the addendum. It is a 10 page long, 1.3 MB, pdf file. It can be found at:
HTTP://www.quantitativetradingsystems.com/book.html
Click on the link labeled: Addendum and Errata

Beginning today, all orders for the QTS book will have a printed copy of this file included with the book.

The websites for Blue Owl Press, Quantitative Trading Systems, Introduction to AmiBroker, and Advanced AmiBroker have been rewritten and reposted. When we started refreshing the web sites a few weeks ago, we put both the Introduction to AmiBroker book and the Quantitative Trading Systems book on sale at $10 off. Many of you have taken advantage of that sale -- thank you. That sale will end on Monday, June 8.

There may still be some bugs in the web sites. If you find any, let me know at howard at blueowlpress dot com.

Thanks,
Howard
 
I've started to look at backtesting some basic ideas in Amibroker. However, I've no real idea what I should be looking for in all the results, which ratios or values in the reports are more important than others (and what the ratios actually mean), which one's I should be paying particular attention to and also what 'typical' values I should hope to be getting for a system that's considered to be 'reasonable'.
Would Howard's book address my issues above? Or maybe his new 'Introduction to Amibroker' might be more appropriate? What do people think who have read the book(s)? (Or Howard if he's around).
Thanks
 
Hi Chesl --

Have you read Quantitative Trading Systems? It explains in detail the importance of selecting an objective function that fits your trading. Once you have done that, decide what to trade, when to trade, what kinds of orders to use. Then work on entries and exits. After that you will be ready to do some testing, backtesting, optimization, and validation.

The process starts with the objective function.

There is a little in Introduction to AmiBroker about trading system design, but much more in Quantitative Trading Systems.

Thanks,
Howard
 
Thanks Howard. Expect an order for the book.
In fact, I believe you're in Melbourne next week.
I'm not going to the workshops/conference but do you have your
books available for sale in a lunch break or something? It would be
good to pop over and get it and save on postage.
 
Hi Chesl --

I am in Melbourne. The ATAA Conference wrapped up today, and I am catching up on emails. I did not see your posting in time to respond before the conference started. We did have books for sale at the conference, and they have all sold out. I hope you were able to stop in and pick up a copy. If not, the best way to get a copy is order it from the book's website and we will ship it when we return to the US about November 13.

Thanks,
Howard
 
Top