• No results found

A Mi

N/A
N/A
Protected

Academic year: 2021

Share "A Mi"

Copied!
608
0
0

Loading.... (view fulltext now)

Full text

(1)
(2)

systems for your favorite markets — stocks, mutual funds, exchange traded funds,

commodities, or Forex. It is powerful, flexible, inexpensive, and easy to use.

This book is for:

• Someone new to AmiBroker looking for detailed instructions and examples to get set up and started.

• An experienced AmiBroker user who wants a printed reference to commonly used tools.

• Someone looking for an introduction to the AFL language, and using AmiBroker to write trading systems.

Writing trading systems Testing trading systems Optimizing trading systems Validating trading systems

Topics covered include:

״ Installing AmiBroker Setting up free databases

״ Setting up subscription databases ״ Setting up real-time databases • Charting stocks, funds, futures ״ Applying chart tools

Chapter 3 - 3 0 Minutes to Useful Results ־ has 10 example projects that parallel the tutorials, each of which can be done in just a few minutes.

6. Run a Single Stock Backtest 7. Run a Portfolio Backtest 8. Optimize a Trading System 9. Perform Walk Forward Validation 10. Scan for Buy and Sell Signals 1. Chart a Stock

2. Apply a Trendline 3. Plot a Moving Average 4. Make a Watchlist 5. Run an Exploration

Dr. Howard Bandy has both the formal education and practical experience required to write this book. He has degrees in mathematics, physics, engineering, and computer science. He was a university professor of computer science and mathematics, vice-president and designer of the major product for a company that produced programs for stock selection and timing, and senior research analyst for a commodity trading advisor where he held a Series 3 license.

He is the author of the very well received Quantitative Trading Systems - a book that uses AmiBroker to illustrate more advanced trading system topics. He is a regular and popular speaker and author on topics of trading system design and testing.

$US 39.95 I S B N 9 7 8 - 0 9 7 9 1 8 3 8 1 - 2

9 1 o u r 1y 1odo i c

This is the book you need if you

are looking for a step-by-step

introduction to AmiBroker.

(3)

Introduction

to

(4)

Introduction

to

AmiBroker

Advanced

Technical Analysis

Software

for

Charting and

Trading System

Development

Howard B. Bandy

(5)

of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, pho-tocopying, recording, or otherwise without the prior written permis-sion of the copyright holder, except brief quotations used in a review. AmiBroker is a trademark of AmiBroker and Tomasz Janeczko. Windows, Excel, and Notepad are trademarks of Microsoft. Premium Data is a trademark of Norgate Investor Services. QP3 and QP Feed are trademarks of Quotes Plus.

DTN IQ Feed is a trademark of DTN.

ISBN-10: 0979183812 ISBN-13: 9780979183812 LCCN: 2008905105 Published by Blue Owl Press

3700 S. Westport Avenue, #1876 Sioux Falls, SD 57106

Published 2008

Printed in the United States

(6)

This book is an educational document. Nothing in this book is intended as, nor should it be construed to be, investment advice.

The views expressed herein are the personal views of Dr. Howard B. Bandy. Neither the author nor the publisher, Blue Owl Press, have any commercial interest in any of the products mentioned. All of the prod-ucts described were purchased by the author at regular retail prices. Investing and trading is risky and can result in loss of principal. Nei-ther this book in its entirety, nor any portion Nei-thereof, nor any follow-on discussion or correspondence related to this book, is intended to be a recommendation to invest or trade mutual funds, stocks, commodities, options, or any other financial instrument. Neither the author nor the publisher will accept any responsibility for losses which might result from applications of the ideas expressed in the book or from techniques or trading systems described in the book.

The programs used as examples have been tested and are believed to be correct. Even so, this book may contain typographical errors and other inaccuracies. Past performance, whether hypothetical, simulated, back-tested, or actual, is no guarantee of future results. Results will depend on the specific data series used. Please verify the accuracy and correct-ness of all programs before using them to trade.

(7)

Tomasz Janeczko, author of AmiBroker. Thank you for creating an out-standing program, and for graciously allowing use of materials pub-lished in the AmiBroker user documentation.

Bruce Robinson and William Barack. Thank you for the many stimulat-ing discussions, encouragstimulat-ing comments, and conference presentations, all of which helped motivate and shape this book.

Robert Grigg. Thank you for the many stimulating discussions and ex-change of ideas, and for raising awareness of AmiBroker in Australia. Particular thanks for permission to use the schematic of AmiBroker that you developed.

(8)

Preface and Introduction xiii Section I — Getting Started 1 Chapter 1 — Overview of AmiBroker 3

Chapter 2 — Installation 11 AmiBroker in Trial Mode 13

Default Database 13 Block Diagram of Database 14

Database Setup - End-of-Day 14 Free Database Using AmiQuote 15 Subscription Data Providers 31 Database Setup - Intra-Day and Real-Time Data 41

Free Intra-Day Historical Data 41 Delayed Real-Time Data 43

Real-Time Data 44 Tick Data 53 Chapter 3 — 30 Minutes to Useful Results 55

Example 1 - Chart a Stock 57 Example 2 - Apply a Trendline 61 Example 3 - Plot a Moving Average 65

(9)

Example 5 - Run an Exploration 72 Example 6 - Run a Single Stock Backtest 78

Example 7 - Run a Portfolio Backtest 87 Example 8 - Optimize a Trading System 91 Example 9 - Perform Walk Forward Validation 98 Example 10 - Scan for Buy and Sell Signals 103

Section II — Charting 105 Chapter 4 — AmiBroker Chart Structure 107

Windows Layouts 108 Block Diagram I l l Chapter 5 - The GUI - Graphical User Interface 113

Charts 116 Display a New Price Series 116

Default Chart 117 Active Pane 117 Price and Value Axis 117

Date and Time Axis 118 Scroll Through Dates 118

Pane Size 118 Zoom 119 Bar Interval (Periodicity) 119

Select a Quote 120 Mark a Range 120 Remove the Range Markers 120

Add a New Pane 121 Close Any Pane 121 Reorder the Panes 121 Chart Pane Context Menu 122

Parameters 122 Edit Formula 127 Properties 129 Pull-down Menus 130

(10)

Edit Menu 134 View Menu 135 Insert Menu 139 Format Menu 141 Symbol Menu 142 Analysis Menu 146 Tools Menu 147 Window Menu 149 Help Menu 150 Toolbars 151

Tools for General Use 151 Tools for Drawing 154 Study Tools 157 Add Icons to Toolbar 159

Tabbed Menus 160 Re-dockable Menus 160

Auto-hiding Sliding Menus 160 Layouts, Layouts Tabbed Menu, Layouts Context Menu 162

Layers, Layers Tabbed Menu, Layers Context Menu 163 Symbols, Symbols Tabbed Menu, Symbols Context Menu ...165

Charts (Formulas) Tabbed Menu, Charts Context Menu 168 Notepad, Notepad Tabbed Menu, Notepad Context Menu ..170

Interpretation, Interpretation Tabbed Menu 171 Alert Output, Alert Output Context Menu 172 Real-Time Quote Window, Context Menu 173

Time and Sales Window 175

Categories 177 Group - Market - Sector - Industry 177

Category Membership 177 Category Assignment 178

Watchlists 179 Adding Watchlists 180

Removing Watchlists 180 Adding Symbols to Watchlists 181

(11)

Removing Symbols from Watchlists 183

Erasing Watchlists 183 Hiding and Unhiding Empty Watchlists 184

Using Watchlists in Automatic Analysis Window 184

Importing a Watchlist from a File 186 Exporting a Watchlist to a File 187

Renaming Watchlists 187 Charts (Formulas) 190 Basic Operations 190 Averages 195 Bands 198 Basic Charts 200 Custom 203 Equity 203 Include 204 Indicators 205 Systems 224 Section III — Analysis 227

Chapter 6 - Technical Analysis 229 Chapter 7 - Trading System Development 233

Define the Objective Function 234 Decide What to Trade and How to Trade It 235

Design the Trading System 235 Determine the Length of the In-Sample Period 236

Determine the Length of the Out-Of-Sample Period 236

Decide What to Optimize 237 Perform Walk Forward Runs 237 Evaluate the Out-Of-Sample Results 238

Trade the System 239 Monitor the Results 239

(12)

AFL Editor 243 Pull-Down Menus 243

AFL Editor Toolbar 246 AFL Editor Context Menu 248

AFL Language 249 Arrays 249 BarCount 250 Array Operations 250 Language Basics 252 Operators 253 Operator Precedence 254

Array Subscript Operator 256 Compound Statements (Blocks) 256

Conditional If IIF) 256

Variables 257 Reserved Variables 257

User Defined Functions, Procedures, Scope 258

Local, Global 259 Flow Control 261

Flags 269 AFL Function Reference 271

Lowest / Highest 271 Math Functions 275 Moving Averages, Summation 285

Statistical Functions 289 Basic Price Pattern Detection 294

Composites 300 Indicators 304 Exploration / Indicators 319

Date / Time 342 Time Frame Functions 352

Information / Categories 361 Referencing Other Symbol Data 372

(13)

String Manipulation 386 Trading System Toolbox 394 Low-level Graphics 421 Miscellaneous Functions 443 Chapter 9 - Analysis 477 Quick Review 478 Automatic Analysis 481 Main Window 481 Settings Button 484 Explore Button 493 Backtest Button 496 Context Menu 502 File Button 508 Equity Button 508 Report Button 509 Optimize Button 511 Walk Forward 518 Commentary 524 Chapter 10 - Write It Yourself 529

Appendix A — Glossary 545 Appendix B — Industries and Sectors 557

Appendix C — Resources 561 Appendix D — Block Diagram 567

Index 569 Order Information 591

(14)

This book is intended to be a tutorial. Topics included and detail cov-ered involved compromises between elementary and advanced, nar-row and broad, superficial and in-depth. Those chosen are practical examples of tasks that you will be performing regularly. For additional tutorials, watch the on-line tutorial videos, available at

http://www.ami-broker.com/tutorials. For a more complete reference, see the AmiBroker

User's Guide and the AmiBroker Reference, both available at http://www.

amibroker.com.

This book is task oriented, rather than software oriented. Many opera-tions can be performed in more than one way. W h e n making a choice, clarity was chosen over efficiency. This book is not intended to be read cover-to-cover, as a novel would be read. It is intended to be a series of tutorials and reminders covering operation of AmiBroker.

The examples use a lot of screen capture images, annotated with n u m -bered steps, highlights, and arrows. The book includes reference to all the functions, indicators, and tools documented in the User's Guide and in the Help system.

INTENDED AUDIENCE People wanting:

• Description of AmiBroker.

• Description of the capabilities of AmiBroker. • Tutorial on installing and setting up AmiBroker. • Tutorial on setting up databases with free data.

(15)

• Tutorial on setting up subscription end-of-day databases. • Tutorial on setting up real-time data feeds.

• Tutorial on the basic charting.

• Tutorial and reference on the Graphical User Interface - GUI. • Tutorial on applying formulas and indicators to charts. • Tutorial on the AmiBroker Formula Language - AFL. • Introduction to technical analysis.

• Introduction to design of trading systems. • Tutorial on backtesting trading systems. • Tutorial on optimizing trading systems. • Tutorial on validating trading systems. • Examples of trading systems.

• Printed reference for AmiBroker structure, menus, tools. A S S U M P T I O N S

While this book is intended to be a tutorial on AmiBroker, the reader is expected to be reasonably familiar with:

• Computer operations.

• Basic techniques used with the Windows operating system, such as the menu system, drag-and-drop, navigating through the file system.

• A basic text editor, such as Windows Notepad. • A spreadsheet, such as Excel.

• Basic trading methods and terminology. W H A T YOU WILL FIND IN THIS BOOK

SECTION I - GETTING STARTED. An overview of AmiBroker - its features and capabilities. Tutorials describing the installation of AmiBroker, set-ting up databases using free end-of-day and intraday data, setset-ting up databases using subscription end-of-day data (for US and Australian markets), and setting up databases using subscription real-time data. There are ten examples of useful things you can do with AmiBroker in just a few minutes, even if you are using the trial version. These range from manipulating the charts to applying on-screen indicators to test-ing and optimiztest-ing tradtest-ing systems. Everythtest-ing is laid out, click-by-click, with screen captures to illustrate each step.

(16)

S E C T I O N I I - C H A R T I N G . Each of the menus and toolbars that work with

charting is expanded and explained.

T O P I C S I N C L U D E :

• Displaying charts.

• Adding visual studies, such as trendlines, to a chart. • Adding formulas and technical indicators to a chart. • Using parameters with indicators.

S E C T I O N I I I — A N A L Y S I S . The Analysis section begins with a short

in-troduction to technical analysis and trading system development. That is followed by an introduction to AFL - AmiBroker Formula Lan-guage, including its structure and syntax. AFL is used to write code to create your own custom charts and trading systems. This section is part tutorial, part programming manual, part reference manual. The use of the Automatic Analysis tools, including backtest, optimiza-tion, and walk forward validaoptimiza-tion, are explained.

Several ready-to-use programs you can use as starting points for your own system development are included.

T H E A P P E N D I X E S . Provide reference material.

I N D E X . Menus, commands, tools, and techniques are extensively

in-dexed.

W H A T Y O U WILL N O T F I N D I N T H E T H I S B O O K

AmiBroker has so much to offer that this book could easily have been expanded by several hundred pages. Readers looking for coverage of topics such as the Custom Backtester, Dynamic Data Exchange, low-level graphics, scripting, and the Automated Trading Interface will have to wait for another book. Readers looking for coverage of topics such as different types of trading systems, trading system testing, trad-ing system validation, and the creation of C++ routines and Dynamic Link Libraries are referred to the author's companion book, Quantitative

Trading Systems (see Appendix C, Resources). S O M E C O N V E N T I O N S

AmiBroker can be used with any tradable, including stocks, mutual funds, closed end funds, exchange traded funds, commodities, futures,

(17)

and Forex. For ease of writing and reading, the terms stock, symbol, issue, or ticker are often used to mean any tradable issue. When it is important to distinguish between different tradables, specific details are given.

AmiBroker is distributed and used world-wide. With the exception of setting up the database to reflect the local tradables and exchanges, most of the operations of AmiBroker are independent of location. The author resides in the United States and most of his experience is with trading in the US, which may shape some of the perspective of this book. Apologies in advance for any inadvertent mistakes or misleading statements due to his limited background - no discrimination of any kind is intended.

VERSIONS USED

AmiBroker 5.10.0 and later. AmiQuote 2.00.

AmiBroker is regularly expanded and improved. During the life of this edition of this book, the features, capabilities, screens, and commands, will undoubtedly change somewhat. Every attempt was made to write in such a way that the book will be useful for a long time and will not soon become obsolete as new versions of the program are released. But there will be changes in the program that are not reflected in the book. For the latest and official documentation, please refer to the latest edi-tions of the AmiBroker User's Guide, the on-line help files, and the tuto-rials, all of which can be found on the AmiBroker web site: http://www.

nmibroker.com.

T H E A U T H O R Dr. Howard Bandy:

• Has university degrees in mathematics, physics, engineering, and computer science.

• Has specialized in artificial intelligence, applied mathematics, modeling and simulation.

• Was professor of computer science and mathematics, and a university dean.

• Designed and programmed a well-known program for stock selection and timing.

(18)

Section I

(19)

You are visitor #

573881

e January 1st, 2002

««M18st j finks

AmiBroker

for Windows 95/98/Me/NT/2k/XP

mws \ t t a w r f e d 1 <w3«r i subpart

Technical analysis software you've been dreaming of...

First Impression Features Customer Testimonials ^ y Re^ster ל AmiBroker list i e n t e r your email

AmiBroker works with Signal (REAL TIME quotes)

! ׳ F E E D

(REAL TIME quotes) AFKIUATES Quotes Plus (EOD quotes) RECOMMENDED interactive Brokers Interactive Brokeis (REALTIME quotes) myTrack

(REAL TIME quotes) TCEOOO.com (EOD quotes) INVESTORS־ FastTrack (EOD quotes) Click h e r e for c o m p l e t e list of s u p p o r t e d d a t a s o u t c e s Swdfaap f׳art*a» Methods C h e c k n e w b o o k " Q u a n t i t i v e T r a d i n g S y s t e m s " b y H o w a r d B. B a n d y . New! AmiBroker 5.10 Featuring automatic Walk-Forward Testing,

Multi-monitor floating charts, symbol and interval linking, drag-and-drop indicator

creation, True Portfolio Backtesting and

Optimization with scaling and multiple currency

handling, free Fundamental data, Multiple

Time-Frame support, 3D optimization charts, new Account manager, automated trading interface, volume profile, object-oriented

ן charting, drawing layers, multi-window layouts, f formula-based alerts, easy-to-use formula editor,

equity function, unique composite indicators, built-in web research browser, direct link to : eSignal, Interactive Brokers, IQFeed, myTrack,

FastTrack, QP2. TC2000, any DDE compliant feed, MS and more . > Download FREE TRIAL

S t a n d a r d Search !keyword Welcome Features Testimonials Download AmiBroker Ami Quote Purchase Benefits Standard vs. Professional Edition Buy ori-lirie l Custom'*^ *! indicators -^1IWllffH; «• - •יי'־ ן-J""iX.׳; Support

User's Guide Professional

$279

Other materials one-time fit AFL Library

AFL Reference

Reasons why we are better than competition

• FEATURE RICH - the most complete set of

features available plus we add new features every day on user request.

• SPEED - highest quality technical analysis

software running 10 times faster than other competing products

• RELIABILITY and ACCURACY - thoroughly

tested and used every day by community of thousands of traders, fund managers, etc Our backtester can reproduce virtually any trading strategy with real-life accuracy

• FLEXIBLE - you won't be limited by the

software anymore With AmiBroker the limit is just your imagination. AmiBroker is Incredibly tweakable and can be adjusted to fit your personal trading needs

• COST-EFFECTIVE ־ not only license fee is iow but also you get four consecutive free upgrades, free support, free plug-ins and

add-ons, and last but not least, you can also use FREE DATA from a number of sources AmiBroker is one of the best investments you can make to improve your trading Knowledge Base DevLog (News blog) Users' KB AmiBroker YahooGroup Wish list Current to-do list Suggest a feature International Czech version Polish version http://wwzv.amibroker.com

(20)

Overview of AmiBroker

AmiBroker is a powerful, comprehensive trading system development platform. It has cutting edge charting and graphics, and fast, flexible and powerful portfolio-level backtesting, optimization, and automated walk forward validation. Its purpose is to help investors and traders identify profitable opportunities to buy and sell. It includes an exten-sive library of technical indicators that can be plotted along with the price chart as well as tested for profitability in a trading system. It has all the tools needed to chart, test, and trade stocks, mutual funds, com-modifies, and Forex.

AmiBroker has two primary modes of operation - charting and for-mula evaluation. The data it works with are the price and volume re-cords of buy and sell transactions for stocks, mutual funds, and other tradable issues.

In its charting mode, historical price and volume data are displayed on the computer monitor along with technical indicators. The analyst looks for promising patterns and conditions.

(21)

In its formula evaluation mode, patterns, conditions, and rules are de-scribed using a programming language and written into a computer program. The program analyzes the price and volume data and reports on the profitability of the rules. When profitable trading systems have been found, it scans the group of stocks that are of interest to the trader and lists the current buy and sell signals. If desired, AmiBroker can send orders based on these signals directly to a broker for execution. AmiBroker is unique among trading system development platforms in that the same code displays the indicators, tests the profitability, issues the buy and sell signals and sends the orders. It is an easy transition from chart to analysis to execution.

AmiBroker runs under Windows, including versions 95, 98, Millen-nium, 2000, NT, XP, and Vista. Both 32 bit and 64 bit operating systems are supported.

Any system that runs Windows efficiently will run AmiBroker effi-ciently.

PROFESSIONAL AND STANDARD EDITIONS

• Both support intraday as well as end-of־day data • Standard meets most needs

• Professional is required for Tick charts

־ MAE / MFE charts • 64 bit

Unlimited real-time quotes

D A T A FEEDS

• Accepts data from any exchange in the world

• Close integration with major subscription data vendors Quotes Plus • TC 2000 FastTrack eSignal myTrack • IQFeed Interactive Brokers

(22)

• AmiQuote downloader provides access to free end-of-day quotes from major world exchanges

• Built-in importer for MetaStock format data • ASCII import wizard reads any data format

DATABASES

• End-of-day data • Intraday data

• Any number of databases • Any number of symbols • Add or remove issues

• Split and distribution adjustment • Unlimited history of price quotes • Quotation editor

• Company information • Fundamental information

PERFORMANCE

• Fast execution of AFL code • Fast chart drawing

• Robust and stable

CHARTING

• Multiple chart panes • Multiple time frames • Live updating

• Intraday, daily, weekly, monthly • Line, bar, candlestick

• Fast zooming and scrolling • Custom or automatic scaling • Built-in indicators

Simple moving average Exponential moving average Adaptive moving average • Rate of change (ROC)

(23)

Moving Average Convergence-Divergence Oscillator (MACD)

• On Balance Volume (OBV)

Commodity Channel Index (CCI) Money Flow Index (MFI)

Bollinger Bands Stochastics

Parabolic Stop and Reverse (SAR) Relative strength

• Overlay indicators over price charts • Overlay indicators over other indicators • Configurable indicators

• Drag and drop tools • Chart study tools

Trend lines

Regression channels Text on chart

Fibonacci retracements Gann squares

• Chart studies are saved with the chart • Charts independently scalable

A F L ( A M I B R O K E R FORMULA LANGUAGE)

• Designed for charting and trading

• Over 200 built-in building-block functions Pattern-detection Averages Statistical Pre-defined indicators Data manipulation Trade management

• Extensive library of pre-written code

• Create your own indicators, trading systems, and commentar-ies

• Single code base for indicators, systems, commentaries • User-defined functions

(24)

• Unlimited nesting of function calls • Local and global variables

• Multiple time frames • Indicator builder

Create and plot indicators

Control axes, scales, color, line style • Show Buy and Sell signals on charts • Code stored in clear-text

• Built-in formula editor • Any editor can be used

• Debugging, tracing, and profiling tools

• Extendable through Dynamic Link Libraries (DLL)

ALERTS

• Formula-based alerts • Display to screen • Play sound • Send e-mail

• Send order to automated trade execution

SCANNING

• Review your database for your buy and sell signals • Time window can be specified

EXPLORING

• Search your database for conditions you specify • Report results

• Multiple-key sorting

BACKTESTING

• Test profitability of trading system

• Single issue or group of issues you define • Long, short, or both

• Buy and sell arrows on charts • Built-in trailing exits and stops • Realistic slippage and commission

(25)

• Portfolio level fully supported • Position sizing

• Optimization

Full search of parameter space Non-exhaustive search

Particle Swarm Optimization (PSO)

Covariance Matrix Adaptation Evolutionary Strategy (CMAE)

Single issue or portfolio • 3-D presentation of results • Multiple time frame • Equity curve creation

• Equity curve input to trading system • Walk forward testing

• Over 20 built-in metrics • User-definable metrics • Fast execution

• Detailed reporting • Report explorer

• Export results for further analysis

A U T O M A T E D T R A D I N G

• Interfaces to on-line brokers

SCRIPTING

• Jscript (JavaScript)

• VBScript (Visual Basic Scripting) • Scripts embeddable in AFL programs

• OLE (Object Linking and Embedding) Automation • Call COM (Component Object Model) objects from AFL • Create and automate database management tools

CONFIGURABILITY

• Almost everything is configurable and customizable • Charts can be arranged as you wish them to be • Not tied to a specific exchange or data provider • Indicators are parameter driven

(26)

ACCOUNT MANAGER • Track your investments

• Calculate commissions, dividends, deposits, withdrawals INTERNET INTEGRATION

• Built-in web browser for company research • Configurable settings

PERFORMANCE

• Very fast redrawing of charts • Fast execution of AFL code PRICING (AS OF AUGUST 2 0 0 8 )

• Fully functional, no cost 30 day trial • New one-time license:

• Standard Edition: $199 Professional Edition: $279

• Free upgrades for one year from purchase

• Renewal license (to continue upgrades): half price ORDERING

• Visit http://wzvw.mnibroker.com/order.html. This secure site ac-cepts your payment using any major credit card, check, or bank transfer.

DELIVERY

• After paying the registration fee, you will receive a personal-ized keyfile by e-mail. Installing the keyfile converts your trialware version to a registered version. No other downloads are required. No other delivery method is supported.

SUPPORT

• Unlimited support for installation issues via e-mail • Unlimited support for basic usage issues via e-mail • Interactive help anywhere in AmiBroker (F1 key) • AmiBroker website support page

(27)

On-line video tutorials (the URL is for one example - there are many)

http://www.amibroker.com/video/uicustomize.html

On-line Users Guide

http://www.amibroker.com/guide/

Knowledge base - provided by AmiBroker

h tip:!'/www. amibroker. cotn/kb/

Users Knowledge Base - provided by user community

h tip:/lwww.amibroker.org/userkb/

Yahoo discussion forum - over 7700 members - over 1000 mes-sages a month

(28)

Installation

AmiBroker runs under Windows, including versions 95, 98, Millen-nium, 2000, NT, XP, and Vista. Both 32 bit and 64 bit operating systems are supported.

All versions of AmiBroker - trial and registered, standard and profes-sional, end-of-day and real-time - begin with a visit to the AmiBro-ker web site and downloading the installation file. Using your Internet browser, visit http://www.amibroker.com, then select the download tab. Select either the file for a New and complete installation or an Upgrade installation. If this is your first installation of AmiBroker, choose the New installation. Download the file to your computer - the New instal-lation is about 7 MB. When the download is complete, double-click the installation file (AmiBroker510.exe, or the latest version) to run the Ami-Broker Setup Wizard. Follow the directions and answer the prompts.

(29)

AmiBroker

for Windows 95/98/Me/NT/2k/XP

• NEW! AmiBroker 5.10 (official release)

Stock charting and analysis program, t r i a l w a r e , 32-bit Windows version. W o r k s on both 32־ and 64־ bit Windows.

U n i v e r s a l i n s t a l l e r for BOTH S t a n d a r d a n d P r o f e s s i o n a l v e r s i o n s .

If you are using Windows 95, Internet Explorer 4 or higher must be installed. Find out more

File V e r s i o n R e l e a s e d a t e S i z e P l a t f o r m D e s c r i p t i o n NEW! 5.10 (5.10.2) J u n e 15, 2 0 0 8 7MB W i n d o w s Vista, W i n d o w s XP, W i n d o w s 2000, W i n d o w s Me, W i n d o w s NT, W i n d o w s 98, W i n d o w s 9 5

NEW AmiBroker 5.10 official release,

Standard & Professional Editions, Full s e t u p with program, help and example files.

Self E x t r a c t i n g EXE S u i t a b l e f o r FIRST TIME REGISTERED a n d FREE TRIAL u s e r s . [AmiBroker 5.10! 5.10 (5.10.2) J u n e 15, 2 0 0 8 7MB W i n d o w s Vista, W i n d o w s XP, W i n d o w s 2000, W i n d o w s Me, W i n d o w s NT, W i n d o w s 98, W i n d o w s 9 5

NEW AmiBroker 5.10 official release,

Standard & Professional Editions, Full s e t u p with program, help and example files.

Self E x t r a c t i n g EXE S u i t a b l e f o r FIRST TIME REGISTERED a n d FREE TRIAL u s e r s . 5.10 (5.10.2) J u n e 15, 2 0 0 8 7MB W i n d o w s Vista, W i n d o w s XP, W i n d o w s 2000, W i n d o w s Me, W i n d o w s NT, W i n d o w s 98, W i n d o w s 9 5

NEW AmiBroker 5.10 official release,

Standard & Professional Editions, Full s e t u p with program, help and example files.

Self E x t r a c t i n g EXE S u i t a b l e f o r FIRST TIME REGISTERED a n d FREE TRIAL u s e r s . NEW! AmiBroker 5.10 UPGRADE ONLY 5.10 (5.10.2) June 15, 2008 6MB All s y s t e m s UPGRADE ONLY

MEW AmiBroker 5.10 official release, Standard & Professional Editions, U p g r a d e distribution with program, help files. S e l f - E x t r a c t i n g EXE This is FOR USERS OF PREVIOUS VERSIONS.

Both AmiBroker and this author recommend accepting the default op-tions and file locaop-tions during installation.

When the installation is complete, launch AmiBroker. The installation will have created an AmiBroker icon on your desktop. Just double-click that. When AmiBroker starts, it displays a message that it is Standard Edition and Unregistered. This is the trial version, but will be instant-ly converted to Registered (and Professional Edition, if you requested that) when your AmiBroker Registration file is processed.

(30)

M i

Symbol Analysis look ffilndow Help O i 5 . • ״: ׳יסנ! י s A f ! 12,837,1, -״>״•״ J | | | 120 0; ^ 60.0j«׳ 0 0! ® mm ^ roi * 'J "DJI (Daily) x

/ "DJI - Daily 8/31/2007 Open 13240 8, Hi 13472 3. Lo 13240 8, Close 13357 7 (0 9%) Vol"27.316.100 M^cio&e/16) = 13.1 ״i glle gdlt yiew Insert Fjymat

ם »־u® m i > יי

harts י ם x -V-nteb ; \ Utytn '. j Charts

70 O t ) August־

,,.. 111 i l l

׳ ג

™W»ll

(Version 5.10.2. Build date Jun 15 2008) UNREGISTERED- DOES NOT SAVE CHANGES! Advanced technical analysis sottwa Copyright ® 1995-2008 AmiBroker.cc

http //www.amibroker a [email protected] [email protected] For more information visit;

Technical support: Bug reports

;s Microsoft active scripting technologies This progra A

wv^

1Kebfuan, | 1׳DJI-RSI( 15) = 51.59

vY /

M

• M :\ Sheet 1 / 1. ׳ 1 . '•>. V.I 1e<f :: \ Sheet •1 ''), 2hec׳r ׳, >. ־:J»>•! 1• \ Sheet ? \ Sheet 0 / - - : J Averages J Bands J Basic Charts J Custom ב Equity J Include J Indicators J Systems / Example / ExampleRotational interpretation י ם Interpretation jffoiapad I Price Date: 8/31/2007 Price and moving averages: ~DJI(DOW JONES INDUSTR) has : closed above Its Short time movng average. Short Bme movng average is currently below mid-time, AND below long dme moving averages.

The relationship between price arid moving averages is: neutral

SS.FJ.. Help,!;

AMIBROKER IN TRIAL M O D E

AmiBroker in trial mode is fully functional with a few exceptions. • The trial version will run only 30 days. To run longer than

that, it must be registered.

• When processing multiple symbols, the maximum in the trial version is five; the registered version handles an unlimited number.

• Changes, particularly to the database, will not be saved. Also, if you modify one of the chart panes, the changes you made will not be saved when AmiBroker closes.

DEFAULT DATABASE

When you install AmiBroker, a small database is also installed. Its name is DATA and it contains end-of-day price history for the stocks in the

Dow Jones Industrial Average and for the average itself. The date range is short and the quotes are not up-to-date. But it is useful for verifying that the installation was successful and for investigating AmiBroker. You can use AmiBroker and the default database while in trial mode.

(31)

Chapter 3 - 3 0 Minutes to Useful Results, has some suggestions.

You will probably want a longer history and more issues. You can have

as many databases as you wish. D A T A is one. You can expand it or add

other databases.

BLOCK D I A G R A M OF DATABASE

As the block diagram shows, AmiBroker has two levels of database files. The native database is maintained by AmiBroker and AmiQuote, and can be modified by you using the Quote Editor within AmiBroker. The D A T A database is an AmiBroker native database.

f / J r Write quotation data Data source switch R e a d / w r i t e other data ׳.•jJJST Read quotation data AmiBroker

application

AmiBroker native d a t a b a s e

When you subscribe to a data provider, that provider will set up an

external database that they exclusively maintain. As AmiBroker needs

quotes to place on a chart or process in a backtest, the Data Plug-in reads the external database and passes the data to AmiBroker.

DATABASE SETUP - E N D ־ O F - D A Y

Setting up a database is a two step operation. Step one is establishing the database within AmiBroker and specifying which tickers will be stored in it. Step two is filling the database with historical price quota-tions. Depending on the processes being used, you may be aware of the two separate steps, or they may be combined and appear to you as a single step.

If you will be subscribing to a data service, such as Quotes Plus, the installation procedure for that service will set up a database specifically

(32)

for quotes from that service and will be maintained by that service. We will discuss setting up a Quotes Plus database in a few pages.

If you want to use one of the free data providers, such as Yahoo, you can either expand DATA or create a new database. The following pages describe how to do that.

FREE DATABASE USING A M I Q U O T E

AmiQuote is a companion program to AmiBroker that manages down-loading of price quotes, from either Yahoo or msn, and storing those quotes in the AmiBroker database.

Return to http://www.amibroker.com and download the setup file for Ami-Quote. The current version is 2.00. Double-click aq2000.exe and follow the installation instructions, accepting the defaults.

AmiBroker

for Windows 95/98/Me/WT/2k/XP

• AmiQuote

Internet stock downloader program - companion to AmiBroker, trialware, 32-bit Windows version.

If you are using Windows 95, Internet Explorer 4 or higher must be installed. Find out more

File Version R e l e a s e d a t e Size Alternative s i t e s Description NEW! AmiQuote 2.00 2.00 April 23. 2008 94KB AmiQuote 2.00 Self-extracting archive. Now supports Yahoo, Yahoo Fundamentals, Google Finance (NEW), MSN Money Central and Forex.

Fundamental data import faeture requires AmiBroker 4.81 or higher. AmiQuote 2.00

Self-extracting archive. Now supports Yahoo, Yahoo Fundamentals, Google Finance (NEW), MSN Money Central and Forex.

Fundamental data import faeture requires AmiBroker 4.81 or higher.

If the only information about the stocks that you want is their ticker symbol, then continue with the method described in the next few para-graphs. If you want to have the ticker and full name, and perhaps the industry sector identification, read the next section, Ticker Only; then read the section, Ticker and Full Name, that follows. It is a good idea to decide this before the database is filled with historical quotes.

(33)

Ticker Only

Begin by deciding which issues you want in your database. Find or ere-ate a list of their tickers. This does not need to be the final list - you will be able to add additional tickers and historical data at any time in the future. For example, you might want all the stocks in the Russell 1000 index - the 1000 largest capitalization stocks listed on US exchanges. (According to the Russell Investments website, http://10ww.russell.c0m, the Russell 1000 represents approximately 92% of the US equities mar-ket. That website also has a list of the current components of all the Russell indices.) Visit http://www.IntroductionToAmibroker.com/resources for links to up-to-date lists of members of various categories.

If you want to keep a copy of the original DATA database as it was

dis-tributed, here is how to make a copy of it.

1. Using Windows Explorer, navigate to the AmiBroker

directory. If you accepted all the defaults during installation, it is C:\Program Files\AmiBroker.

2. With Explorer, using the File menu, click New, then Folder. A folder named New Folder will be created.

3. Using Explorer, rename that to the name you want for the original database, for example DataAsDistributed.

4. Using AmiBroker and its File menu, click SaveDataBaseAs, select the folder you just created, DataAsDistributed, click

OK. AmiBroker will make a copy of the DATA database in the

folder DataAsDistributed.

Continuing on to update the database named DATA with the tickers in

the Russell 1000.

1. Using a simple text editor, such as NotePad, or a spreadsheet, create a file with one ticker per line. The tickers should be in all capital letters. Each ticker must be spelled the same as your data provider spells it. Save that file in the AmiQuote directory

with a meaningful file name, such as RussELLlOOO.tls. If you

accepted all the defaults during installation, that directory is C:\Program Files\AmiBroker\AmiQuote. Tls files are ordinary text files that are recognized by AmiBroker and AmiQuote as containing lists of ticker symbols.

2. Open AmiBroker.

3. Using the AmiBroker File menu, click Open Database, select the DATA database, click OK.

(34)

Leave AmiBroker open as the next steps are performed. Decide the date you want the historical data to begin. If you plan to do extensive trading system development, I suggest having at least ten years of data available. The characteristics of the markets changed after the October 1987 crash, so data before that date has limited value in developing systems for current conditions. A starting date (From Date) of 1/1/1995 might be reasonable. Use today's date for the end date (the To Date).

Using the Windows Start menu, select the AmiQuote program and run it. You will find it under All Programs > AmiBroker > AmiQuote > AmiQuote.

Using AmiQuote's File menu, select Open. Then select the file

with the tickers you want to get historical data for, R U S S E L L I O O O .

tls, and click Open. 4. 5. 6. 7. H A m i Q u o t e - U n t i t l e d - 0 * « — . c t ט c a ! • • •> * א ¥ M

i Source: jYahoo Historical (EOD. stocks, funds. US & International (50)) פ Si From: { 1/ 1/1995 jJ

j! Automatic import p*

To: j 7/26/2008 ־״J ^e r v e l j —f (Quote.com/Forex): י

r״ All sessions (Quote.com only)

י״ j Run eveiy:

Look in: ji-S AmiQuote j p J ® c t 6 m-C^ Download JSl RUSSELL2000.TLS DJINDUSTRIALS.tls >§ SPlOO.tls :^DJTRANS.tls SPSectorETF.tls DXJTIL.tls Cj FTSElOO.tls 3 NASDAQlOO.tls ':<*3 NEWTICKERS.TLS ^ i S B I IRUSSELL.1000.TLS פ

Files of type: !AmiQuote Ticker list (*.tls)

Ready

Be sure that AmiBroker is running and that the database you want updated is the current database. The name of the database in current use is displayed in the status bar in the bottom right-hand corner of the AmiBroker window. If necessary, use the AmiBroker File menu and open the desired database.

(35)

Be sure that AmiQuote's Automatic Import box is Checked. Click the Green Triangle to begin the download.

9.

9 A m i Q u o t e - R U S S E L L 1 0 0 0 . T L S File Edit View Tools Help

y • « -> ^ f M

[Yahoo Historical (EOD. stocks, funds, US & Interne j r ] To: | 7/26/2008 T ] From: J 1/ 1/1995 ׳ Automatic import p~ ) Status Waiting. Waiting. Waiting. Waiting. Waiting. Waiting. Waiting. ₪ A 0 A A 0 A A P 0 A A P L 0 A B C 0 A B I 0 A B I I r71 a b t

You have asked for over 10,000 years of data, each with 252 sets of Open, High, Low, Close, and Volume. Depending on the speed of your Internet connection, it will take a few minutes to a few hours for the download to complete.

10. AmiQuote will inform you of the progress of the download. If the amount of data stretches the capacity of your

communications or your patience, divide the R U S S E L L I O O O I I S file into several smaller files and work with each part in turn. As soon as the data for any individual stock has been downloaded, it is immediately available for use within

AmiBroker. You may continue to work with AmiBroker while downloading proceeds.

When the download is complete, scroll through the Ticker List in AmiQuote. If there were problems with any of the tickers, there will be messages displayed. A common problem is that the spelling of the ticker in the tls file is not the same as the spelling the data provider uses. In this case, note that Russell Corporation used a period when specifying the Class A stock. Yahoo uses a dash character. Make a list of all the tickers that did not download properly and create a file named N E W T I C K E R S . tls. Add the tickers of any other stocks you want. Using the same procedure, have AmiQuote download the new tickers.

(36)

O A m i Q u o t e - R U S S E L L 1 0 0 0 . T L S I File Edit view Tools Help

a U f M

Source: jYahoo Historical (EOD, stocks, funds, US & International (50)) From: | 1/ 1/1995 1 Automatic import To: 1 7/22/2008 י׳ I ^e r v a l ״_ — ' (Quote.com/Fore j All s e s s i o n s ( Ticker | Status 1 • ben 0 B F B • bg • b g c • bhi Imported

Error during download. Yahoo! - 404 Not Found. Either the symbo... Imported

Imported Imported

A good source for researching companies and verifying tickers that will be downloaded from Yahoo is the Yahoo financial site, http://finance.yahoo.com/

11. Close AmiQuote.

12. In AmiBroker, using the File menu, click Save Database. Ticker and Full Name

If you want AmiBroker to know the full name of each issue in addition to its ticker symbol, the names must be loaded into the database. One

way to do that starts with a text file, similar to the RussELLlOOO.tls file

described above, but including the full name of the issue along with the ticker symbol. Optionally, the industry group number can also be included and will be used to place each ticker in its correct category. Each line of this file has the ticker, full name, and industry group num-ber, all separated by commas, and saved in a file with a name such as

R1000FuLLNAME.txt (txt, not tls, as you will see in a minute).

g TextPad - [C:\Documents arid Settings\Howard\My Docur

n

| File Edit Search View Tools Macros Configure Window Help

ם & ט 1 m a n 1 1 to m o o < • = + : 2 IT

®

R1000FULLNAME.T... A,AGILENT TECHNOLOGIES I N C , 2 5 AA,ALCOA I N C , 5 3 AAP,ADVANCE AUTO PARTS I N C , 8 AAPL,APPLE I N C , 2 0

ABC,AMERISOURCEBERGEN CORP,52 ABI,APPLERA CORP A P P L I E D , 5 2 A B I I , A B R A X I S BIOSCIENCE I N C , 1 1 ABT,ABBOTT LABORATORIES,51 ACAS,AMERICAN CAP STRATEGIES,30

Appendix B, Industries and Sectors, has a list of the industries and their respective group numbers. There is no simple way to assign an industry, and its associated industry number, to each ticker. At times, a

(37)

database of a large number of stocks (such as all US stocks), sometimes including a program to set up a database that is complete with industry number assignments, will appear on one of the AmiBroker discussion forums (see the links in the Appendix C, Resources). These quickly be-come obsolete with the addition of new stocks and changes to existing ones.

If you are very interested in assigning industry numbers to stocks, here are two alternative ways.

One. Download the lists of components of each of the Standard & Poor's sector exchange traded funds. One sector at a time, form a watchlist of the members. (See Watchlists, page 179.) Using AmiBroker's Symbol menu, select Organize Assignments and assign all the members of the watchlist the same Sector Number.

Two. Subscribe to one of the commercial data providers (see the links in the Appendix C, Resources). In the process of setting up their database, they will assign each stock to its proper market, industry, and group. Most of the services will store additional information, such as number of shares outstanding, dividend, and so forth, that you would have dif-ficulty finding yourself.

With R1000FU1_LNAME.txt, the file containing the ticker symbol, full name,

and optionally the industry number ready, you are ready to establish the database. This must be done before symbols are entered in any oth-er way and before quotes are downloaded. A simple jscript program, INDUSTRIES.]S (courtesy of Tomasz Janeczko), can be used to read the txt file and establish the database. (The program listing of INDUSTRIES.JS is in Appendix C, Resources, and is in the download materials associated with this book.)

Warning: If your database is already established and has historical price data, Do Not run this script - it will result in a badly confused database. Use this script only to establish a new database before load-ing historical quotes into it.

In order to run the script:

1. Using Windows Explorer, create a new folder under the AmiBroker directory to hold the new database. Assume it is N E W R I O O O .

2. Run AmiBroker, use the File menu, Open Database, select N E W R I O O O , click OK.

(38)

Copy or move RlOOOFuixNAME.txt to your Windows Desktop. Copy or move I N D U S T R I E S . J S to your desktop.

Double click I N D U S T R I E S . ] S .

The script tells you that the script is started. Click OK. After a short time, less than one minute, the script tells you it is finished. Click OK.

3. 4. 5.

Verify that the script worked by using AmiBroker Symbols menu. Ex-pand the All category and note that there are 1000 tickers listed. If you supplied industry codes, expand the Sectors category and note that the tickers have been assigned to sectors. There are no quotes yet.

fA K 9-i

L AmiBroker - [A - AGILENT TECHNOLOGIES INC - Daily]

Q. File Edit View Insert Far mat Symbol Analysis Iools Window fcjelp

D a׳־ B S l J t l l x ^ o o e i , A

-Not enouqh data available.

To plot any chart at least 3 data bars are needed, but there are only 0 bars in Symbols י • נ

fSymbols j Layouts j Layers 1 Charts j ® • All ש O Markets f f l C j Groups Q Sectors ש LJ Watch lists Q Favourites O Indexes

To fill the database with historical quotes:

1. Create a .tls file containing the tickers from the first column of R1000FuLLNAME.txt. Name it R U S S E L L I O O O I I S .

2. Follow the directions given in the section above, Ticker Only, to have AmiQuote retrieve historical data from Yahoo. 3. In AmiBroker, using the File menu, click Save Database. 4. Exit AmiBroker.

Additional Symbols

Whenever you want to add issues to your database, use this proce-dure:

1. Enter their ticker symbols, one per line, in the file NEwTicKERs.tls. (It is convenient to keep all tls files in the AmiQuote directory.) 2. With AmiBroker running, open the database you want to add

to.

3. Run AmiQuote.

(39)

5. Set the From Date and To Date. 6. Check the Automatic Import box.

7. Click the Green Arrow to begin the download. 8. When the download is finished, close AmiQuote. 9. In AmiBroker, Save database.

If you want to record the full name of the issue:

1. In AmiBroker, using the Symbol menu, select Information. The information window for this stock will open.

2. Edit the Full Name field. If you want to assign categories: In AmiBroker either:

1. Using the Symbol menu, select Information.

2. In the Categories section, make whatever assignments you wish for the one ticker you are working with.

Or:

1. Using the Symbol menu, select Organize Assignments. 2. Make whatever assignments you wish for the list of tickers you

select. Data Updates

Once the database has been established and the historical data loaded, maintaining the data by adding the latest quotes is very easy. In Ami-Broker, using the Tools menu, select AutoUpdateQuotes. AmiBroker will examine the database that is open, determine the date range need-ed to bring the quotes for all the issues in this database up to current date, and call AmiQuote to do the download. Since only a few days data is needed for each ticker, the process takes only a short time.

. AmiBroker - ["DJI - DOW JONES INDUSTR - Daily]

l o o Is | Window fcfelp J Database Purify... ן Indicator Maintenance... Gp• Bar Replay S&J Preferences... יי Save preferences Plug-ins... § Customize... ~DJI (Daily ADJI - Daily 7/21/2

Auto-update quotes (AmiQuote only) | Sharenet Down loader f Cleanup database File Edit Vtew Insert Format Symbol Analysis

• & y m & 0 ־ & o 0 5 -Symbols י • x

I Symbols j Layouts j Layer? j Charts J Si Q All

Si LJ Markets ®•C3 Groups Si CJ Sectors ffi LJ Watch lists

(40)

Sources of Free Data

The examples above illustrate using Yahoo as the source of historical data. There are other sources. For US markets, msn also provides free end-of-day historical data. If you wish to use that source, use the pull down menu in AmiQuote to select msn instead of Yahoo. Keep in mind that consistency is important. Different data suppliers will have differ-ent ways of preparing and presdiffer-enting the data. For example, the vol-ume multiplier may be different, or the ticker spelling may be different. After you load your database with quotes from one supplier, keep the database up-to-date using that same supplier.

ASCII Import

There are two methods of importing ASCII data: the ASCII Import Wiz-ard (file menu, Import WizWiz-ard), and the full ASCII Importer (file menu, Import ASCII). The wizard is good for one-off imports. Its features are a subset of the full importer. If you will be importing the same files regularly, set up the full importer. (Note: the ASCII Import Wizard can create a format definition file for later use with the ASCII Importer.) Before you start, decide which database you want the imported data to go into. If you are just practicing, create a test database and open it. Do not import into your high quality database until you are confident the import procedure is working correctly

Download the data files and, if necessary, unzip or expand them. Open the files using a text editor such as Notepad. There should be one quote per line, fields separated by space, semicolon, or comma.

There may be a header line describing the fields. If not, identify the fields yourself. If necessary, go to the site from which the data was ob-tained and read their documentation.

The date field is the trickiest. The wizard understands many formats. If your data is in one of them, all you need to do is identify the order of month, day, and year. The codes are DMY, MDY, YMD. If your data does not follow one of the recognized date formats, you will need to reformat the date (for example, by using a spreadsheet) and rewrite the data file before proceeding.

The year can be either four digits or two (the final two of the year). The month can be either two digits or three characters (such as Dec or Jan).

(41)

The day is two digits. The separator can be / (slash), \ (backslash), - (mi-nus), or not separated at all.

Assume the date for one quote is December 31, 2000. YMD formats that are recognized include:

20001231 2000-12-31 2000/12/31 2000-Dec-31 001231 00-12-31 00/12/31 00\12\31

If your data has a ticker symbol as a field in each line, the data will be stored under that symbol. If there is not an explicit ticker, the file name will be used. If your data file is downloaded as, for example, IBM.csv, the data will be stored as IBM. If your data file is downloaded with a

generic name, such as TABLE.CSV (Yahoo uses this file name for all its

(42)

Yahoo Historical Data Download

The Yahoo site is a good place to get stock and index historical data.

http:Hfinance.yahoo.com

Using the investing tab, select stocks. Under research tools, click his-torical quotes to get this page.

Follow these steps to download the historical data for a stock or index: 1. Enter the ticker (say it is XOM)

2. Click GO

3. The screen will display the most recent data 4. Click Download to Spreadsheet

On your desktop, or wherever your default directory to receive downloads is, you will find a file named TABLE.CSV.

5. Rename TABLE.CSV to XOM.csv. Use capital letters if you want

your symbol to be in capitals.

6. Proceed to import XOM.csv into AmiBroker using either the ASCII Import Wizard or Import ASCII

(43)

Yahoo' My yahoo! Malt : Mot* י׳ Make Y! My Home Pa9e H«, howardhandy v Sign Ou«: H-»lp

Y A H O O ? , F I N A N C E "V? Search I WEB SEARCH

Dow • 0.79Q׳b Nasdaq •V 0.10 ״o Tws, Aits) 12. 20&S. fT - U.S. Markets close in lhr 36mins. HOME NEWS & OPINION P E R S O N A L FINANCE MY P O R T F O L I O S

! :1 GET QUOTES j »Finance Search

i t 2109PM ETi 7 7 . 6 9 4 0 . 6 0 % ) 0.47 ־ )

^ Q Q •j׳

FREE T R A D E S f i f t M B y

Exxon Mobil Corp. (XOM)

Get Historical Prices for:

Historical Prices

SET DATE RANGE

(§) Daily O Weekly O Monthly O Dividends Only I | Next | Last j 2 ׳ 12 Start Date: J a n End D a t e : Aug

ice adjusted for dividends and splits. 1• !־ i! | p! 9v ן Next ן Last ^ Down load T o S p r e a d s h e e t — — — — — — —

as Add to Portfolio v Set Alert >.3־ Email to a Friend Set Historical Prices for Another Symbol: 1[ 00 J Symbol Looku: Summary Real-Time ECN • Historical Prices Charts Interactive Basic Chart

News & Info

Headline

Company

Profile Date Open High Low Close Volume Close* Adj Kev Statistics 11־Aug-08 78.52 78.95 77.04 78.16 24,566.800 7 8 1 6

Competitors 11-Aug-08 $ 0.40 Dividend

Industry 8־Aug08־ 76.90 78.85 76.31 78.72 29,318,400 78.32 Components 7-Aug08־ 78.68 79.11 77.31 77.44 25,346,700 77.05

Analyst Coverage 6-Aug08־ 78.50 78.65 77.24 78.33 30,790,600 77.93 Analyst Opinion Analyfl; Estimates Research Reports 5-Aug-08 4-Aug08־ 76.50 79.63 78.35 80.13 76.21 76.14 78.35 76.60 40,087,100 37,887,200 77.95 76.21 Star Analysts 1-Aug08־ 80.55 81.10 79.45 79.72 28,766,900 79.31

Ownership 31-JUI-08 81.82 82.55 80.19 80.43 40.872,900 80.02 Maior Holders 30־Jul08־ 80.90 84 76 80.53 84.38 36.410,700 83.95 Transactions 29-Jul-08 80.83 81.20 79.75 80.90 25.869,900 80.49 Insider Roster 28-Jul08־ 81.87 82.23 80.65 80.68 24.017,500 80.27

Financials 25-JUI-08 81.01 82.41 80.76 81.70 27,553,800 81.28 tnsgrne Statttmtni; 24-JUI-08 81.20 81.95 79.73 80.80 36,789,400 80.39 Balance Sheet

Cash Flow 23-JUI-08 22-JUI-08 82.98 82.56 83.00 83.23 80.60 81.57 80.99 82.86 31,083,500 27,909,100 80.58 82 44 21־Jul08־ 81.84 82.98 81.11 82.98 24,802,500 82.56 14־May08־ 89.85 90.99 89.59 89.91 24,178,900 89.45 13-May-08 88.87 89.95 88.53 89.68 21,165,000 89.22 12-May-08 88.43 89.47 87.60 89.19 23,053,200 88.74 9-May08־ 9־May08־ 89.37 89.59 87.97 $ 0.40 I 88.82 Dividend 24,054,700 88.37: 8-May-08 89.00 89.95 88.52 89.93 24,332,000 89.08 י Stock Screenei י Mergers & Acquisitions

ASCII Import Wizard

The following steps illustrate how to use the ASCII Import Wizard.

Be-fore beginning, a database named T E S T has been created and opened.

(44)

down-l o a d e d from Yahoo for two stocks, GE and XOM, but not yet imported.

Since Yahoo downloads all data using the file n a m e TABLE.CSV, the

down-loaded file was renamed between downloads, so the files are GE.csv

a n d XOM.csv.

1. Using the File menu, select Import Wizard. 2. When the dialog box opens, click Pick Files.

3. Navigate to the directory holding the files you have downloaded.

O p e n W e l c o m e to t h e ASCII Import Wizard!

M e a s e click the button b e l o w to o p e n file d i a l o g a n d s e l e c t the files y o u want to import.

Note that you c a n s e l e c t multiple files by p r e s s i n g S H I F T or CTRL k e y while selecting the files using the m o u s e .

Y o u h a v e s e l e c t e d the following file(s):

pj§ CL. t>ct ® DX.txt © GC.txt GE.CSV ^ IBM. CSV XOM. CSV !®YHOO.csv

ASCII flies (־ txt* CSV * pro - dn.־ stc.־־׳ stk) ח O p e n a s r e a d - o n l y Files of type: J > M y R e c e n t D o c u m e n t s D e s k t o p

ע

My D o c u m e n t s My C o m p u t e r My Network P l a c e s

4. Since the files have identical formats, you can process multiple files in one pass, so select both GE.csv and XOM.csv. (Click one file, press the Control key and click the other.)

5. Click Open.

The Define Fields dialog box will open.

1. Note the format of the data in the .csv files.

2. Using the pull-down menus, define the fields for each element of data. Each element in the entire row of data must be defined.

(45)

Select SKIP to ignore data in the csv file that you do not want in your AmiBroker database.

3. Select comma as the separator. 4. Skip 1 line ־ the header.

5. Check Automatically add new symbols. 6. Click Next.

Define fields

Here you can define the fields in the d a t a file. U s e c o m b o - b o x e s to select appropriate field type. Hover the m o u s e a b o v e the controls to s e e additional hints.

!!Skip Column 5 Column 6 i Close v Volume v Column 4

ij Low י Column 1 Column 2 Column 3

| High IjOpen !YMD

Skipfirst: |1| 0 Log errors

F71 Automatically a d d new symbols * HI Calculate composites [~~1 No quotation date I I Allow negative prices C o m m a (,) v | Group 255 י ׳ v! | | More columns Separator: Group: Watch list: Additional c o m m a n d s :

Data file sample:

Date.Open.High,Low,Close,Vo)ume,Adj Close 2008-08-1 "1.78.52,78.95,77.04,78.16.24566800.78.16 2008-08-08.76.90.78.85.76.31.78.72.29318400.78.32 י 2008-08-07.78.68,79.11,77.31,77.44,25346700,77.05

Help

The Additional Settings screen will come up. It is on this screen that you can save the format settings that you just used. They will not help for future uses of the ASCII Import Wizard, but they will be available in the full ASCII importer. To do this, Check Add current settings to ASCII importer definitions, and give meaningful Description and File Name. You will see your format as we look at the full ASCII Importer in the next section.

(46)

Additional settings

Now you are ready to import the tile(s)

P l e a s e check additional settings below if you wont to u s e current format in the future

f l A d d current settings to ASCII importer definitions Importer settings

I < Back [[ Finish J | Cancel | | Help

The data will be converted from ASCII, imported into the open data-base, and be immediately ready for use in AmiBroker.

ASCII Importer

The full ASCII Importer is much more efficient, has more capabilities, and is more complex. Rather than having to fill in a form each time you want to import an ASCII file, you can set up a format definition file, or use one of the pre-defined files. The file that was created for the import done manually using the wizard in the previous section is:

# F o r m a t d e f i n i t i o n f i l e g e n e r a t e d a u t o m a t i c a l l y # by A m i B r o k e r ' s A S C I I I m p o r t W i z a r d S F O R M A T D a t e _ Y M D , O p e n , H i g h , L o w , C l o s e , V o l u m e , S k i p S S K I P L I N E S 1 $ S E P A R A T O R , $ C O N T 1 $ G R O U P 2 5 5 $ A U T O A D D 1 $ D E B U G 1

(47)

The definition files are stored in the C:\Program Files\AmiBroker\For-mats directory. By copying the format file that you will be using regu-larly to be DEFAULT.FORMAT, all that is necessary to import ASCII files is:

1. Using the File Menu, select Import ASCII.

File ן Edit View Insert Format

[Jew • Open... Ctr l+O

Qlose Open Database... Save Database Save Database As...

u Save Ctrl+S

Save As... Save All Database settings,,,

& Import Wizard.,, rif Import ASCII. 210 Import MetaStock data...

m Print... Ctrl+P a Print Preview

Print Setup...

2. On the Open screen, select the file you want to import. 3. Click Open. O p e n ! y a h o o (*"־) F ~ 1 0 p e n a s read-only ; !gjCL.txt U j [email protected] My R e c e n t D o c u m e n t s © GC.txt f&GE.CSV ! !®IBM.CSV !®XOM.CSV D e s k t o p : ? S y h o o .CSV 0 My D o c u m e n t s My Computer File n a m e : My Network P l a c e s : Files of type:

The file will be converted, imported, and made available within Ami-Broker for immediate use.

The options available for controlling the processing of ASCII data are extensive. Read about them all in the AmiBroker User's Guide.

(48)

SUBSCRIPTION DATA PROVIDERS

Free data has a cost to you - the cost of checking the data for missing quotes, bad values, unadjusted splits, and so forth, and correcting those problems. Subscription data services, such as Quotes Plus, Premium Data, CSI, and others, provide that maintenance for you and deliver cleaner, more consistent data with less effort on your part. End-of-day stock data costs about $40 per month - more for some services, less for others. Some end-of-day vendors include mutual funds at no charge; others charge extra. Commodities and futures data is an additional cost, depending in part on the fees the exchanges that clear those trades and report that data charge. Some subscription vendors provide cus-torn indices, custom indicators, and have a wider selection of issues - and often charge an extra amount for those. Some services charge a one-time fee for loading the historical data, others do not.

If you plan to use a subscription service, be aware that each service has its own database format. Once you begin with one subscription service, they will be the only service that can keep your data up-to-date. The installation procedure for each service will be unique to that ser-vice, but it is generally simple and well documented. Typically, the in-stallation does three things for you:

1. Establishes the external database and the communications between the database and AmiBroker.

2. Loads the definitions of the tickers, including the ticker symbol, the full name, and the industry assignment. 3. Loads the historical price data.

After the close of trading each day, you initiate communication with the data vendor. The database is brought up-to-date, and errors and in-consistencies are corrected and re-downloaded, all automatically. Some vendors provide intraday updating - treating the latest price as though it is the closing price. At subsequent updatings, the earlier prices are replaced by the more recent ones.

Quotes Plus End-of-Day Data

Here is the procedure to set up a Quotes Plus subscription end-of-day database.

(49)

but the end result is the same - an end-of-day database that is estab-lished and loaded with historical data by the data vendor. Tickers, full names, industry associations, and other information related to that stock are all provided by the vendor, stored in the external database for that subscription, and m a d e available to AmiBroker through an inter-face that is transparent to you as a user.

1. Begin with a visit to Quotes Plus' website: http://www.qp2.com/

joomla/index.php.

2. Pull d o w n the Products menu, select QP3, and click Free Trial.

3. Fill in the contact information. You will receive an email from Quotes Plus containing a User ID, Password, and the URL link to a download utility.

4. Follow the link to the download utility and download the Qp3Setup.exe file.

5. Execute that file to start the installation of the database and download of the historical quotation data. This is the first

B Q H

Quotes Plus Financial c/ata and software for stock

and commodity traders

%V Home

©

screen you will see.

E

W e l c o m e to t h e Internet installer f o r Quotes P l u s 3.1

You will be required to enter your Quotes Plus User ID and Password in order to download the data files from the web Please collect that information now. It is strongly recommended that you exit all Windows programs before continuing with this installation

If you have any other programs running, please click Cancel, close the programs, and run this setup again

Otherwise, click Next to continue

As you follow the instructions, you will be asked for your User ID and Password.

References

Related documents

• Double click the Documents folder to open it, then select the file you wish to attach.. •

File Menu New Open Close Save Save As Print Print Preview Print Setup Exit Format Menu New Open Select Open Database Edit Menu Cut Copy Paste Delete View Menu Toolbars

 Under OperationsManager select A shared data source, click Browse and select the previously created data source (Operational DataBase Main) and click OK.  Under

Select the file by clicking on the Select Database icon from the File menu or from the list of MS SQL Database files found, select the desired file to repair.. Click Repair to

In the 'File' menu select the command 'Open', highlight the audio file you require and click on the 'Open' button.. Click on the button to play the whole

• Select Create a new EndNote library in the window that opens (or choose New… from the File menu).. •

  Print Cloud app.  Select the desired file ~        Yes  Box.net  Dropbox  Local app.**  Open file in box.net application. 

Visualizing Simulation Results using RESULTS 3D  Click on File on the menu bar and select Open Results 3D. Select Oil Saturation from the drop down list.  Click on