Australian (ASX) Stock Market Forum

Amibroker FAQ


Thanks Colion. I was aware of some of those but there are some new ones there I hadn't heard of. Some of the websites look a little dated! Do you have a particular provider that you use?

Hi Allan --

To my thinking, Norgate Premium Data is the gold standard.

If you have not already read it, my "Introduction to AmiBroker" describes in detail how to set up both free and subscription data services for AmiBroker, including Premium Data. You can download a free copy of the book from the book's website. Start here:
http://www.introductiontoamibroker.com/

Best regards,
Howard

Howard, thanks for the comment. I've already read your book (twice) and have been working through the examples.

I'm assuming that if I only buy historical data and then use free data that over time, as stocks split, de-list etc my list will no longer be accurate. The only way to avoid this would be to continue to use data from a provider like Norgate. Am I on the right path here?

And if I did use free data for a while and then decided to use the Northgate EOD data, would it update any splits, changes etc that occurred since the initial historical data was loaded?

I'm trying to work out the best way to get started without running into problems down the track.

Thanks again.
 
Norgate PremiumData does all that for you. It is a widely used quality EOD vendor with low monthly fees. Can't do much wrong with them.
 
Hi Allan --

Trash is giving good advice.

I don't think there is much value in buying historical data and then trying to keep that database maintained from some free source. Duplicate databases quickly get out of sync and are impossible to get resynchronized.

Most subscription (not free) vendors of data, including Norgate Premium Data, store the data they provide in a database that they maintain. After buying a package of historical data from them, you would not be able to add daily updates yourself. You need their maintenance programs, which come with a subscription to their service, to do that.

If you are thinking of updating using Yahoo, you might as well start with Yahoo and AmiQuote. If / when you later switch to Norgate, or even some other free vendor, do not merge databases, if it is even possible, without verifying in detail that data is reported and stored consistently. Watch for things like handling of distributions, scaling of the volume field, special characters in symbols (such as ^$-.), etc.

Best,
Howard
 
Hi Frank --

If there is no statement "OptimizerSetEngine", then the search is exhaustive.

The difference in run count may be due to rounding error in adding floating point values.

Best regards,
Howard

Thanks Howard. Ami is skipping the final test with Optimize profit target from 0.2 to 4, ie it is skipping the 4. As it's at the edge of the parameters that is perhaps less disconcerting than holes in the middle.
 
I'm trying to work out the best way to get started without running into problems down the track.

.

FWIW as soon as I installed Ami I ran in to problems. I then added to them by postponing subscribing to Norgate, which I think was time wasted. Ami throws enough of a learning curve without adding to it by spending additional time on what turns out to be a dead end, dealing with data issues. You can buy a chunk of data from Norgate without committing to a monthly contract. That's my hindsight from where I'm sitting, just a personal opinion.
 
Howard is correct. It is a result of floating point arithmetic as documented by AmiBroker here http://www.amibroker.com/kb/2010/07/20/about-floating-point-arithmetic/

Rather use

Code:
N = Optimize( "N", 3, 1, 7, 1 );
HoldDays = Optimize( "HoldDays", 7, 1, 7, 1 );
ProfitTarget = Optimize( "ProfitTarget", 4, 2, 40, 2 ) / 10;

or as seen in the link

Code:
N = Optimize( "N", 3, 1, 7, 1 );
HoldDays = Optimize( "HoldDays", 7, 1, 7, 1 );
step = 0.2;
ProfitTarget = Optimize( "ProfitTarget", 0.4, 0.2, 4 + step/2, step );

Trash - many thanks for the pointer. Got it. That's one issue crossed off the list!
 
That's one issue crossed off the list!

You can already cross off all others too as there are no issues with AB that crossed my road I have been driving for years. I'm a regular long term user of AB or rather a hardcore user and still waiting for first real issue after years of use without problems. 99% of issues are just user errors. Told by experience at AB's official forum.
 
Norgate PremiumData does all that for you. It is a widely used quality EOD vendor with low monthly fees. Can't do much wrong with them.

Hi Allan --

Trash is giving good advice.

I don't think there is much value in buying historical data and then trying to keep that database maintained from some free source. Duplicate databases quickly get out of sync and are impossible to get resynchronized.

Most subscription (not free) vendors of data, including Norgate Premium Data, store the data they provide in a database that they maintain. After buying a package of historical data from them, you would not be able to add daily updates yourself. You need their maintenance programs, which come with a subscription to their service, to do that.

If you are thinking of updating using Yahoo, you might as well start with Yahoo and AmiQuote. If / when you later switch to Norgate, or even some other free vendor, do not merge databases, if it is even possible, without verifying in detail that data is reported and stored consistently. Watch for things like handling of distributions, scaling of the volume field, special characters in symbols (such as ^$-.), etc.

Best,
Howard

FWIW as soon as I installed Ami I ran in to problems. I then added to them by postponing subscribing to Norgate, which I think was time wasted. Ami throws enough of a learning curve without adding to it by spending additional time on what turns out to be a dead end, dealing with data issues. You can buy a chunk of data from Norgate without committing to a monthly contract. That's my hindsight from where I'm sitting, just a personal opinion.

Folks, thanks for your help with my beginners question. It reinforces what I'd been thinking - it's nice to know I was thinking about it correctly. Maybe all that reading has been paying off!

I'm sure I'll be back with more questions as my Amibroker / trading journey continues.
 
Hi

Attempting to set up a shorting strategy and struggling. So backtrack and revert to Mean Reversion Trading Strategies . 9.1 3 Day High Low long strategy from MRTS works fine
BuyPrice = SellPrice = Close;
Buy = FilterRule1 AND EntryRule1 AND EntryRule2;
Sell = ExitRule1;

But then 9.2 short strategy with code
ShortPrice = CoverPrice = Close;
Short = FilterRule1 AND EntryRule1 AND EntryRule2;
Cover = ExitRule1;
produces error message 'Error 701. Missing buy/sell variable assignments'. (which was the same stumbling block I'd hit in my earlier attempts).

Help please? Thanks in anticipation...
 
Hi

Attempting to set up a shorting strategy and struggling. So backtrack and revert to Mean Reversion Trading Strategies . 9.1 3 Day High Low long strategy from MRTS works fine
BuyPrice = SellPrice = Close;
Buy = FilterRule1 AND EntryRule1 AND EntryRule2;
Sell = ExitRule1;

But then 9.2 short strategy with code
ShortPrice = CoverPrice = Close;
Short = FilterRule1 AND EntryRule1 AND EntryRule2;
Cover = ExitRule1;
produces error message 'Error 701. Missing buy/sell variable assignments'. (which was the same stumbling block I'd hit in my earlier attempts).

Help please? Thanks in anticipation...

Again another user error.

Most probable solution ...

Either go to backtest settings and set "Positions" to just "Short" from currently set "Long and short".

Or a more flexible way ...
Keep Long and Short in backtest settings
and in code add line
Buy = Sell = 0;

Next one please...
 
Again another user error.

Most probable solution ...

Either go to backtest settings and set "Positions" to just "Short" from currently set "Long and short".

Or a more flexible way ...
Keep Long and Short in backtest settings
and in code add line
Buy = Sell = 0;

Next one please...

Thanks , that worked, I appreciate the help.

I don't appreciate the aggression, which is why you're on my list of Amibroker issues.
 
Aggression? Funny. Let me guess... pointing out the fact about obvious user error is equal to being aggressive (in your own world)? Right. I have to say you don't know much about the definition of the word "aggression" in this world.

I don't appreciate the aggression, which is why you're on my list of Amibroker issues.
BTW, this one goes on the list of the most ridiculous sentences of year 2014. Congratulations because right now you are favorite of winning the whole award -> a big cup of milk.
 
Help Needed to access exploration result columns in rt scan.

Hi all

So I have exploration results from an EOD trading system that has 2 columns, Ticker and buyprice. The buyprice is below the EOD close price(really like a limit order). The exploration may have anything from 1 result to 100. I have added these results to a watchlist.

The next trading morning I open IB live data feed and I want to continually scan this watchlist for the current ask to trade at or below the buyprice.

If current ask for ticker below buyprice then buy.

What's the coding for my rt formula to loop through the watchlist and access the second column of exploration called buyprice.

I just need coding for this part of formula all the rest of coding with IB controller I'm right with at this stage:).

Thanks heaps for any help anyone may be able to give.




Cheers
 
Help Needed to access exploration result columns in rt scan.

Hi all

So I have exploration results from an EOD trading system that has 2 columns, Ticker and buyprice. The buyprice is below the EOD close price(really like a limit order). The exploration may have anything from 1 result to 100. I have added these results to a watchlist.

The next trading morning I open IB live data feed and I want to continually scan this watchlist for the current ask to trade at or below the buyprice.

If current ask for ticker below buyprice then buy.

What's the coding for my rt formula to loop through the watchlist and access the second column of exploration called buyprice.

I just need coding for this part of formula all the rest of coding with IB controller I'm right with at this stage:).

Thanks heaps for any help anyone may be able to give.




Cheers

Either save your exploration as project file (.apx extension) after setting Apply to: to Filter -> including your watchlist (side note, project files save all backtest and toolbar settings plus your entire AFL code)

or/and

In your exploration block you add InWatchlist( wlnum )

Ie.

Code:
wlnum = 0; // your watchlist number

if ( Status("actionex") == actionExplore and InWatchlist( wlnum ) )
{ 
  // your exploration code here

  Filter = ....
}
 
Either save your exploration as project file (.apx extension) after setting Apply to: to Filter -> including your watchlist (side note, project files save all backtest and toolbar settings plus your entire AFL code)

or/and

In your exploration block you add InWatchlist( wlnum )

Ie.

Code:
wlnum = 0; // your watchlist number

if ( Status("actionex") == actionExplore and InWatchlist( wlnum ) )
{ 
  // your exploration code here

  Filter = ....
}



Thanks heaps for your help Trash that will give me somethin ta chew on for a while..:)
Cheers
 
Hi All,
I'm a newbie here and just bought Amibroker V5.80 charting software with Premium data EOD ASX.
Interested in learning how to code/design a trading system for the ASX shares to start with. I realised there is no in-built system in AB to learn and practice with.
Problem is that I have no programming background and AFL seems a little bit daunting for a newbie.
What would be the best approach for people new to system trading?
Any good books to read?
Have read Nick Radge's Unholy Grail and been looking for TechTrader's trading system without any luck.
Contemplating to join The Chartist but read somewhere that a decent trading system has to fit the trader's own personality.
Buying "off the shelf" system may or may not work for me.
Any advice much appreciated.
Thanks.:)
Iro
 
What would be the best approach for people new to system trading?
Howard Bandy has written books about trading systems and there are codes at the AFL online library.
Have read Nick Radge's Unholy Grail and been looking for TechTrader's trading system without any luck.
Contemplating to join The Chartist but read somewhere that a decent trading system has to fit the trader's own
Type into the search box on this forum and you could find related information. Remember that prices go up, down and sideways. :)
 
Hi All,
I realised there is no in-built system in AB to learn and practice with.

Not true. In Charts window besides two system examples there are several other AFLs within categories.

image.png

Your own ones will be placed in Custom folder by default but you can move them anytime afterwards using held right mouse button and dragging&dropping them to different folder or in editor using "Save as.." instead of "Save".

Besides if you right click in editor field then in its context menu you have additional code snippet feature available providing further code being used often. And there you have additional small examples for trading system creation for example.
image.png


In users library at amibroker.com there are additional AFLs made by other users. In official AB forum there are AFLs too provided by other users or by Tomasz but requires some search on your own.

Problem is that I have no programming background and AFL seems a little bit daunting for a newbie.
What would be the best approach for people new to system trading?

It is not daunting at all. If you have ever worked with Excel then you won't have a problem with AFL too. AFL is much easier and more compact than Easy language for example. And more powerful on top of that.

If you have never ever done anything in regards to programming or excel before and have difficulties in general then every programming language will be daunting to you (at first). But it is just a matter of studying to get freed from insecureness. You have to make the first step. The mountain won't come to your direction taking you on its top by some magic but it is you who have to go to the mountain and have to climb it step by step.

Any good books to read?

Well I would suggest reading the AmiBroker manual first. (it is also provided in PDF format, BTW)
 
Top