Backfilling of N symbols

newbie
howto
Tags: #<Tag:0x00007f2d7aa63868> #<Tag:0x00007f2d7aa63728>

#1

We are writing our own data plugin to feed data into AB from our source. We have problem when backfilling of N symbols using Autofill.afl (Buy=1). Problem description.

  1. There are 3 symbols added to watchlist namely A, B and C. Symbol A loaded in Chart
  2. When we scan using Autofill.afl, Plugin receives ‘GetQuotesEx(…)’ call for symbols(A,B,C) and we pull data one by one in background(async).
  3. We are issuing WM_USER_STREAMING_UPDATE for those symbols completed downloading eg(WPARAM A/B/C, LPARAM BarReady flag set).
  4. Now, we are getting call back of ‘GetQuotesEx’ for the symbol loaded on chart(ie, A only) for all WM_USER_STREAMING_UPDATE
  5. We are not able to push data to AB for symbol B and C, even though the plugin downloaded it.

What was we are missing or the right way to handle this scenario.
Thanks in advance.

Venkat


#2

For start, read this please:
http://www.amibroker.com/kb/2014/09/23/how-to-backfill-all-symbols-in-rt-database/

This provides information how you should run scans to WAIT for backfills. Secondly your plugin needs to implement flagging symbol as “incomplete” while the backfill is NOT completed.
To mark symbol as incomplete you need to set this flag: RI_STATUS_INCOMPLETE in the nStatus field of RecentInfo structure.

struct RecentInfo *ri = GetRecentInfoForSymbol();
ri->nStatus |= RI_STATUS_INCOMPLETE; // set the flag, backfill is NOT complete
....
ri->nStatus &= ~RI_STATUS_INCOMPLETE; // clear the flag, backfill is complete