Sei sulla pagina 1di 8
Aamibroker Home News Products Download Order Support Home » Knowledge Base January 23, 2016 How to create custom import definition for ASCII importer When we use File>Import ASCII to import data, we can choose import file format using one pre-defined import format definitions. As it is explained in the manual (http2/www.amibroker.com/euide cii html) it is also possible to create our custom import definitions to match data we are trying to import. This article explains all the required steps. The easiest method to create import definition is to use File->Import Wizard. In the first page, select at least one file in the format we want to import and on the second page configure columns: Define fields tere you can define the fields in the data fle, Use combo-Doxes to select appropriate field type. Hover the mouse above the contrds to see additional hints. [E)No quotation data allow negative arices Data fil sample: ‘Symbol Trade,Date,Cose, 2P Buy, 2000-01-04, 38,0300 206 Euy, 2000-01-05, 37.1300 AXP Buy, 2000-01-06, 37.8800 This all easy when we are importing quotation data, but when we are importing non-quotation data such as category assignments, we can not select appropriate columns using Import Wizard. In such case we need to type-in appropriate $FORMAT command in the “Additional commands” field of Import Wizard. For example if we have file with categories like this: 3D Systens Corporation", "Technology", "Computer Software: Prepackaged Software" ,1 Company”,"Health Care","Medical/Dental Instruments" ,1 00.com Limited", "Consumer Services”, "Services-Misc. Amusement & Recreation" ,1 “Computer Software: Programming, Data Processing” ,1 "Consumer Services", "Newspapers/Magazines” ,1. »"Technology”, "Computer Communications Equipment” ,1 "AKC", “A.H. Belo Corporation’ "ATEN" ,"A1@ Networks, Inc. ‘AAR Corp.","Capital Goods","Aerospace”,1 ‘Aaron's, Inc.","Technology*, “Diversified Commercial Service: We need to add the following commands in the “Additional commands” field of Import Wizard $FORMAT Ticker, FullName, SectorName, IndustryNane, Group $OVERWRITE 1 $CLEANSECTORS 1 $SORTSECTORS 1 First line tells AmiBroker the column meaning, second line tells it to overwrite existing data. Last two lines tell AmiBroker to wipe existing category structure and sort imported sectors alphabetically. Be sure NOT to specify $CLEANSECTORS command when you do NOT want to wipe existing category structure. We also need to mark “No quotation data” box in the second page of Import wizard to tell AmiBroker that the file that we are importing does not contain quotes and it should switch off all price checking, Here you can define the fields in the dla file, Use combo-boxes to select appropriate field type. Hover the mouse above the contrds to see additonal hints. Column 2 Column 2 Column 3 Cokmn 4 Column § Column § Celumn 7 Data fe sane: + Fle tobe imported using AmBroker ASCH mporter and Fornatsbtodsendsec SMARKET 1NVSE a “D0D',"30 Systens Curporation’, Technology, "Computer Software: repackage — ‘wiv Company’ Heath Care", Nedica/Derts! Instruments Finally, in the last step of the wizard save the format definition: Now you are ready to import the flets). Please check addtional settings below if you want to use current formatin the future Description: Fle mask: Once we do this, next time we use File->Import ASCIT a new selection My own format will appear in the Files of type combo box in the file selector dialog, tenoo sav csv) & i e a ‘AniQuote Hisrical eSignal) ("20e) ‘Metastock ASCII Cx) (Omega SC ASCII "be ‘SFiles (°°) (Ces °) ‘Sharenet DN (da) PRN Fomat with Ticker Com) PRN Fomat withou Tiokor (pm) ‘Space separcied Ticker Date OHLC ("bd) ‘Space eoparcted Dato HICV Cbd) ‘Shott Daly CSV (csv) MST Fomat w/Ticker (met) ‘Stock Watch om fermat (csv) “TenBagger format (stk) {CB impor (7) ‘Symboledind Sectors (°°) ‘Bloomberg EOD (.) EURUSOCSV (-") ASX symbol it (7) ° 1 2 3 4 5 6 1 8 9 JSS Sees It is worth noting that import definitions are plain text files that are stored in “Formats” subfolder of AmiBroker directory, and the list of available import definitions that appears in “Files of type” combo box, is also a plain text file called “import.types” that is located in the same subfolder. So, advanced users may also modify those files directly using plain text editor such as Notepad. It is all explained in great detail in the ‘manual http://www.amibroker.com/guide/d_ascii.htmL Related Articles: 1, How to import huge ASCH files quickly 2. How to combine data from multiple input files 3. Importing data using multiple column separators 4, How to re-import the same data without downloading them again 5. AmiQuote and free data from Yahoo Filed by Tomasz Janeczko at 8: No Comments January 21, 2016 1am under Data How to combine multiple databases into one In order to combine data stored in two separate databases within a single database we may consider one of the following options: ASCIL IMPORT/EXPORT METHOD First of the possible ways is to export data from one database into CSV files using the procedure presented here: ttp://www.amibroker,com/kb/2006/03/04/how-to-export-quotations-from-amibroker-to-csv-file Once we have our quotations exported into text files, we can load the other database and use built in ASCII importer to import data, The detailed procedure is outlined in the following Knowledge Base Article: hutpy//www.amibroker com/kb/2014/12/29/importing-data-using-multiple-column-separators FILE COPY METHOD Another way of combining the databases is to copy the individual symbols files. Bach database stores individual data files within 0-9,2-7,”_” subfolders and it is possible to copy the individual data files between databases. When copying, we need fo maintain the same folder pattern and copy symbols from “a” subfolder of one database into “a” subfolder of the other database (the same for other folders), so each of the symbols would land in its respective folder. After we copy the data files, we also need to delete broker.master file from the target database folder. This is because this file stores pre-generated symbol list used for fast loading, When we delete the file, it will be reconstructed based on information from individual data files. More information about the database structure can be found in the manual: ttp://www.amibroker.com/ guide/h_workspace.htm| Related Articles: 1. How to combine two databases into one 2. How to combine data from multiple input files 3. Deleting symbols with comma in the name 4, How to categorize symbols coming from Metastock databases 5. Importing data using multiple column separators Filed by Tomasz Janeczko at 3:09 pm under Data No Comments December 29, 2014 columns separated by different characters. This article shows how to configure Import Wizard / ASCII Importer to import such data correctly. Let us consider data file using the following format Ticker, Date/Time, Open, High, Low, Close, Volume EURUSD, 2011-06-13 20:19:00,1.4421,1.4421,1.4419,1.4419,332 FURUSD, 2011-06-13 20:20:00,1.4419,1,4419,1,4418,1.4418, 298 EURUSD, 2011-06-13 20:21:00,1.4418,1.4418,1.4416,1.4417,192 In this sample data file columns are separated with a comma, with one exception — date and time columns are combined together, with a space in between. ASCII importer requires us to specify Date and Time columns separately. Fortunately there is a way to treat space and comma both as separators at the same time, To configure Import Wizard, we need to specify columns to match the input data, treating Date and Time as two separate columns (Colum 2 and Column 3 in this case), additionally we need to set Separator field as ‘Comma or Space, so the importer would properly recognize space as a character delimiting the new column, Define fields i tere you can define the fields in the data fle, Use combo-boxes to select appropriate field type. Hover the mouse above the contrds to see additional hints. Column 1 colurn 2 Column 3 Colmn 4 Column § Coumn 6 Column 7 cok & Col Colm 10 Colm 11 Cokin 12 (Gena erseee =] Separator: Coma () Soup: Semicon (3) Watchists Teb (Fcaloslate composites commands: ‘Semicolon or Spa “Tab or Space (Centos) (Cease) (ine) This way our data will be imported properly. There are also other multiple separator choices available in the Import Wizard, such as Tab or Space and Semicolon or Space that can be used if your data file uses tabs or semicolons as primary column separator. If we build our import definition file manually for ASCII importer, we can also specify multiple separators, by enclosing the required characters in quotation marks in SEPARATOR command. The equivalent format definition for the above input data would look like this: SFORMAT Ticker, Date_YMD, Time, Open, High, Low, Close, Volume $SKIPLINES 1 SEPARATOR ", " $CONT 1 $cROUP 255, $AUTOADD 1 $DEBUG 1 More information about ASCII importer and Import Wizard functionalities can be found in the manual: hitp:/www.amibroker.com/ guide/w_impwizard. html hitp:/www.amibroker.com/guide/d_ascii,htm! Related Articles: 1, How to combine data from multiple input files 2. How to import huge ASCTI files quickly 3. How to correct forward looking timestamps 4, Deleting symbols with comma in the name 5. How to re-import the same data without downloading them again = Filed by Tomasz Janeczko at 3:56 am under Data No Comments Search Links * Home RSS + Pages © Table of Contents © About Knowledge Base See also © AmiBroker DevLog Categories = Problems = Stops © Exploration © AmiQuote Installation Troubleshooting Uncategorized ‘User Interface Tags st Acco Mame: AddToCompocite apie AFL, amiouote Analysis Backtest cacsorics Charting casi Custom Backtester Custom Metries Data peiuy pes aos tscel Exploration Export ros:Tiack File Forex FulName Import Installation tmezsctive Brokers Mavix Mens Metstock OLE Optimization Position Sizing Report Charts Rotational Trading Runtime Side-By-Side Third-party Time Frame Tootwr Troubleshooting Ul sraid Watch Lists Web Research Archives November 2016 April 2016 February 2016 January 2016 December 2015 November 2015 October 2015 September 2015 August 2015 March 2015 February 2015 January 2015 December 2014 November 2014 ‘October 2014 September 2014 August 2014 May 2014 March 2014 May 2012 October 2011 September 2011 November 2010 September 2010 July 2010 April 2009 March 2009 August 2008 july 2008 May 2008 April 2008 February 2008 October 2007 ‘August 2007 July 2007, May 2007 April 2007 March 2007 February 2007 January 2007 October 2006 September 2006 August 2006 May 2006) April 2006 March 2006 Meta Log in RSS. Comments RSS + Company © About Us Branding © Terms & Condition: Privacy Policy. © Email Us Feature List What's Nes Users’ Guide Data sources Videos ‘Tech Support & Sales Members’ Area Knowledge Base DevLog © Users KB + Other © AmiBroker YahooGroup © Usefiul links Copyright ©2016 AmiBroker.com, All rights reserved, This site uses cookies. By browsing this site you agree to our privacy & cookies policy Amibroker.com is a software development company and does not provide any kind of investment or brokerage services in financial markets.

Potrebbero piacerti anche