How to increase max. number of bars (Database settings)


#1
  1. if Data source setting of File > Database settings is set to local database then number of bars is not limited to default number of bars limit. There is no need to set number of bars in that case.
  2. Number of bars setting of File > Database settings is relevant only if using data plugins.
  3. Default 500k bar limit (AB versions 6.17+ have 1Million bars default limit) of number of bars setting is relevant only for data plugins too.
  4. But also keep in mind that there is no hard coded 500k bar limit at all since it can be changed in registry any time.

Quote by AmiBroker:

The limit is not hard coded... it is here for performance reasons but if you have hyper-fast machine you can adjust the limit by creating the following (DWORD) key in the registry
HKEY_CURRENT_USER\Software\TJP\Broker\Settings\MaximumNumberOfBars

If you use local database as data source then there is no need to set registry value to a limit higher than 500k (see 1.)! So once again it's related to DBs using data plugins as data source only!

5.it makes no sense to use multiple years of 1min history in real-time data bases -> (recommended) conclusion: use separate data bases (realtime (trading) <-> non realtime DBs (analysis)).

Additional read https://www.amibroker.com/guide/x_performance.html

Now in case you still want to change the (real-time) plugin 500k default limit to a different number of bars here is how to... (in the example the limit is set to 1 Million instead of 500k):

  1. Go to Windows Start > Run and insert regedit and hit enter
  2. in the registry editor browse to HKEY_CURRENT_USER\Software\TJP\Broker\Settings
  3. Right click Settings folder and choose New -> DWORD-value
  4. insert MaximumNumberOfBars as DWORD name and hit enter
  5. double click that newly created value and in settings window choose decimal and insert your custom value (new bar limit), in example below I have set to 1000000 (you can set to any reasonable value).
  6. Click OK and close Regedit
  7. Set your new number of bars value in AmiBroker

(Note: the registry editor below is not Windows's Regedit but 3rd party freeware called Regmagik. You may use Windows Registry editor instead via Start - Run - Regedit)

If double-clicking MaximumNumberOfBars value then the properties shows up which you may edit


DTN IQFeed Historical Data
Data Feed Historical Data IB
Candle forms discrepancy and limited amount of data which can be downloaded from IQFEED
#2

I am not very keen to use “unlimited” word. Everything has its limits. You are certainly limited by RAM size. The array has to be allocated in RAM, so there must be enough RAM. With 40 bytes per data bar, 1 million bars takes 40MB. It may not seem too much nowadays. With 50 million of bars you reach 2GB limit on 32-bit Windows. Keep in mind that data must be actually read from somewhere. Downloading 2GB of data per symbol takes time.

It is really a pity that in todays world that relies so much on technology, nobody teaches technology in schools. But at least everyone had physics in school so they may remember that speed of light is limited too.


#3

Yes, of course you are right. By “unlimited” I actually meant “not being limited to default limit”. I will change it.


#4

Thanks to fxshrat and TJ to point out the errors of my ways. Yes, I added the key as suggested in the doc and set the value to 5MM. Now I have 1-min bars starting on 9/7/2005 in Amibroker.


#5

Don’t worry. This was not meant as any kind of critique. Just general remark (2 cents worth). “Unlimited” was definitely better sounding than “not limited by limit”. If I were to suggest something I would say “Limited by computer’s memory”


#7

Dear Tomasz,
I've currently read the same pages on database and the number of bars and other relations.

I get RTD data which I have set to base interval to 1 min and stored locally.
What I have realized is that when explore runs, it loads each symbols data file in the RAM.

When I start AB, its like 10MB, and for every symbol added to explore it increases by about 1MB per symbol because currently that seems to be the size of each flat file (file of each symbol in local DB).

Q1. Is there a way to limit the number of bars stored in the RAM? My Explore is very vbasic and computes only on past 10 days data.

Q2. 200MB isn't a big deal but the daily rise seems to be alarming over a period, can this be handled or one needs to dump, trim and re-import the data?


#8

It is discussed here: http://www.amibroker.com/guide/x_performance.html