AmiQuote to merge as opposed to replace all data

Is there a way for AmiQuote to merge (keep unrelated values in aux1 and aux2) import data as opposed to replace (add open,high,low,close,volume as expected but also zero out aux1 and aux2) import it?

Here's a specific scenario:

  1. Last month, I did ASCII Import for aux1 and aux2 fields, for example storing "1" under aux1 on 11/4/2020 and 11/5/2020 (Fed meeting days) under ^RUT index symbol.
  2. When 11/4/2020 came, AmiQuote using aqh.format with:

$FORMAT Date_DMY,Open,High,Low,Close,Skip,Volume
$SKIPLINES 0
$BREAKONERR 0
$SEPARATOR ,
$DEBUG 1
$AUTOADD 1
$CONT 1
$GROUP 254
$VOLFACTOR 0.01

added open,high,low,close,volume data based on ^RUT.aqh

$NAME ^RUT

Date,Open,High,Low,Close,Adj Close,Volume

04-11-2020,1612.979980,1631.310059,1598.560059,1615.079956,1615.079956,47830400

for ^RUT, as expected. But it also replaced my aux1, it's no longer 1, it became a 0 even though ^RUT.aqh data did not contain new values for aux1+aux2, nor did aqh.format specify any changes to aux1 or aux2.
3) How do I get AmiQuote import to merge as opposed to replace data?
a) I already tried adding 2 extra "Skip" in my aqh.format file, but aux1 and aux2 still get zero'd out

$FORMAT Date_DMY,Open,High,Low,Close,Skip,Volume,Skip,Skip

b) I looked for a "preserve" or "merge" flags in the manual at https://www.amibroker.com/guide/d_ascii.html but could not find anything related.
c) Since aux1 data gets replaced, I tried to use OLE Import() to reimport it every day, after AmiQuote runs in my process, but it does not work for me, as per OLE import using ruby

It is described in the Knowledge Base:

http://www.amibroker.com/kb/2015/01/29/importing-auxilliary-data-into-amibroker-database/

Relevant mode is called HYBRID. Note that Hybrid mode would NOT overwrite High if imported high is lower than existing high, and would NOT overwrite Low if imported low is higher than existing low.

So in fact you should be using Hybrid mode in a way described in the Knowledge Base, ie. import quotes FIRST and THEN Aux data, not the other way round as you are trying to do.

1 Like

Thank you, Tomasz.

I was already using

$HYBRID 1

in my aux1.format and aux2.format as per the Knowledge Base.

4 a) Now I added

$HYBRID 1

to my aqh.format as well, but the side-effect seems to be that the default values of "-10000000000" as opposed to "0" for unsupplied values, namely aux1 and aux2 on most days.
4 b) " import quotes FIRST and THEN Aux data, not the other way round as you are trying to do"
Why does one need to do it in that order? Is it because of the "-10000000000" defaults? Historical quote data comes in new every day, while aux data import could be done once every year. If HISTORICAL quotes have to be imported first, and then auxiliary data, that in my case stores past and FUTURE events such as Fed meeting days, it won't work in my use case, without resolving OLE import using ruby

Why does one need to do it in that order?

Because I say so. This is QUOTATION DATABASE. You can't have quote without quote. As simple as that. Quotes are REQUIRED in the quotation database. Aux field are "auxiliary" so they are extra data and they CAN NOT exist without quotes. Do what is written in the Knowledge Base. Using the software against instructions is not supported.

-10000000000 is NULL (empty) value in AFL, which is not surprising because you do not supply the data.