Australian (ASX) Stock Market Forum

Amibroker FAQ

Captain Black wrote:

What does this metric tell you (I know what the forumlae is), but am interested in your interp.

What's the minumum for this metric that you would target before you consider it a robust and profitable system?

Thanks Captain!

After testing many different objective functions I found that CAR/MDD produced the most consistent out-of-sample results for my systems( that is, the out-of-sample testing matched my "real world" results). I've traded one system in particular for nearly 10 years so had a fair idea of what the out-of-sample results were for it anyway based on my original testing and comparing this to real time results.

An objective function such as CAR/MDD on it's own isn't a significant criteria for system robustness and profitability. I don't set minimum targets for this metric, I'm simply looking for an objective function that will give a realistic guidance for out-of-sample results.
 
Hi all,

Looking to add position score to my scan results. I have tried the AddColumn function without any luck. Suggestions?

Cheers:)
 
Thanks Capt'n,

So if I used exploration instead of a scan, I would need to add the Filter variable (and additional columns) - would I set the filter to:
Filter = 1
or
Filter = Buy

or are they effectively the same?

I will tinker at home tonight.

Cheers :)
 
Thanks Capt'n,

So if I used exploration instead of a scan, I would need to add the Filter variable (and additional columns) - would I set the filter to:
Filter = 1
or
Filter = Buy

or are they effectively the same?

I will tinker at home tonight.

Cheers :)

Depends on what results you want to show. To show only PositionScore for stocks that also trigger a Buy then use:

Code:
Filter = Buy AND PositionScore;
To show PositionScore values for all stocks then use

Code:
Filter = PositionScore;
 
Howdy folks,

Just wondering if anyone can help me out here, I have the AFL code for plotting a foreign ticker(I've attached the code below so you all know what I'm on about), and I'm just wondering if there is a way to modify it so that it doesn't show the OHLC values for the main ticker on the chart, but shows the OHLC for the foreign ticker only. All the code does is display the close price for the foreign symbol, along with the OHLC values for the main symbol, which I already have in the title on the chart.


Any help would be muchly appreciated:)

Code:
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +
WriteVal( V, 1.0 ) +
" {{VALUES}}", 
O, H, L, C, SelectedValue( ROC( C, 1 )) ));
Ticker = ParamStr("Symbol", Name() );

PlotForeign( Ticker, Ticker, ParamColor("Color", colorCycle ), 
ParamStyle("Style",styleCandle,maskAll) );
 
Howdy folks,

Just wondering if anyone can help me out here, I have the AFL code for plotting a foreign ticker(I've attached the code below so you all know what I'm on about), and I'm just wondering if there is a way to modify it so that it doesn't show the OHLC values for the main ticker on the chart, but shows the OHLC for the foreign ticker only. All the code does is display the close price for the foreign symbol, along with the OHLC values for the main symbol, which I already have in the title on the chart.


Any help would be muchly appreciated:)

Code:
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +
WriteVal( V, 1.0 ) +
" {{VALUES}}", 
O, H, L, C, SelectedValue( ROC( C, 1 )) ));
Ticker = ParamStr("Symbol", Name() );

PlotForeign( Ticker, Ticker, ParamColor("Color", colorCycle ), 
ParamStyle("Style",styleCandle,maskAll) );

Hi PF,
When I apply your AFL code I get the OHLC values of the selected ticker and close of the foreign symbol in the title and a chart of the OHLC of the Foreign symbol. I don't see any OHLC chart of the selected ticker? Perhaps I've misunderstood your question?
 
Hi PF,
When I apply your AFL code I get the OHLC values of the selected ticker and close of the foreign symbol in the title and a chart of the OHLC of the Foreign symbol. I don't see any OHLC chart of the selected ticker? Perhaps I've misunderstood your question?

Hi captain,

What I'd like is to not have the OHLC values of the selected ticker in the title, and instead of just the closing value of the foreign ticker displayed, I'd like to be able to see the O,H and L values as well.
 
Hi captain,

What I'd like is to not have the OHLC values of the selected ticker in the title, and instead of just the closing value of the foreign ticker displayed, I'd like to be able to see the O,H and L values as well.

Still not sure I understand completely (it's been a lonnnggg day.. ;) )
This code replaces the selected ticker values in the title with the foreign ticker values..

Code:
SetChartOptions(0,chartShowArrows|chartShowDates);
Ticker = ParamStr("Symbol", Name() );
SetForeign(Ticker);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +
WriteVal( V, 1.0 ) +
" {{VALUES}}", 
O, H, L, C, SelectedValue( ROC( C, 1 )) ));
RestorePriceArrays();

PlotForeign( Ticker, Ticker, ParamColor("Color", colorCycle ), 
ParamStyle("Style",styleCandle,maskAll) );
 
Still not sure I understand completely (it's been a lonnnggg day.. ;) )
This code replaces the selected ticker values in the title with the foreign ticker values..

Code:
SetChartOptions(0,chartShowArrows|chartShowDates);
Ticker = ParamStr("Symbol", Name() );
SetForeign(Ticker);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +
WriteVal( V, 1.0 ) +
" {{VALUES}}", 
O, H, L, C, SelectedValue( ROC( C, 1 )) ));
RestorePriceArrays();

PlotForeign( Ticker, Ticker, ParamColor("Color", colorCycle ), 
ParamStyle("Style",styleCandle,maskAll) );

That displays the OHLC values for the foreign ticker, so it gets all the info in the title I need. Even after a long day, you're still pretty handy captain:D

Thanks heaps for that:)
 
G'Day, Just downloaded and installed AmiBroker and Premium Data from Norgate as trials. Have the data coming through and AmiBroker is happily displaying it.

However trying to find a starting point to learn more about AmiBroker is proving difficult. Mainly due to there being so much stuff out there, and I haven't yet been able to crack the secret as to how it fits together.

Lets assume I have found the User's Guide and watched a couple of the videos to the point where I can run a basic scan and back test based on the examples in the video.

Where to now?

To assist you assist me I offer the following:
- I can code (30 years experience in assembler, basic, pascal, C, C++, visual basic, SQL, .....)
- I understand system design and testing concepts
- I have used Metastock extensively (but I don't want to anymore)
- I have coded systems in MT4 for forex

So I really want a pointer to where I can find something that will step me through the process of building and testing a system using AmiBroker in particular. The AmiBroker AFL Library is members only, and I don't seem to have a user ID, so I guess I can't access that until I decide to cough up for the license. But how do I know if I want to if I can't test the software is what I am looking for?

Have I missed something? I tried searching the Yahoo groups but either got so many hits nothing was displayed or I just got repeats of the same thread over and over (would need to invest time working out how to use Yahoo groups if I continue down this path).

Any pointers most appreciated. Thank you in advance.

{Edit: I just found the AFL Reference included in the User Guide, there seems to be plenty of reading there. Will start with that. Any other suggestions still welcome}
 
Howard Bandy's two books "Introduction to Amibroker" and "Quantitative Trading Systems" are worthwhile having a look at if you're after an Amibroker based system development "tutorial".

http://www.blueowlpress.com/

Otherwise everything you need to know is in the Amibroker tutorials/help files. The Yahoo user groups are a must as well. There's quite a few Amibroker threads on ASF with some great info. too. Happy to help with any specific questions you may have.
 
Thanks for that Captain,

I think my eyes glassed over last night, looking at the User Guide and reading about drag-n-drop, and I missed the AFL bit, which is more like what I was looking for. Will check out the books too.

Thanks again.
 
Hi SD --

A key difference between AmiBroker and most other programming languages is that many, even most, AmiBroker operations accept arrays as operands.

To calculate a 5 bar simple moving average of closing prices in AmiBroker, this one statement performs the calculation and assignment for the entire price series in one go.

MyMovingAverage = MA(Close,5);

After this statement has been executed, MyMovingAverage is an array that is exactly the same length as the Close array, and has the 5 bar moving average at every point.

Only rarely will you need to write "looping code" to perform operations.

Focus first on the functionality built in to AmiBroker and the array-based operations. Everything else is easy.

Thanks,
Howard
 
Hi all,
Why does the ROC use periods +1 as a calculation instead of periods?
e.g. ROC(C,10) uses 11 periods instead of 10.
indices 0-5
2 2 2 2 2 1
ROC(x,5) will give 1 instead of 0.
Does this make sense?:confused:

Cheers,
JB
 
Hi all,
Why does the ROC use periods +1 as a calculation instead of periods?
e.g. ROC(C,10) uses 11 periods instead of 10.
indices 0-5
2 2 2 2 2 1
ROC(x,5) will give 1 instead of 0.
Does this make sense?:confused:

Cheers,
JB

Hi Gunslinger --

In order to get a comparison, there must be two values -- ROC(C,1) uses the two values that are as of: 1. the current bar, and 2: the bar 1 bar ago.

ROC(C,10) uses the current value and the value 10 bars ago.

In your example, ROC(x,5) evaluates as:
(1-2)/2 which is -0.50

Interpret this as "the current value of x is 50% lower than it was 5 bars ago".

From the reference:
SYNTAX roc( ARRAY, periods = 12, absmode = False )
RETURNS ARRAY
FUNCTION Calculates the periods rate-of-change of ARRAY expressed as percentage.
if absmode = False the value returned is ( array - ref( array, -periods ) )/ref( array, -periods )
if absmode = True the value returned is ( array - ref( array, -periods ) )/abs( ref( array, -periods ) )
EXAMPLE The formula roc( CLOSE, 14 ) returns the 14-period percent rate-of-change of the closing prices.


Thanks,
Howard
 
Hi Gunslinger --

In order to get a comparison, there must be two values -- ROC(C,1) uses the two values that are as of: 1. the current bar, and 2: the bar 1 bar ago.

Thanks Howard,
I guess if you think of it as a 1 day ROC being approximately the opening vs close on same day but since I'm using daily data it uses the close of p-1.

Just the way my mind works, thanks for your clarification.

Cheers,
JB
 
morning folks, wondering if anyone can help me!

I'm wanting to look at the performance of the market for certain dates(I'm looking at past econ data release dates). I know how to code one particular date into AFL using the datenum() function and have it print an arrow on the chart for that particular day, but how would I go about that for multiple instances( well over 150 ).

Any help greatly appreciated:)
 
Thanks Howard,
I guess if you think of it as a 1 day ROC being approximately the opening vs close on same day but since I'm using daily data it uses the close of p-1.

Just the way my mind works, thanks for your clarification.

Cheers,
JB

Hi JB --

If you want to compare something other than close to close or open to open, you can roll your own.

For example, the "ROC" equivalent of the change from yesterday's close to today's open is:
ROCCloseYesterdayToOpenToday = (O - Ref(C,-1)) / Ref(C, -1);

You can use index values that are either negative (look back in time and are always valid) or positive (look forward in time and are only valid in "data mining" mode, not in real time).

Thanks,
Howard
 
Top