How to assign groupID automatically when importing data into AB

Hello,

I’m using Amiquote to retrieve Yahoo data. I want to add new stocks to AB. I want to use Amiquote to download the data and import it automatically into AB.

Is there a way to assign groupID automatically while importing the data?

I know it’s possible to do that manually or automatically using OLE AFTER importing the data. Just wondering if I can do it while importing.

Thanks

If you mean to assign to different group per symbol or group of symbols then read here

So create CSV file with Ticker and Group ID columns.
Create import format to be inserted into additional commands when importing that file's data.

$FORMAT Ticker,Group
$OVERWRITE 1

Or use Symbol - Organize Assignments - Groups of menu bar.

2 Likes

Thanks

Here’s what I mean

Say, e.g. I don’t have EWG in my DB. Now I want to add it to my DB. I’d go to Amiquote, add EWG ticker, choose Yahoo Historical data and download the data.

Amiquote will automatically import the data into AB. It also automatically assigns a groupID to EWG, say e.g. group 0

However, I want Amiquote to assign EWG to, say e.g., group 27. How can I do that?

@spec, one alternative way, mainly useful for single/few additions to the database, is using the "Symbol information" window in AmiBroker (not Amiquote).

image

Using it, you can also change/correct other data like the full name, currency, etc.

You need to open/display it from the main menu item "Window":

image

So since you have

e.g.

there in your post it appears as been guessed in post #2... you apparently want to add multiple symbols to separate groups. Then post #2 is way to go!

If you want to add all/multiple symbols to same group then go C:\...\AmiBroker\Formats folder and open aqh.fromat file with NotePad and add/modify

$GROUP 27

-> aqh.format file content (for Yahoo Historical data):

# AmiQuote historical quotes download format (.AQH extension)
# Revision 1.4 - changed the order of columns (due to July 22, 2017 Yahoo site change)
# Revision 1.3 - changed the order of columns (due to May 17, 2017 Yahoo site change)
# Revision 1.1 - removed $VOLFACTOR 0.01
# The format line below allows to get data adjusted for SPLITS
# to get data adjusted for SPLITS AND DIVIDENDS replace 'Skip' by 'AdjClose'
# 
$FORMAT Date_DMY,Open,High,Low,Close,Skip,Volume
$SKIPLINES 0
$BREAKONERR 0
$SEPARATOR ,
$DEBUG 1
$AUTOADD 1
$CONT 1
$GROUP 27
# the following switches are optional - please consult
# the read-me for description of those options
# $RAWCLOSE2OI 1   
# $RECALCSPLITS 1
# $ROUNDADJ 4
2 Likes

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.