Low-level gfx example: Yearly/monthly profit chart
The code below is an little bit more complex example of Low Level Graphics functions (see http://www.amibroker.com/guide/a_lowlevelgfx.html) It allows to display three kinds of charts: yearly/monthly...
View ArticleGetting started with automatic Walk-Forward optimization
Recently released AmiBroker 5.05 BETA features the automatic Walk-Forward Optimization mode. The automatic Walk forward optimization is a system design and validation technique in which you optimize...
View ArticleBig symbol text in the background
Recently I heard the suggestion to add a security symbol written in big letters in the chart background. Well, actually it is pretty simple to do using low-level gfx. Just add this code sniplet...
View ArticleHistorical portfolio backtest metrics
Recently on the AmiBroker mailing list some users expressed wish to have access to some of portfolio backtest metrics available in “historical” form (i.e. as date series, as opposed to scalars), so...
View ArticleQuickAFL facts
QuickAFL(tm) is a feature that allows faster AFL calculation under certain conditions. Initially (since 2003) it was available for indicators only, as of version 5.14+ it is available in Automatic...
View ArticleAFL execution speed
AmiBroker Formula Language (AFL) thanks to its array processing model is able to run at the same speed as code written in assembler (i.e. machine code). The following article explains how. AFL runs...
View ArticleHow to convert from bar-value to pixel co-ordinates
Sometimes when using low-level graphics functions it is needed to convert from bar number to pixel X co-ordinate and from price level to pixel Y co-ordinate. Converting between them needs knowing...
View ArticleStudy() function in logarithmic scale
IMPORTANT: This article applies ONLY to AmiBroker version 5.24 and earlier. Version 5.25 includes native support for log scale in Study() function and this workaround is no longer needed. Some of you...
View ArticleAbout floating point arithmetic
In general, to represent numbers with fractional parts, computers use a “floating point” binary representation. Floating point arithmetic is also used by AmiBroker for AFL calculations. For some more...
View ArticleThird-party plugins must use multithreaded run-time
All developers of 3rd party plugin should NOT change the default project settings that are provided in sample projects in the ADK. If you change anything, you must make sure that you are using...
View ArticlePoints-only backtest
Some users coming from Metastock ask for “points-only” test. One needs to know that AmiBroker features way more sophisticated futures mode than MS ever had:...
View ArticleUsing Zig-Zag in trading systems
Zig-zag indicator, as well as other functions using it (Peak/Trough, PeakBars, Troughbars), inherently look into the future. As such they should not be used in trading system formulas without taking...
View ArticleWhy do backtest results change?
From time to time we receive questions about why you can get different results back-testing the same code. There are five reasons for differences in backtest results: Different data (for example if...
View ArticleBroad market timing in system formulas
Some trading systems may benefit from attempt to time the broad market. A market-wide valuation, such as moving average, sentiment or some other mechanism may be used to tell if we should be in the...
View ArticleA function with multiple return values
A typical AFL function returns one value. For example sin( x ) returns sine value of argument x. Sometimes however it is useful and/or required to return more than one value from the function....
View ArticleDo NOT make assumptions on number of bars
From time to time some users face “Error 10. Subscript out of range” in their formulas. The error itself is described in the manual, but still a few words of explanation why it happens may be useful....
View ArticleHow to identify signal that triggered entry/exit if multiple signals are used
When designing a trading system we often need to quickly identify which of the rules used in the code triggered the particular Buy or Sell signal. Here are some techniques that may be useful in such...
View ArticleClosing trades in delisted symbols
When we perform historical tests on databases that contain delisted symbols – we may encounter a situation, where there are open positions in those tickers remaining till the very end of the backtest,...
View ArticleHow to create your own code snippet
AmiBroker 5.84 (released today) offers users an easy way to create their own code snippets. Code snippet is a small piece of re-usable AFL code. AmiBroker comes with lots of pre-defined snippets. You...
View ArticleDebugging techniques – Part 1 – Exploration
From time to time people send us their formulas asking what happens in their own code. Or they do not know why given trade is taken or not. These questions are usually caused by the fact that people...
View Article