Australian (ASX) Stock Market Forum

Amibroker FAQ

Depends a bit on how your general programming skills are, but for a start read the AmiBroker help covering the basics and then start trying to code something very simple (eg. some moving averages). You'll likely spend a fair bit of time learning what functions are available and how to use them.

I'd suggest first doing a simple indicator, then gradually building it up with more complicated things to get familiar with the functions. Once you're comfortable with that, try a simple exploration, then a backtest (eg. a simple moving average crossover system).

Once you pretty comfortable with all that, then you can look at more advanced things like scaling trades, looping, and custom backtests.

And if you get stuck with anything, ask questions either here or on the AmiBroker Yahoo forum.

Cheers,
GP
 
Depends a bit on how your general programming skills are, but for a start read the AmiBroker help covering the basics and then start trying to code something very simple (eg. some moving averages). You'll likely spend a fair bit of time learning what functions are available and how to use them.

I'd suggest first doing a simple indicator, then gradually building it up with more complicated things to get familiar with the functions. Once you're comfortable with that, try a simple exploration, then a backtest (eg. a simple moving average crossover system).

Once you pretty comfortable with all that, then you can look at more advanced things like scaling trades, looping, and custom backtests.

And if you get stuck with anything, ask questions either here or on the AmiBroker Yahoo forum.

Cheers,
GP

Great advice GP. AFL is taking me longerthan i thought to learn. It requires a degree of concentration that i find difficult to maintain in China!

Cheers,
 
Hi,

Having a bit of trouble trying to workout (through the tradelog) if this code is the correct way. Think it may not.
Code:
Sell = sellsignal OR Cross(Equity(),HHV(Ref(Equity(),60),-1)-30000);
I want to sell all of the stocks if the equity drops through $30,000. Is the above OK or should this be done with the Amibroker Custom Backtester?

Thanks, SB
 
No, that won't work. It's the common Equity function mistake where you have a chicken and egg thing happening.

The Equity function calculates the equity line based on your buy and sell signals. It does the whole array in one call to Equity, so you can't use the results to then go back and modify your buy and sell signals, otherwise you'd end up with an iterative loop, setting buy/sell, calculating equity, modifying buy/sell, calculating equity again, etc.

You could probably do this using a loop though, calling the Equity function within the loop at each bar to figure out what to do for the next bar. However, using the custom backtester interface should be more efficient, since then you're not recalculating a whole array for each bar.

And if you sell everything when your equity reaches that level, what signal would you use to start buying again, or would you consider yourself out of the game at that point?

Cheers,
GP
 
Thanks GP, saves me wasting anymore time on it. Cheers.

what signal would you use to start buying again
Just wanted to backtest a fixed capital loss as an exit. I'd re-enter with normal buy signal depending on a market indicator.

Yes, I guess it maybe digging a deeper hole - just backtesting!

SB
 
Hey guys,

Anyone know how to do these?

1. Raise your stop loss to breakeven after a certain % profit?
2. Sell everything when drawdown hits a certain %?

Cheers
 
Hi All,

I'v been trying to figure out how to use quarterly and yearly timeframes (bars) in Amibroker.

I thought 3*inMonthly would work, but the bars don't seem to line up correctly with the start of the month.

Appreciate any help. :)
 
Re: Scan function

Where is the scan function found on Ami?

There seems to be a lot of mumbo jumbo in the program. I am looking for the word SCAN if it is at all in the program. Could somebody help please?
 
Hi,

Has anybody used the intraday backtesting function on AmiBroker?
Any comments/opnion?

And, What programming language does Amibroker use?
Is it C+ or C++ or C# or something else?

I mite get a copy of this, and a computer whiz mate to write the codes for me.

For <$300 you cant go wrong and it seems it can do what i require of it.

Thanks.
 
Hi,

Has anybody used the intraday backtesting function on AmiBroker?
Any comments/opnion?

And, What programming language does Amibroker use?
Is it C+ or C++ or C# or something else?

I mite get a copy of this, and a computer whiz mate to write the codes for me.

For <$300 you cant go wrong and it seems it can do what i require of it.

Thanks.

AB uses AFL or Amibroker Formula Language...FWIW my GF says it closer to Visual Basic than anything, but its original.

Cheers,
 
AFL is very similar to C in many respects, but there are significant differences. AFL's ability to handle array mathematics in much the same fashion as single number mathematics is one of the main differences.

And if you want to write your code as a plugin, then you can use ordinary C/C++.

GP
 
AFL is very similar to C in many respects, but there are significant differences. AFL's ability to handle array mathematics in much the same fashion as single number mathematics is one of the main differences.

And if you want to write your code as a plugin, then you can use ordinary C/C++.

GP

So its not similar to VB at all????

So if i can study the concept of C+ and C++ will it allow me to grasp the concept of AFL more quickly? Or should i just use AFL more?

Cheers,
 
As a programmer I would suggest that if you want to learn AFL then use AFL.

Now if you want to compare AFL to other languages...

* layout is SIMILAR to C (but so is javascript and php)

* does not have pointer as such as therefore similar to java or other languages that use garbage collection functions (if required)

* use of revered word "function" is same as pascal

* ability to use ActiveX stuff is same as VB (Delphi, etc.)

* arrays are 0..n-1 (as per C/javascript etc.)

many of the scripts that come with Amibroker or downloaded are wscript or cscript or jsscript based. So my suggestion would be to look at javacript, as I think that you would find it easier than C/C++/C#)

Tim
 
Does anyone know if I can change the font of a specific text made with the text tool? I don't mean the global settings, I mean write some text in size 12 and some in size 14.

Cheers!
 
Does anyone have any idea how to create quarterly bars / arrays?

3*InMonthly doesn't work - the quarters don't line up with the start of the month.

I'd be very grateful for any help or suggestions.
 
Top