SetForeign Intraday

Hello and good day,

I have only traded EOD so far and am now getting used to RT trading. I use an RT plugin.

I have read so far

http://www.amibroker.com/guide/h_workspace.html

and many other posts here in the forum about my problem.

My code calculates rankings in status Stocknum == 0 via SetForeign and StaticVarGenerateRanks.

If I understood correctly, one called in the scan updates
--> Buy = 1
on the current watchlist and the set period, the entire database with the current data from the plugin.

Is this current data also available when accessed via SetForeign or do I first have to execute Save Database via a batch, for example.

If I close the APX file and reopen it, the data is available via SetForeign. I tested it.

What have I missed, misunderstood or not yet read?

Many thanks for the help

Addendum.....

I'm irritated that hours later I still see the timestamp at the time the database was opened in both the exploration and the scan. Close, for example, is timed correctly in exploration.

Many thanks for the Help

Which RT plugin exactly? That is VERY important. Not all plugins are created equal. Especially some 3rd party plugins are missing features.

Nobody could solve your problems if you don't provide crucial information: How to ask a good question

Generally:

  1. It does not matter if you run Scan, Exploration, Backtest, via Foreign or not or what ever. Data are accessed the same way regardless

  2. Also Foreign works the same regardless if it is EOD or Intraday.

If you are running with data plugin that does backfill:

  1. You need to remember that by default backfills in our plugins are asynchronous, the plugin requests data from remote data source and does NOT wait with analysis, it goes thru making more requests. Eventually data vendor/source responds with data and they arrive but they will be seen only (obviously) after data source responds.
  2. For reason explained in (1), you might need/want to wait for data source to complete backfills (at least initial after starting AmiBroker)
  3. In order to perform backfills synchronously (i.e. WAITING for external data source) you have to run Analysis at least once since AmiBroker with "Wait for backfill" option turned on
  4. "Wait for backfill" must be supported by the data plugin. If it doesn't it won't work (won't wait).
1 Like

First of all, thank you for the comprehensive help. Helped me understand the process better. It wasn't entirely clear to me whether the data updated in the memory by the plugin was already being used when accessing via SetForeign or only the data existing in the internal database.

I use the plugin from Taipan RT 64 Bit, company Lenz + Partner, in Germany. They describe themselves as an official partner of Amibroker on their website.

The “Wait for Backfill” option is activated for me.
The plugin hangs after I run Scan several times. But this may be because I call Buy = 1 in the scan for the entire test period. Buy = Status("LastBarInRange") or similar might work better.
If I understood it correctly, even a single scan before the start of trading would probably be enough.
But I can't test it until Monday.

Thanks again.

Unfortunatelly, Taipan wrote the plugin by themselves. They did not ask questions about backfill, or anything, so I doubt if it is implemented at all.

If wait for backfill was implemented in the plugin, you would see it waiting before proceeding to next symbol as typically request->response takes something like a second or so, so it is clearly visible that it steps.
If it goes fast, it means that plugin is not waiting.

The formula that you use for scan doesn't matter. It is completely irrelevant if you use Buy = 1 or Buy = Status("LastBarInRange").

Normally (i.e. our own plugins) request backfill and subscribe to given symbol therefore after initial backfill symbols are kept current in real time and don't need backfill again. That is however subject to subscription limits. For example IQFeed has subscriptions with 500 or even 1300 real time symbols.

1 Like

I know from a trader friend that the developer of the plugin hasn't been employed there for years. Version 1.1.1 also suggests a beta version. This trader friend introduced me to Amibroker about 3 years ago. I am still grateful to him for that today and pray for him every evening. :slight_smile:

I believe that Wait for Backfill is implemented. If you perform a scan with Buy = 1 on an empty database, for example on the HDAX or the N100, hourly Compression, the status at the bottom right will show "Busy" for 80 - 100 seconds.

Taipan has no restrictions on the amount of titles subscribed to in real time and also RT tick data going back to 2002. Backfills are possible without restrictions. In addition, all European and American markets are available in real time.
One reason why I've been struggling to get the plugin to work properly for at least 3 days.
I've been an RT and EOD customer there for more than 20 years and will call on Monday.

But it is probably better to subscribe to IQFeed or eSignal on the highest possible subscription as I only do portfolio trading on N100, SP500, SP900, ASX200 and TSX60.
The plugins should work perfectly.
I have been using EOD with Amibroker anyway and exclusively Norgate for more than 2 years. RT Trading I am new to Amibroker.