The Most Important Setting in AmiBroker
By Dave Mabe
If there's one setting you should know in AmiBroker, it's this one.
The Number of Bars in your database.

There is some confusion about how it works, but it's pretty simple.
That setting only applies to a database connected to a real-time data feed, like IQFeed.
When you backfill a symbol, that setting determines how many bars back to request from the data feed.
That's it!
Here are the implications you'll run into.
In real-time databases, the oldest bar retrieved will vary widely across symbols.
(Remember, the setting is the number of bars, not the number of minutes.)
For example, SPY and AAPL trade almost every minute, so when you retrieve 300k bars, the oldest bar will be relatively recent compared to a symbol that trades less frequently.
This means the further back your data goes, the sparser your backtest data will be.
This is normally fine, just understand what's going on.
Changing the Number of Bars setting does nothing on its own.
It only affects how much data is requested during backfilling.
Increasing the value won't increase the history in a symbol you previously backfilled, since the backfill just fills in data newer than the most recent bar you've already backfilled.
Similarly, decreasing the value doesn't reclaim disk space by truncating old bars.
This is why I always recommend NEVER changing the setting once you've already created an AmiBroker database.
If you need to change the setting, just create a new database.
Local databases (no real-time plugin connected) completely ignore the setting.
This surprises most traders.
This is one reason the free backfilling tools I provide are so valuable: they let you set the oldest bar DATE across all symbols, not the number of bars.
This distinction matters because when you create a database with the IQFeed or Massive Backfill Tool by MabeKit, the oldest data in your database isn't sparse.
Each symbol goes back to the same date (assuming it traded back then), regardless of how many bars that is.
This makes a big difference!
-Dave
P.S. Afraid to size up because you don’t trust your edge? Build confidence to trade your strategy with bigger size with MabeKit. Get Instant Access