Aligning Bar (array element) of Custom Fields with datetime of Ticker

@Tomasz Am using Osaka Plugin to import custom fields. These fields also have Date column, but this date is not necessarily 100% overlaps the Date as in the native DB for a Ticker.

Data as in Native Amriboker DB for MSFT Corp:

Date Open High Low
2017-01-01 10 12 9
2017-01-02 10 12 9
2017-01-03 10 12 9
2017-01-04 10 12 9
2017-01-05 10 12 9
2017-01-06 10 12 9
2017-01-07 10 12 9
2017-01-08 10 12 9
2017-01-09 10 12 9
2017-01-10 10 12 9

Imported a table using OSAKA plugin:

Data News EPS PE
2016-12-10 Export 5 12
2017-01-01 New Order 6 12
2017-01-05 Expansion 7 12
2017-01-10 Divident 8 12
2017-02-01 Bonus 9 12
2017-03-01 Result 10 12
2017-05-26 Right Sh 11 12

As you can see Dates of Imported table is not the same range as dates in native DB for MSFT.

I want to assign array element (in case of Numeric Var) / dynamic number (in case of String var) to Osaka columns by date as a match Key. So i can assign each Cell in Table to respective date in Native DB for MSFT.

Expected Output: (Filling Data holes with 0) ()

EPS [Array Element] (Number of Elements same as BARCOUNT)

eps[0] - 6
eps[1] - 0
eps[2] - 7
eps[3] - 0
eps[4] - 0
eps[5] - 0
eps[6] - 0
eps[7] - 0
eps[8] - 8

As you can see now the Imported Table Column’s values are now aligned with the Elements in Date of native DB for MSFT.

Questions:

  1. How do i match the Date of each bar with the Date of Imported Table? I have to ensure that both dates are in same format. So how to do it?

  2. Any other thing that I am missing in this approach?

Why are you doing this hard way?

Instead of using OSAKA plugin, import your data using ASCII importer into Aux fields and/or extra tickers. Then you will get date/time synchronization for free using Foreign() function.

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

I have yet to see single reason to use OSAKA plugin now. (In the past it was marginally useful, but now… there is no point in using it anymore)

Otherwise you would do the aligning yourself, finding correct bar using Lookup() function and assigning array elements bar by bar, which means slow.

Native DB offers orders of magnitude faster access.

Here is my use case:

I never intended to use Amibroker for the OHLC (numbers only) kind of analysis. Even though fundamental data is also number but there is something I believed in my Journey of Investments that all these Numbers are “LAGGED”.

LAGGED IN = LAGGED OUT.

I intend to use AB to overlay Textual Information (News, sentiments, announcements, disclosures and much more). (Noiseless Qualitative Data basically) This is what I call Qualitative Analysis. I am even integrating SOLR Full text with AB.

Amibroker’s Native DB design is not for me. It conflicts with the way I think an Investment Tool Should be. At the Moment this native DB is about “Numerics”.

Using any AUX fields even the composite tickers yields me nothing as I can not mock string array.

Hence, hacking OSAKA is my hope.

So, Can you please give me some guidance on How can I align Custom Fields with Native DB datetime?

Please?

I have given it already - re-read my post.

By the way you are mistaken if you think that these are just numbers. No. Numeric array can be used for anything you wish and more. The number in the array can be an index to news story that you can read on the fly from text file using fopen() / fgets() / fclose()

First thing to do is to open your mind. Then you can start programming. Programming is not about coding. Programming is invention. It is art. Art of innovation.

2 Likes

This quote is worth remembering. This could be our new forum’s motto :slight_smile:

5 Likes