Why use AmiBroker?

No matter which platform I chose, some people would be disappointed.  Some would prefer an English language description.  Some an artificial pseudo-langauge.  Some the language of only their favorite platform.  Some several of the most widely used languages.

One of the reasons I am publishing is to give system developers an alternative to imprecise trading advice, unrealistic promises, financial astrology, and smoke and mirrors.  The examples must be coded in the language of one of the popular trading system development platforms.  Readers must be able to replicate my results and use the examples as templates for further development and testing on their own.  I chose AmiBroker because:

  1. It is capable of performing everything I wanted to do (I do not know of another reasonably priced platform that can).
  2. It is free to try and inexpensive to buy.  The trial version can do everything I describe in the free Introduction to AmiBroker book.
  3. It has a very clear and concise language that should be easily understood by anyone who is reasonably comfortable programming in a modern computer language or for a different trading system platform.

You can get an idea of AmiBroker’s language:

  • From the sample chapters of my books (see the Books page of this website).
  • Every month, the trader’s journal Technical Analysis of Stocks and Commodities publishes the code corresponding to one of their articles for a dozen of the most popular trading system development platforms.  The AmiBroker code is usually the shortest, clearest, and easiest to understand.

For those people who are not already familiar with AmiBroker and who want to test the techniques I describe:

  1. Download the free trial version of AmiBroker from the AmiBroker website.
  2. Download and read the free Introduction to AmiBroker from that book’s website. It has complete instructions for installation, setting up databases, and using the platform in both charting mode and analysis mode.
  3. Paste in some of the AmiBroker code I provide and try it out.  For example, try this mean reversion system based on RSI.  It is reasonably stationary over a long period of time and works on many broad market and sector ETFs.  (It is for demonstration only, and is Not trading advice

// RSIExampleForBlog.afl
//

// System settings
OptimizerSetEngine( "cmae" );
SetOption( "Initialequity", 100000 );
MaxPos = 1;
SetOption( "MaxOpenPositions", MaxPos );
SetPositionSize( 10000, spsValue );
SetOption( "CommissionMode", 3 ); // $ per share
SetOption( "CommissionAmount", 0.005 );
SetOption( "ExtraColumnsLocation", 1 );
SetTradeDelays( 0, 0, 0, 0 );
BuyPrice = Close;
SellPrice = Close;

// Parameters
// Good values have been: 2, 37, 5
RSILookback = Optimize( "RSILookback", 2, 2, 10, 1 );
EntryLevel = Optimize( "EntryLevel", 37, 1, 99, 1 );
ExitIncrement = Optimize( "ExitIncrement", 5, 1, 99, 1 );

// Indicator
RSIValue = RSIa( C, RSILookback );

// Rules

// Buy when RSI falls through a critical level
Buy = Cross( EntryLevel, RSIValue );

// Sell when RSI rises
ExitLevel = EntryLevel + ExitIncrement;
Sell = Cross( RSIValue, ExitLevel );

// end //

AmiBroker is used extensively in the Quantitative Trading Systems book and the Mean Reversion book. The code for both those books is available for download, copy, and paste. Whichever platform you decide to use, please use sound modeling and simulation techniques to give realistic estimates of future performance of your system. Use the risk-normalization procedures fully explained in Modeling Trading System Performance to compare alternative uses of your funds.

 

Leave a Comment