How to manage overlapping entry/exit signals in portfolio test
When we run the portfolio-test and use default backtesting procedure – on each bar AmiBroker will first process exit signals, then use entry signals to open new trades. There may be some strategies...
View ArticleCustomizing chart titles
When we create custom indicators in AmiBroker, then by default the program will automatically create chart title line based on the selected ticker and the information we have provided in Plot function...
View ArticleChoosing first day of the week for weekly compression
AmiBroker allows to define, what days to use for weekly compression. By default weekly compression uses Monday-Sunday week (i.e. Monday being the first day of the week), we can change it however to any...
View ArticleHow to handle delisted symbols in rotational test
This Knowledge Base article: http://www.amibroker.com/kb/2014/09/26/closing-trades-in-delisted-symbols/ explains how to close trades in delisted symbols in regular backtest (to avoid holding delisted...
View ArticleSymbol selection when PositionScore is not defined
AmiBroker’s portfolio backtester allows to define stock ranking and selection criteria by means of PositionScore variable. This is explained in details in the following tutorial chapter:...
View Article“Invalid symbol” message for stocks traded on multiple exchanges (IB)
Some of the symbols available from Interactive Brokers data-feed may be traded on multiple exchanges. In such case, when we enter the symbol to the database as: INTC GLD CSCO then we may see “Invalid...
View ArticlePositioning area plots behind the grid lines
When we want to paint the background with custom colors to indicate certain states or conditions – we can use area plots style for this purpose. The code example presented below shows green background...
View ArticleHow to categorize symbols coming from Metastock databases
Many data vendors that deliver data in MetaStock database format offer quotes in separate MS databases organized in several folders, separate for different markets or industries. AmiBroker does not...
View ArticleHow to move a window to another monitor
By default document windows like Charts, Analysis, Account Manager, Web Research all open inside of main AmiBroker frame window. In multi-monitor setups it may be useful however to move some of them to...
View ArticleHow to restore program menus and/or toolbars
If we unintentionally make some changes to our toolbars or main menu using customization option, there is an easy way to restore the toolbars and menus to the default settings. All we have to do is to...
View ArticleHow to browse charts in selected date range
In order to select certain range of dates in the historical chart, then scroll through the history of tickers, we can mark the range of dates we interested in using Range Markers (double-click on the...
View ArticleHow to run certain piece of code only once
There are situations where we may need to run certain code components just once, e.g. to initialize some static variables before auto-trading execution or perform some tasks (such as ranking) at the...
View ArticleHow to increase maximum periods of built-in indicators
Built-in indicators and averages which are shipped with AmiBroker use Param() function calls to provide the ability to adjust parameter values through Parameters window. Param function in the code...
View ArticleHow to combine multiple databases into one
In order to combine data stored in two separate databases within a single database we may consider one of the following options: ASCII IMPORT/EXPORT METHOD First of the possible ways is to export data...
View ArticleHow to fill background between hand-drawn trend lines
Among built-in drawing tools, the Triangle, Rectangle and Ellipse allow to fill the background with custom color. However, if we wanted to fill the space between manually drawn trend lines, then we...
View ArticleHow to create custom import definition for ASCII importer
When we use File->Import ASCII to import data, we can choose import file format using one pre-defined import format definitions. As it is explained in the manual...
View ArticleHow to count symbols in given category
When we want to find out how many symbols belong to given category (such as watchlist) then for manual inspection, it is enough to hover the mouse cursor over the particular category name in the...
View ArticleHow to read highest high value of future bars
Built in HHV and LLV functions allow to read highest high or lowest low of n-past bars. If we want to refer to future values, there is an easy way to do it using simple Ref function and just shift HHV...
View ArticleHow to show price ratio between two symbols
Charting ratios between the prices of two symbols can easily be done with AmiBroker. For this purpose we can use Spread built-in formula available in Charts window: Then select the style as Ratio: The...
View ArticleHow to write to single shared file in multi-threaded scenario
The problem is as follows: during multiple-symbol Scan (or any other multi-threaded Analysis operation) we want to create a single, shared file and append content generated from multiple symbols to it....
View Article