amibroker

HomeKnowledge Base

How to chart spreads?

To create a spread chart (and other multi-security indicators / statistics etc.) one can use FOREIGN function which allows to refer to other symbols than currently selected:

It’s necessary to do the following:
– Analysis -> Formula Editor
– enter the formula:


spread Foreign"ticker1""C") - Foreign"ticker2""C");
Plotspread"spread"colorRed); 

– Tools -> Apply Indicator
(replace ticker1, ticker2 with actual symbol names)

How to plot a trailing stop in the Price chart

In this short article we will show how to calculate and plot trailing stop using two different methods. (more…)

How to fill the area between two lines with a solid color

This example shows how to fill the area between Bollinger Bands with a solid color. (more…)

Calendar day index

Someone asked me recently how to count calendar days (not bars) that passed since first available quote. AmiBroker has a built-in function ( since version 5.20 ) that calculates the number of days that passed since January 1st, 1900. This function can be used to easily implement number of days since first available quote Here is a sample formula that shows how to do that. (more…)

How to save layouts that hold individual parameter values for different symbols.

By default the values of parameters for given indicator pane are the same (shared) for all symbols. If you want per-symbol parameters, you need to apply technique descibed in this short article. (more…)

Price chart with independent style

If one wants to display a Candlesticks in one chart pane and Bars in another one, then it’s necessary to use a formula which does not read the settings from: View -> Price Chart Style.

The following custom Price formula allows to achieve this: (more…)

How to display arrows for trades generated in backtest?

In order to display trade arrows, first of all – it’s necessary to enable the arrows for particular chart. To do so – right-click on the chart pane of your choice, choose: Parameters -> Axes&Grid, then set: Show trading arrows to YES, as shown in the screenshot. (more…)

Discretionary Equity

In the March 2006 “Letters to S&C” section I found the following request:

“I am looking for and add-on […] that would enable me to build an equity curve from buy/sell signals that the trader directly draws over the price graph of a commodity; for example, using specific active vertical lines. Such a software would be of great help for discretionary traders to validate their semiautomatic systems. — PH CHAMBAULT”

And I just thought that it would be nice example of using AFL’s Equity() function and ParamTrigger()

(more…)

Getting X, Y co-ordinates of Study()

The following code sample shows how to get date/time (X co-ordinate) and value (Y co-ordinate) of starting and ending point of manually drawn study.
(more…)

How to change the title line in my custom indicator ?

To have custom title in the indicator window, you can define Title variable within the indicator’s code, e.g:
(more…)

« Previous Page