Amibroker Cheat Sheet v1.0-1
Amibroker Cheat Sheet v1.0-1
Amibroker Cheat Sheet v1.0-1
TRADING TUITIONS
Important Shortcuts
Shortcut Keys Purpose Shortcut Keys Purpose
ALT + RIGHT Open chart for the next symbol in CTRL + H Enable crosshair
ARROW KEY the database
CTRL + R View and edit chart
ALT + LEFT Open chart for the previous symbol parameters
ARROW KEY in the database
CTRL + E Edit formula
F3 Stock symbol finder by name or
ticket SHIFT + F1 Open contextual help
SHIFT + F1 Open contextual help F1 Open Help Window
F1 Open Help Window
TRADING TUITIONS
Creating New Shortcut Keys
Go to Tools → Customize → Keyboard and assign a new shortcut key to
commonly used functions
TRADING TUITIONS
Useful Tips to Improve Performance of Amibroker
Hardware/Operating System
• Put your data onto a secondary SSD drive. Solid State Drives increase
performance significantly.
• Install a 64-bit version of Windows so that you can use the 64-bit version of
Amibroker Professional Edition. 64-bit CPU operations are significantly quicker
than 32-bit.
• Upgrade to Intel i7 8700K CPU. AMD Ryzen 5/7 is a viable alternative too.
TRADING TUITIONS
Amibroker Settings
• Change the Amibroker settings for "In-memory cache size". This settings can be
found at Tools > Preferences > Data. If you have at least 2GB of RAM, you could
increase "Max. MegaBytes" to 1000. You may increase it more if your RAM
size is higher.
• The setting for "Max. Symbols" may also be increased to the limit of 20,000.
However, a run should never be performed on more symbols than is necessary.
• Try to keep number of bars to minimum value in File > Database Settings. Each
bar is equivalent to 40 bytes, so if your enter 50000 bars it will allocate 2MB
per symbol. For best performance, make sure that you don't exceed CPU on-
chip cache size, so if your CPU has 4MB cache, for best performance it is
strongly advised not to use more than 100000 bars in File->Database Settings.
TRADING TUITIONS
Backtesting/Optimization Level
• Try not to Optimize too many parameters at the same time. Limit your attempt
to two parameters at a time.
• If you have lots of optimization params (more than 10K combinations) use
smart optimizer (CMAE/PSO).
• You can also use “Individual Optimize” from Amibroker 5.7.0. It will use all
available processor cores to perform single-symbol optimization, making it
much faster than regular optimization.
• Another useful approach is to prefilter the watchlist based on some static set
of criteria. For example, if your strategy requires a minimum price of $5/share
and volume greater than 1M shares, then you can write a small exploration to
find only those stocks
TRADING TUITIONS
AFL Level
• Replace loops with Array processing. For example – C[n] refers to close price of
nth bar, rather C refers to an array containing close price of all the bars.
• Array version of the code can be up to 100 times faster than loop version.
• Use the AFL Formula Editor, Tools->Code check & Profile to find out which
functions are called how many times and which ones take the most time. Start
your code tuning with functions that are called the most often.
TRADING TUITIONS
Tips to Debug your AFL Code
When you are having problems with your code, reduce it to the smallest
1 snippet that still is problematic. Dividing and conquering always helps.
Use detailed logging to see what backtester is doing on each internal bar
3
Use the inbuilt debugger. allows you to single-step thru your formula, set
4 breakpoints, watch the content of your variables and more
TRADING
TRADING TUITIONS
TUITIONS
Most commonly used AFL Functions
Function Name Syntax Purpose
IIF() IIf( expression, It returns the value of the second parameter if the conditional
YesValue, NoValue ) expression defined by the first parameter (EXPRESSION) is true;
otherwise, the value of third parameter is returned (FALSE_PART). It
works with both numbers (scalars) and arrays. When any of
arguments is an array it returns array.
ExRem() exrem( ARRAY1, It removes excessive signals. Returns 1 on the first occurrence of
ARRAY2 ) "true" signal in Array1 then returns 0 until Array2 is true even if
there are "true" signals in Array1
Param() Param( ''name'', Adds a new user-definable parameter, which can be accessed via
defaultval, min, max, Parameters dialog
step, sincr = 0 )
TRADING TUITIONS
Function Name Syntax Purpose
Printf() printf( formatstr, ... ) Formats and prints a series of characters and values to the output
window
MA() ma( ARRAY, periods) Calculates the simple moving average of the array for the defined
period
MACD() macd(fast = 12, slow = Calculates moving average convergence divergence (MACD)
26) indicator using fast and slow periods
Error() Error("text") Stops the formula execution and displays user defined error
message
TRADING TUITIONS
Best’s for Amibroker
Best EOD Data Source Norgate Data
TRADING
TRADING TUITIONS
TUITIONS
In order to learn Amibroker and Trading system development from scratch
please visit
https://academy.tradingtuitions.com
TRADING
TRADING TUITIONS
TUITIONS