Indexes – Nasdaq

As far as the major indexes go, the Nasdaq Indexes are the odd ones out for the American market in that they are owned and managed by the exchange and they are also mainly comprised of in-house issues (Nasdaq listed issues).

Ticker lists are available at the Nasdaq home site for the majority of their indexes: http://www.nasdaq.com/

To download Nasdaq ticker lists for use with AmiBroker:

1) Go to Home >> Market Activity >> Nasdaq Indexes to open the Nasdaq Indexes page: http://dynamic.nasdaq.com/services/indexes/default.aspx

2) Click on a title in the Nasdaq Indexes list to obtain information on the index, including component lists.

Note: The titles in the list are links although they don’t have the visual cues usually associated with links.

Nasdaq007

An information page for the referenced index will open.

3) Click on Download List to Spreadsheet.

Nasdaq006

A File Download window will open.

Nasdaq004

4) Save the file to a local drive.

That’s all there is to it.

Refer to UKB >> Setup A Custom Database – Nasdaq for an example that uses downloaded Nasdaq Indices lists to create a custom database.

 

ATTACHED FILE:

Nasdaq Composite Index Component List: index_component.xls

Note: The file was downloaded in CSV format but changed to Excel as the Users’ Knowledge Base site security filter doesn’t allow CSV files to be uploaded.

Written using Windows XPHome, Internet Explorer v7 and Excel 2002.

Data FAQ’s – Forex

An unsorted, unqualified list of FAQ’s relating to anything and everything to do with Forex data.

The list is dynamic and subject to change without notice.

CAUTION – SOME OF THE LINKS CONTAIN COMMERCIAL REFERENCES, OR LINK TO COMMERCIAL SITES.

NOTE: THE AUTHOR HAS NO COMMERCIAL AFFILIATIONS OF ANY KIND WITH, AND RECEIVES NO GRATUITIES OR BENEFITS FROM, ANY COMMERCIAL ORGANIZATION OR INDIVIDUAL INVOLVED IN COMMERCIAL ACTIVITIES. NOR IS HE PERSONALLY ENGAGED IN ANY COMMERCIAL UNDERTAKINGS, RELATED TO TRADING, IN ANY WAY.  THE LINKS ARE PROVIDED AS A RESOURCE AND FOR EDUCATIONAL PURPOSES ONLY. THEY ARE NOT A RECOMMENDATION, ON THE PART OF THE AUTHOR, NOR DO THEY CONSTITUTE INVESTMENT ADVICE AND SHOULD NOT BE CONSTRUED AS SUCH. 

 

Q2. I can’t find much information on Forex trading with AmiBroker in the Help Manual. Are there any instructions on the subject anywhere else?

A2. Yes. Here is an article that tells you everything you need to know about using AmiBroker for trading FOREX markets: http://www.amibroker.com/kb/2006/08/09/amibroker-for-forex/

There’s also an article on how to connect to FXCM (Forex broker) to get their real-time quotes. Also included is small example database (1 day worth of 1 minute data) and all required programs: http://www.amibroker.com/kb/2007/01/05/setting-up-with-fxcm-forex-broker/

 

 Q1. Where can I get Forex data?

A1. Forex can be easily imported using MetaTrader:  http://www.metaquotes.net/

Prasanth – AmiBrokerYahooGroup message#116545      “Questions Regarding AmiBroker”   http://finance.groups.yahoo.com/group/amibroker/message/116545

Data FAQ’s – Miscellaneous

An unsorted, unqualified list of data FAQ’s that are not included in other Data FAQ posts (money market, Funds etc).

The list is dynamic and subject to change without notice.

CAUTION – SOME OF THE LINKS CONTAIN COMMERCIAL REFERENCES, OR LINK TO COMMERCIAL SITES.

NOTE: THE AUTHOR HAS NO COMMERCIAL AFFILIATIONS OF ANY KIND WITH, AND RECEIVES NO GRATUITIES OR BENEFITS FROM, ANY COMMERCIAL ORGANIZATION OR INDIVIDUAL INVOLVED IN COMMERCIAL ACTIVITIES. NOR IS HE PERSONALLY ENGAGED IN ANY COMMERCIAL UNDERTAKINGS, RELATED TO TRADING, IN ANY WAY.  THE LINKS ARE PROVIDED AS A RESOURCE AND FOR EDUCATIONAL PURPOSES ONLY. THEY ARE NOT A RECOMMENDATION, ON THE PART OF THE AUTHOR, NOR DO THEY CONSTITUTE INVESTMENT ADVICE AND SHOULD NOT BE CONSTRUED AS SUCH. 

 

 

Q1. Does anybody know where I can find data on the historical price of treasury bonds? I know tnx and tyx are charts for the yields, but I’m interested in price. I have etf data that mimics price, but the seriesis not long enough.

A1. Most traders actually trade the bond derivatives – i.e. bond and note futures. We have data on CBOT US Treasury Bond going back to 1978, 5-yearNote futures back to 1988 and 10-year Note futures going back to 1982. It’s not expensive (US$67 for the entire set of futures data). 

Futures trading is a whole lot different from tracking a single securitythough. Most back testers use a back-adjustment method to create continuous contracts suitable for back-testing – see http://www.premiumdata.net/support/futurescontinuous.php for more details onhow this works.

Our data is fully compatible with AmiBroker and incorporates the information required for back-testing (margin value, tick values etc.).

Richard Dale.
Norgate Investor Services – Premium quality Stock, Futures and Foreign Exchange Data for markets in Australia, Asia, Canada, Europe, UK & USA

http://www.premiumdata.net/

Organizing Formula Files

New formulas are saved into the Custom folder, in the Workspace Charts Tree, by default. The tree can get pretty messy after a while, especially if Unnamed formulas start to accumulate (new formulas that are not named are automatically saved as Unnamed).

A little organization goes a long way.

New folders can be created by right clicking on the Custom folder and selecting Folder from the context menu that opens.

OFF001 

Folders can be moved by right clicking on the folder, holding down the right mouse button and dragging it to the new location.

OFF005

If the ‘dragged’ folder is ‘dropped’ over the Databases folder, for example, New Folder will be entered under Databases as a sub-folder.

OFF006

In the Charts Tree, folders and formulas are arranged alphabetically .

OFF009

An alternative sort order can be forced by adding a ‘character hack’ to the folder names.

To re-order folders:

1) Right click on the folder and select Rename from the context menu that opens.

OFF003

2) Position the cursor at the start of the name and enter a single space, or a character e.g. tilde “~”, to the beginning of the name.

OFF004

Next time the Chart Tree is refreshed the folders will have moved to the top and they will be ordered alphabetically.

Note: In this example a single space was used.

OFF007

In the authors opinion, this is a much better view. Unassigned formulas are grouped together at the bottom of the Custom hierarchy, which prompts the user to move them to a folder, and Unnamed formulas are grouped together, once again prompting the user to clean them up.

Experimental, or temporary formulas, can be ‘kept’ in the formula list and more permanent formulas moved to folders.

MACD Trend System

I use a small setup criteria to scan for my stocks.

Settings:

MACD default,
I look for Histogram 4 down bars and 1 up bar for buy signal(I have the histogram set to red for down and blue for up so I can see
clearly).
MACD above Zero Line
RSI Above 30
This system is base on trend trading. Buying on pullback when the market continues its up trend.

To scan for MACD Trend setups:

1) Insert the following formula into a chart.

MACD004

2) Run a Scan in AA using S_MACDTrend with All symbols, n last days, n = 1 and Sync chart on select as the settings.

Stocks that meet the criteria will be reported in the Results list.

Note: Some variations of the setup rules can define signals that are quite rare and in small databases it is possible that there will be no setups on any given day (hence no stock will be reported by the scan).

MACD003

3) Click on any symbol in the Results pane to view the chart, for that symbol, in the background.

Note: In this example a training database, that only contains data up to 5/11/2007, was used.

  • Trading idea by protraderinc.
  • Comments and formula by Bill – WaveMechanic.

AmiBrokerYahooGroup message #116233  “MACD Histogram” http://finance.groups.yahoo.com/group/amibroker/message/116233

Yahoo Data FAQ’s

An unsorted, unqualified list of FAQ’s relating to anything and everything to do with Yahoo! Finance data.

The list is dynamic and subject to change without notice.

Comments, where included, are the opinion of the individuals concerned and are not necessarily correct. In some cases they may be ‘out of date’ as circumstances change with time.

CAUTION – SOME OF THE LINKS CONTAIN COMMERCIAL REFERENCES OR LINK TO COMMERCIAL SITES.

NOTE: THE AUTHOR HAS NO COMMERCIAL AFFILIATIONS OF ANY KIND AND RECEIVES NO GRATUITIES, OR BENEFITS, FROM ANY COMMERCIAL ORGANIZATION OR INDIVIDUAL INVOLVED IN COMMERCIAL ACTIVITIES. NOR IS HE PERSONALLY ENGAGED IN ANY COMMERCIAL ACTIVITIES, RELATED TO TRADING, IN ANY WAY. THE LINKS ARE PROVIDED AS A RESOURCE AND FOR EDUCATIONAL PURPOSES. THEY ARE NOT A RECOMMENDATION, ON THE PART OF THE AUTHOR, NOR DO THEY CONSTITUTE INVESTMENT ADVICE AND SHOULD NOT BE CONSTRUED AS SUCH. 

 

Q7. I want to use Yahoo data for the ASX. Is it accurate?

A7. The use of Yahoo data for ASX stocks is not good. 

1.    No delisted history – any system testing you do based on Yahoo data is subject to population bias.  ie you can only test on the stocks that are currently listed.

2.    Significant inaccuracies for any stock exchange that trades in increments less than 1c.  This includes the Australian Stock Exchange (ASX), Singapore Exchange, some NASDAQ stocks and most OTCBB & Pink Sheet stocks.  This happens because Yahoo’s data is rounded to the nearest cent.  For example, there are 14000 listed instruments on the ASX.  Over 8000 of them are currently trading below 20c which means they move in either 0.5 or 0.1c increments.  Since Yahoo only prices in cents this introduce VERY SIGNIFICANT innacuracies.  – eg. a 2.6c shown as 3c represents a 15% error). 

3.    Normal dividends are adjusted by subtracting all historical data by the dividend amount.  Exchanges such as the ASX do not adjust price data for standard dividends.  By diluting it the way they do, any technical analysis or back-testing no longer shows a correct % return, nor does it show critical technical levels such as support and resistance.

4.    No sector information – critical if you want to perform sector-based analysis.

5.    Significant number of missing stock splits and other capital adjustments.

Re the rounding, if the data is adjusted (for splits/rights issues etc.) then you want plenty of decimal places so your testing shows the correct % gain.  In years past, the ASX had a different mechanism for determining the open and closing price of a stock, ending up with a weighted average of the bids/asks to come up with one open/close price (which would often be a fractional amount).  They changed this method a few years ago to more of a volume-matching method so that it’s a “normal” trading level.

Richard Dale.

Norgate Investor Services
– Premium quality Stock, Futures and Foreign Exchange Data for
  markets in Australia, Asia, Canada, Europe, UK & USA –
www.premiumdata.net

AmiBrokerYahooGroup message#68314 “Yahoo EOD data not always correct ?” http://finance.groups.yahoo.com/group/amibroker/message/68314

 

Q6. I am downloading EOD data from Yahoo to an ASX 200 group on a daily basis and I am also using another source. I have noticed discrepancies in quotes between these sources. It appears that Yahoo is incorrect. Sometimes it can be 5 cents or more difference.

Differences may be because one source is adjusting for dividends while the other is not. AmiQuote/Yahoo is adjusting, by default, for splits and
dividends but you can turn adjustment off by editing Formats\aqh.format file (using Notepad) and removing ADJCLOSE field.

Tomasz Janeczko – amibroker.com

 

 Q5. For two days in a row Yahoo data for US stocks retrieved with Amiquote has been very spotty – data comes through for some symbols but not
others?

A5. This is a Yahoo problem. For example if a stock is missing the LOW price of the day AmiQuote, by default, does not import data with missing LOW-HIGH prices.
You can however turn this off – however LOW price will be still missing – in fact it will use lowest of open/close as a low).

To accept it, despite missing LOW, you can go to aqd.format file (inside Formats subdirectory) and remove $STRICT 1 line.

Tomasz Janeczko – AmiBroker.com

AmiBrokerYahooGroup  message #116918     “Yahoo Data Very Spotty Last Two Days”  http://finance.groups.yahoo.com/group/amibroker/message/116918

 

Q4. AmiQuote does not automatically list tickers for the exchanges supported by Yahoo!Finance. Are there any other Yahoo down-loaders, compatible with AmiBroker, that do?

A4. Yes, there are at least two that the author is aware of. They are both commercially available.

a) Bodhi Freeway (formerly Bodhi Gold) is a down-loader, with Yahoo capability, that allow users to select the tickers they want to download. It is distributed by JustData and is free when bundled with their data subscription packages).

http://www.justdata.com.au/Products/BodhiFreeway/bg_yahoo.htm

They produce data files in the Metastock format that can be dynamically referenced in AmiBroker using the Metastock plugin.

http://www.justdata.com.au/Training/Tutorials/Bodhi3/amibroker.htm

Sector classification is not available with Yahoo international data.

At the time of writing, Bodhi Freeway, to purchase as a stand-alone product is approximately twice the price of AmiQuote.

b) MLDownloader

http://www.trading-tools.com/

Download End-of-Day stock quotes on 50+ exchanges worldwide. Forex, commodity futures, market indices, mutual funds, money market funds, ETF, corporate bonds, and metals are also supported.
Stores data in MetaStock or in the form of ASCII files.
Supports all common MetaStock formats (Version 6.52, 8.0, 9.0 and 10.0 (6000 securities per directory)).
Stock splits are performed automatically.
Notification when dividends were distributed.
Automatic update of indices and maintenance of your symbol lists.
Download attempts can easily be repeated – Detects symbol changes.
Downloading data can be scheduled.
Automatically connecting, downloading and disconnecting for analogue modem users.
MLDownloader supports multiple stock quotes servers like Yahoo, MSN.com or Quote.com
Easy way to create symbol list from existing MetaStock database and continue updating historical EOD data.
Auto-re-download of missing data.
Option of Daily, Weekly and Monthly or Intraday data.

At the time of writing, MLD, is approximately twice the price of AmiQuote.

 

Q3. I am having problems with the US-Stocks database. There are 8630 symbols in the database. Yahoo has no historical data for over 300 of them. Amiquote puts ‘junk’ (html 404 error) in the data file for missing historical data.

A3. Authors comments – Not all download errors are caused by a lack of historical data. Sometimes this occurs because there have been symbol (name) changes or companies have restructured in some way (mergers, de-listings) and this is not reflected in the Yahoo database. Typically the majority of them are .OB (Bulletin Board) stock. This is not an error caused by AmiQuote, AmiBroker or the US _Stocks database.

Within AmiBroker they can be reported as NoQuotes and sent to a Watch list by using the Database Purify Tool (they have been sorted into a NoQuotes watch list by the developer of the US_Stocks template). They can be deleted from the database by deleting them from the Watch list, or alternatively users can check the Yahoo site to find the reason for the ‘failure to download’ and make repairs to the database where necessary. 

Examples of how to use the Database Purification Tool, and other a tips and tricks to help with quality control of databases, have been documented in this section of the Users’ Knowledge Base.

 

Q2. I recently purchased AmiBroker & downloaded historical quotes from Yahoo. The volume display will not display values greater than 2,147,483,648.00 for indexes. All the recent volume values stop at this level. Is there a way to increase the display limit for volume?

A2. 2,147,483,648 is the upper limit for integers in AmiBroker. The volume, as it is imported from Yahoo, can be adjusted down using decimal factors.  Refer to the AmiBroker Knowledge Base article http://www.amibroker.com/kb/index.php?s=Yahoo by Tomasz Janeczko.  Also search the Yahoo message board archives, or the Help manual, for $volfactor to find additional information.

AmiBrokerYahooGroup  message #116336     “Volume Display Stops at 2,147,483,648.00 on Indexes”    http://finance.groups.yahoo.com/group/amibroker/message/116336

 

Q1. Is there a template for downloading Yahoo data, plus sectors, for the international  markets like Germany or India?

A1. Authors comments – sorry but it appears not (unless someone comes forward and tells us otherwise). Generally the products and services available for the American market are superior to the other Yahoo supported markets e.g. for the American market a database is maintained, including sector classification, for approximately 8000 stocks (the sector  information can be found on the Yahoo!Finance Profile page for each stock).

By comparison, the Company information, including the Profile, is not available for the leading German or Indian stocks, let alone a range representative of those market as a whole.

Germany – the top 30 company Adidas has no active links in the Company section.

YFAQ003

India – the top 100 company Bank of India has no active links in the Company section.

YFAQ004

Further to that, many of the Y!Finance international sites do not provide constituent lists for ‘local’ indices.

The only way around this appears to be:

  • – for people to dig in and find some local information to use,
  • – use the global indices constituents for international markets,
  • – ‘practice’ on the American markets then ‘purchase’ local data, for comparison and trading, later,
  • – or, pay for the information.

Unfortunately the trend is towards ‘pay for play’ e.g. index lists for German stocks are downloadable from the Xetra site http://deutsche-boerse.com/dbag/dispatch/en/kir/gdb_navigation/technology/20_Applications/10_Trading/10_Xetra_Trading_Platform but only on a subscription basis.

Standard and Poors maintain global indices that cover 70-80% of the equity market for the major international regions. Constituent lists, including GIC’s classifications, are downloadable from their site but only approximately 30-40 German companies are deemed liquid enough to make that list.

http://www2.standardandpoors.com/portal/site/sp/en/us/page.home/home/1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0.html

Alternatively, “If you can’t beat them, join them”.  Consider trading the American market and enjoy the benefits of participation in a liquid market (commissions might be cheaper than trading in your own country).

AmiBrokerYahooGroup message #116257  “Flags to get industry data from yahoo”  http://finance.groups.yahoo.com/group/amibroker/message/116257

Naming Formula Files

The formula name, as it is entered in the Formula Editor title box, is also the file name that the formula is saved under.

NFF003

To help make it easier to find formulas prefix the name with:

  • X_ for Exploration,
  • P_ for Plot,
  • S_ for Scan and
  • B_ for Backtest.

The formulas will automatically be arranged, by functionality, in AmiBroker’s Workspace Chart Tree.

NFF004

The order will be replicated in file browsers, like Windows Explorer, when the file list at C:\Program Files\AmiBroker\Formulas\Custom is sorted by Name.

NFF005

Modifying Built-in Formulas

Any indicator, or formula, can be easily changed while at the same time preserving the original version.

To create another version of a formula:

1) Right click on the formula, or indicator, in the Workspace >> Charts Tree and pick Edit from the context menu that opens.

MBF001

The Formula Editor window will open with the code for the selected formula in place.

2) Click inside the Formula name input box, to position the cursor, and over-type to change the name of the formula, or add a version number (if the name is a long one use the arrow keys to move the cursor to the end of the box).

MBF002

3) Click on Save and the ‘new’ formula will be entered into the same folder as the original (the Formula Editor will remain open).

MBF005

4) Once the formula has been saved under a different name the code can be changed.

Modify the code and Save the changes.

MBF006

5) When the changes to the formula are complete Save and close.

Bob’s your uncle (as we say in Orstralia).

Naming Formulas

For sharing formulas, or where the owner keeps notes on formulas outside of AmiBroker, it can be useful to copy the name of the formula into the code. That way, when the formula is copied and pasted back into AmiBroker the name will be ‘shipped’ with the formula. It also helps with version control by recording the version number in the formula.

Note: This helps avoid naming mishaps since changing the version number in the formula requires a deliberate effort that goes hand in hand with formula modifications. 

To copy formula names into the code:

1) Select the formula name by clicking in the name box.

2) Right click in the selected area and pick Copy from the context menu that opens.

NamingFormulaFiles002

3) Right click inside the Formula Editor ‘page’ and select Paste from the context menu that opens.

NamingFormulaFiles001

4) Delineate the formula name, as a comment, by adding the symbol pair /* and */ before and after the name.

NF001

5) When the formula is exported, in any format, the name travels with the formula.

/*P_PriceFields*/

field = ParamField(“PriceField”,3);
Color = ParamColor(“Color”,colorBlack);
Plot(field,”(“PriceField”,Color,styleLine);

6) When the formula is ‘imported’ back into AmiBroker the name can be copied, from the formula, and pasted back into the Formula Editor name box. 

MACD Histograms (v1)

Next Page »