# Amibroker as a fundamental analysis development tool - any developers?



## ottg (23 February 2015)

The more I'm searching for a stock screener (for specific data manipulative requirements) the more it looks if it doesn't exist in the public domain. The quickest way to get something off the ground is to use AmiBroker which I read is a professional, powerful, comprehensive trading system development platform. 

a. While it is mainly used for technical analysis can anyone indicate why it wont be suitable for fundamental analysis?
b. Any development or scripts need to be tested vigorously. It also appears from readings if Amibroker's cutting edge charting and graphics, and fast, flexible and powerful portfolio-level backtesting, optimization, and automated walk forward validation will be more than enough. 
c. Do you know of any existing groups or forums that attempted this successfully and that we can perhaps join?
d. Will it be a good idea to use a development domain like SourceForge or Github to host artifacts, databasis, code and script management and central communications with feedback to this forum?
e. Anyone with the time, skills, tenacity and energy that will be interested in driving such efforts?
f. Who will be interested in active participation?

The objective is to develop a system based on a scientific approach, that will help long term investors identify profitable opportunities to buy and sell.


----------



## howardbandy (25 February 2015)

Hi ottg --

No other comments?  I cannot resist.  I have written extensively about the lack of value of fundamental data for trading.  The issues revolve around granularity, timeliness, revision, agenda of reporter, etc.

I believe that the markets are strongly efficient with regard to fundamental data.  That no person outside the board room of the reporting agency can profit from fundamental data.

That said, no one trading system development platform gives any advantage over any other platform with regard to use of fundamental data.

Best regards,
Howard


----------



## systematic (25 February 2015)

howardbandy said:


> I have written extensively about the lack of value of fundamental data for trading.  The issues revolve around granularity, timeliness, revision, agenda of reporter, etc.
> 
> I believe that the markets are strongly efficient with regard to fundamental data.  That no person outside the board room of the reporting agency can profit from fundamental data.




...Perhaps I should ask what you mean by "trading" (your word) before I comment.  Could you elaborate on what you mean by trading?  Perhaps you have a more nuanced meaning than what I understand the word to mean.


----------



## luutzu (25 February 2015)

ottg said:


> The more I'm searching for a stock screener (for specific data manipulative requirements) the more it looks if it doesn't exist in the public domain. The quickest way to get something off the ground is to use AmiBroker which I read is a professional, powerful, comprehensive trading system development platform.
> 
> a. While it is mainly used for technical analysis can anyone indicate why it wont be suitable for fundamental analysis?
> b. Any development or scripts need to be tested vigorously. It also appears from readings if Amibroker's cutting edge charting and graphics, and fast, flexible and powerful portfolio-level backtesting, optimization, and automated walk forward validation will be more than enough.
> ...




How much are you willing to pay for a fundamental-based system like that?

Will cost at least $1 million to hire developers, BA, DBA.

And at the end of it, don't think you could do back testing fundamental data like you could with charting or something similar. 

A ratio or figure alone won't give you context... and while it's not impossible, might not be easy to code a smart enough system to take into account all the variables that may indicate a good opportunity when a few figures alone would indicate a sell.


----------



## howardbandy (25 February 2015)

Hi Systematic --

My categorization is expenditures are one of three categories --

Investing.  When I take a position, I call my attorney and have my will modified.  An island I intent to leave to my heirs.  I have not yet called my attorney.

Trading.  I expect to reverse my position sometime before I die, hopefully at a profit.  All stocks, futures, mutual funds, houses.

Expenses.  Things that will probably be worth less, even worthless, when I dispose of them.  Food, clothes, cars.

Best,
Howard


----------



## systematic (25 February 2015)

Hey Howard,

Thanks for your reply, and clarification.



howardbandy said:


> Trading.  I expect to reverse my position sometime before I die, hopefully at a profit.




...We're on the same page.


Can I also clarify (sorry, I forgot to add) whether you count 'price adjusted' or 'price relative' fundamental data (a common example would be dividend yield) when you say, "fundamental data" - or not?


----------



## ottg (26 February 2015)

Thank you for the replies so far. There is a thread I need to work thru before replying: Re: Backtesting based on fundamental data

Thanks for the heads up!


----------



## KnowThePast (26 February 2015)

ottg said:


> The more I'm searching for a stock screener (for specific data manipulative requirements) the more it looks if it doesn't exist in the public domain. The quickest way to get something off the ground is to use AmiBroker which I read is a professional, powerful, comprehensive trading system development platform.
> 
> a. While it is mainly used for technical analysis can anyone indicate why it wont be suitable for fundamental analysis?
> b. Any development or scripts need to be tested vigorously. It also appears from readings if Amibroker's cutting edge charting and graphics, and fast, flexible and powerful portfolio-level backtesting, optimization, and automated walk forward validation will be more than enough.
> ...




Hi ottg,

It is refreshing to see someone else interested in this approach. 

I have already developed my own system that does most of what you have in mind. I am afraid I will have to decline an offer to participate for free in public, I know it's very selfish of me.

You've mentioned that you found a thread "Backtesting based on fundamental data". I've posted some of my thoughts on the subject there, enjoy.

Luutzu gave an estimate of at least $1m. In my experience, unless you find people to work for free, he is right. I think it will be well over a million.

I agree that there are no good fundamental based screeners/back testers/charts for a retail investor.


----------



## howardbandy (26 February 2015)

Greetings --

This is a link to a paper I wrote a few years ago outlining my thoughts on the use of fundamental data:

http://www.blueowlpress.com/Use of Fundamental Data in Active Investing.pdf

Best regards,
Howard


----------



## systematic (26 February 2015)

howardbandy said:


> Greetings --
> 
> This is a link to a paper I wrote a few years ago outlining my thoughts on the use of fundamental data:
> 
> ...




Thanks, I'll put it in the queue for reading.


----------



## KnowThePast (26 February 2015)

howardbandy said:


> Greetings --
> 
> This is a link to a paper I wrote a few years ago outlining my thoughts on the use of fundamental data:
> 
> ...




Hi Howard,

I think we had a discussion about this on another thread and agreed that fundamental data strategies can, in fact, work. But, they required longer time frames and large drawdown.


----------



## Wysiwyg (26 February 2015)

KnowThePast said:


> But, they required longer time frames and large drawdown.



You got it all wrong. Investment is about capital appreciation, not sitting on dog stocks for an indefinite period hoping they come back.


----------



## luutzu (26 February 2015)

howardbandy said:


> Greetings --
> 
> This is a link to a paper I wrote a few years ago outlining my thoughts on the use of fundamental data:
> 
> ...




So if fundamental economic data are not appropriate; company fundamentals also not appropriate... what are traders to use? Share price and trading volumes? the vibe?


----------



## luutzu (27 February 2015)

Wysiwyg said:


> You got it all wrong. Investment is about capital appreciation, not sitting on dog stocks for an indefinite period hoping they come back.




True, but problem is they (we?) don't think we're sitting on dogs.


----------



## howardbandy (27 February 2015)

luutzu said:


> So if fundamental economic data are not appropriate; company fundamentals also not appropriate... what are traders to use? Share price and trading volumes? the vibe?




Greetings --

As my paper states, I believe that all of the inefficiency due to fundamental changes have been taken out of the market before small retail traders have an opportunity to participate.

What profit potential remains is short term -- a few days, maximum.  

The primary data used to indicate buy and sell points in a data series is that data series itself -- as you say, price and volume.  I do not know what the vibe is, or how it is measured, how it is used, how it is tested.

I have found that related data series can be useful.  For examples -- 
The price data of the broad sector the issue belongs to.
And diffusion indexes created from issues that act the same as the primary data series.

I recommend generating signals no less frequently than daily and managing trades daily.  At these frequencies, all technical indicators act the same.  Choose your favorite -- stochastic, z-score, RSI, etc.  Tuning whichever indicator you choose is more important than which indicator is chosen.

Then be very careful to follow good modeling and simulation technique.  The sequence is think, train, test, trade.  Do not trade until the out-of-sample tests show that the model does recognize reliable patterns that precede profitable trades -- not just noise in the training data.

Best regards,
Howard


----------



## ottg (27 February 2015)

KnowThePast said:


> Hi ottg,
> 
> It is refreshing to see someone else interested in this approach.
> 
> ...




Thank you for your feedback and point taken on participation. For me the most important is the fact that I'm a long term value investor. This is due to the tax advantages for SMSF when stock is kept longer than 1-year. That said it doesn't mean that I want to sleep on the shares selected. I had a look at your video and while I can see conceptually how you perform filtering, it doesn't show (perhaps on purpose) what fundamental parameters you select on. 

Are you prepared to have a chat about the fundamentals you use and why on this thread: 
https://www.aussiestockforums.com/forums/showthread.php?t=29587&p=861760&viewfull=1#post861760


----------



## ottg (27 February 2015)

luutzu said:


> How much are you willing to pay for a fundamental-based system like that?
> 
> Will cost at least $1 million to hire developers, BA, DBA.
> 
> ...




Thank you for your well intended comments. Yes to have something professionally developed will be expensive that is why my 1st choice is a commercial off the shelve solution - but it doesn't exist....yet. Next possible option is open source but just look at Sourceforge how many uncompleted projects are there. Now if I had $1m available for development then it would become a business in it self and I believe I wouldn't have this discussion here 

Back testing fundamentals is possible. Lets assume you have the filtering done based on value and quality and then grouped according to risk acceptance. (Each one off these factors is a separate discussion). Then besides long term dividend growth and long term prices growth how did the same shares perform during a down turn and then how quickly did they regain growth during the upturn again. As new fundamental data becomes available (eg from interim reports) the quality tests may show a change in the share performance levels which becomes an indicator of possible short term changes in price or dividend growth. However you cannot mix 6-months and 12-months data but you use it separately for decision making. 

Because its all numerical values I believe quantitative analysis is possible as shown by *KnowThePast*'s share screener. Now the question is can I do the same using Amibroker as a fundamental share screener. As I will be able to do that in Mathlab therefore I it should be possible in Amibrokers as its a mathematical development platform with a different purpose.

The key is clean primary company fundamental data as input and a well defined strategy.
Economic data I will rather use in discretionary decisions.


----------



## ottg (27 February 2015)

luutzu said:


> True, but problem is they (we?) don't think we're sitting on dogs.




Exactly that! Filtering using fundamentals so that you end up with valued and quality shares.


----------



## ottg (27 February 2015)

howardbandy said:


> Greetings --
> 
> This is a link to a paper I wrote a few years ago outlining my thoughts on the use of fundamental data:
> 
> ...




Howard thank you for taking the time to reply. I read your "Introduction to Amibroker" quite some time ago and could quickly grasp the power as I'm familiar with Mathlab in digital signal processing. A great document thank you. The problem is that it tempted me to get my hands dirty - where I would rather purchase a solution. For the above document, thank you. I will give it the attention it deserves and comment later.


----------



## KnowThePast (27 February 2015)

howardbandy said:


> Greetings --
> 
> As my paper states, I believe that all of the inefficiency due to fundamental changes have been taken out of the market before small retail traders have an opportunity to participate.
> 
> ...




Hi Howard,

I disagree.

To keep it simple - how do use explain the Low-PE/PB strategies outperforming the market in almost all 3-5 year periods goind back almost 100 years? It's not a big outperformance, there are better strategies, but these are well proven and they contradict your findings.

Specifically:



howardbandy said:


> What profit potential remains is short term -- a few days, maximum.




I found it to be the exact opposite. Most fundamental based edges that I found would require 3+ years on average to show outperformance. 

Conceptually, I agree with the reasons you cite for why it cannot work. But the data doesn't support that.


----------



## KnowThePast (27 February 2015)

ottg said:


> Thank you for your feedback and point taken on participation. For me the most important is the fact that I'm a long term value investor. This is due to the tax advantages for SMSF when stock is kept longer than 1-year. That said it doesn't mean that I want to sleep on the shares selected. I had a look at your video and while I can see conceptually how you perform filtering, it doesn't show (perhaps on purpose) what fundamental parameters you select on.
> 
> Are you prepared to have a chat about the fundamentals you use and why on this thread:
> https://www.aussiestockforums.com/forums/showthread.php?t=29587&p=861760&viewfull=1#post861760




Hi ottg,

I've replied on the thread.

The video just shows how the system works using a simple PB filter. Any piece of fundamental data can be used, as well as any custom ratios you define, as well as a combination of these.

I deliberately don't show my main filter, as I think I found something that is not widely published yet. 

I agree with you on tax advantages.

Another way to look at it is that it is a form of indexing. You invest into a large group of stocks, making up some corner of the stock market, in belief that it will outperform the average, as a group. It requires little time or decision making. Good for those who don't have time, skill, or confidence to stock pick. And even if efficient market folks are right and no statistical edge can be found in fundamental data analysis, than you should, in theory, perform in line with the index.


----------



## Habakkuk (27 February 2015)

ottg said:


> The more I'm searching for a stock screener (for specific data manipulative requirements) the more it looks if it doesn't exist in the public domain. The quickest way to get something off the ground is to use AmiBroker which I read is a professional, powerful, comprehensive trading system development platform.
> 
> a. While it is mainly used for technical analysis can anyone indicate why it wont be suitable for fundamental analysis?
> b. Any development or scripts need to be tested vigorously. It also appears from readings if Amibroker's cutting edge charting and graphics, and fast, flexible and powerful portfolio-level backtesting, optimization, and automated walk forward validation will be more than enough.





I'm an Amibroker user but no expert. I believe that fundamental data is only DISPLAYED in an information window. As far as I know, it cannot be used as input to generate signals or even displayed in a chart. I have imported fundamental data and that's what I concluded. If I'm totally wrong about this, could somebody please let me know. 

Below is a cut-and paste from the Amibroker User's Guide

GetFnData - get fundamental data Information / Categories	(AFL 2.90)

SYNTAX  GetFnData( ''field'' )  
RETURNS NUMBER or STRING  
FUNCTION  GetFnData allows accessing fundamental data from Information window (Window->Symbol Information) "field" parameter can be one of the following: 
"EPS" 
"EPSEstCurrentYear" 
"EPSEstNextYear" 
"EPSEstNextQuarter" 
"PEGRatio" 
"SharesFloat" 
"SharesOut" 
"DividendPayDate" 
"ExDividendDate" 
"BookValuePerShare" 
"DividendPerShare" 
"ProfitMargin" 
"OperatingMargin" 
"OneYearTargetPrice" 
"ReturnOnAssets" 
"ReturnOnEquity" 
"QtrlyRevenueGrowth" 
"GrossProfitPerShare" 
"SalesPerShare" 
"EBITDAPerShare" 
"QtrlyEarningsGrowth" 
"InsiderHoldPercent" 
"InstitutionHoldPercent" 
"SharesShort" 
"SharesShortPrevMonth" 
"ForwardDividendPerShare" 
"ForwardEPS" 
"OperatingCashFlow" 
"LeveredFreeCashFlow" 
"Beta" 
"LastSplitRatio" 
"LastSplitDate" 
"Alias" (returns symbol alias - string) - 5.50 and above 
"Address" (returns symbol address - string) - 5.50 and above 
"Country" (returns symbol country - string) - 5.60 and above 
"DelistingDate" returns symbol delisting date (as datetime) - 5.70 and above 

EXAMPLE AddColumn( Close / GetFnData( "EPS" ) , "Current P/E ratio" ); 
AddColumn( Close / GetFnData( "EPSEstNextYear" ) , "Est. Next Year P/E ratio" ); 
Filter = Status("lastbarinrange");  
SEE ALSO GetRTData() function , GetRTDataForeign() function  

References: 
The GetFnData function is used in the following formulas in AFL on-line library: 

ICHIMOKU SIGNAL TRADER
Price Chart - Fundamental
More information: Updated on-line reference

______________

You would be aware that you can get a trial version that is fully functional except for saving work. You can set it up and download Yahoo or Google data including fundamental in a matter of minutes to play around with. All the data will be lost when you close Amibroker, so it's a bit tedious. But it's free and should show you what can be done.

Maybe I'm displaying my ignorance here, but nobody else seems to have answered your original question.


----------



## Wysiwyg (28 February 2015)

My contribution is this addition I made to a buy condition. Tested on AllOrds Yahoo financial data which Ami. can download for free. I would suggest actual data to be used but going on the results over various periods,  a low PE ratio does improve the backtests I ran. The low PE ratio range was found using optimise function where PE outside the ranges performed worse. Maybe Premium Data could look at offering basic Fundamental Data in their subscriptions. :1zhelp:

PERatio = C / GetFnData("EPS"); 
Buy = XXXXXXX & PERatio >= 0 & PERatio < 6


----------



## howardbandy (28 February 2015)

Hi KnowThePast --

My analysis is based on position management where the trader's risk tolerance does not permit holding positions with drawdowns that exceed his or her tolerance.

An example of a statement of risk tolerance that an aggressive individual trader might use is:  
"I am trading a $100,000 account and forecasting two years into the future.
I want to hold the risk of a drawdown (measured as daily mark-to-market decline in my trading account) greater than 20% to a maximum chance of 5%."

Most professional money managers I work with find the 20% too high -- preferring single digits. 

Without a set of rules that govern when to exit positions that have open-trade losses, drawdowns can be, and have been, steep and long.  Some taking many more than three years to recover.  Some never recovering.  

With a set of exit rules, the risk and profit potential of those rules can be tested.  Tests show that drawdown tolerance for most people is reached at about two weeks (with high trade selection accuracy) or a few days (with more relaxed trade selection accuracy).

To hold three years, your tolerance for drawdown is much greater than mine, or your trade selection much better than mine.

Best regards,
Howard


----------



## KnowThePast (28 February 2015)

howardbandy said:


> Hi KnowThePast --
> 
> My analysis is based on position management where the trader's risk tolerance does not permit holding positions with drawdowns that exceed his or her tolerance.
> 
> ...




No argument from me, Howard. 

But this is a very different argument from the original statement that "lack of value of fundamental data for trading". To me it clearly has value, whether that trading style for everyone is a different topic. 

Following these kind of fundamental based signals is similar to indexing, both resulting in a highly diversified portfolio with large drawdown. So is indexing then also not a valuable strategy because of drawdown risk? This makes no sense to me.


----------



## ottg (28 February 2015)

howardbandy said:


> Greetings --
> 
> This is a link to a paper I wrote a few years ago outlining my thoughts on the use of fundamental data:
> 
> ...




Thank you Howard. Here follows a few comments based on your paper. I also want to differentiate between using fundamentals for quantitative analysis to execute trading decisions versus decision support systems. I believe there is a subtle difference.



howardbandy said:


> Economic indicators, such as those published by governmental and other agencies, are not appropriate for direct use in active trading systems for reasons involving their timeliness and accuracy.




Agree that is why I will use that mainly for discretionary decisions. One that I use to improve my personal awareness is http://www.tradingeconomics.com/



howardbandy said:


> Company fundamental data are not appropriate for use in active trading systems for reasons involving their timeliness and accuracy.




Again it depends on your definition of active trading system and the strategy. While the objective is to always select the most profitable opportunity it depends over what time period. I use company fundamentals to select the most lucrative shares that performed best over the long term during the up turn, down turn and recovery period. While that is no a guarantee that there wont be other shares that outperform during the upturn usually they suffer during the downturn and immediate next upturn. That offers me some risk mitigated against a sudden down turn. However some of the additional company fundamentals need to be derived from the raw balance sheet data.



howardbandy said:


> If sectors are carefully and narrowly defined, most of the price movement of individual securities is due to price movement of the associated sector.




Yes there is no doubt that sectors have there own cycles but within each sector there are obviously better and worst performing shares. We need to be able to filter them and again it can be done based on company balance sheet fundamentals and other derived fundamentals.



howardbandy said:


> Intermarket analysis, such as examination of interest rates, can be used for broad market timing, or to create filters to permit or block equity trades.




Yes, depends on the purpose but here I use volumetric, momentum indicators and volatility indicators collectively as leading indicator only to show the better time to buy or sell. Interest rates I may use to determine when to switch into the long term bond market.

In short I dont believe that fundamental exclusively can be used to do automated quantitative trading but again that is not my intent.


----------



## ottg (1 March 2015)

Habakkuk said:


> I'm an Amibroker user but no expert. I believe that fundamental data is only DISPLAYED in an information window. As far as I know, it cannot be used as input to generate signals or even displayed in a chart. I have imported fundamental data and that's what I concluded. .......




Thank you Habakkuk. Yes I will be able to use those fundamentals and will be able to assess them in Amibroker and use data extraction via AmiQuote. 

For a start the three main balance sheet data required: DY, EPS and not found there is Return on Capital employed. I also cannot see a way to exactly derive that. 

I may be able to do: Ret on Cap =~ EBIT/book value
where book value ~= Net assets value

I guess as long as I use the same equation on all shares. Any ideas from anyone?


----------



## SuperGlue (1 March 2015)

ottg said:


> The more I'm searching for a stock screener (for specific data manipulative requirements) the more it looks if it doesn't exist in the public domain.




Check out MorningStar, maybe what you after.

http://www.morningstar.com.au/Tools/StockScreener


----------



## ottg (1 March 2015)

SuperGlue said:


> Check out MorningStar, maybe what you after.
> 
> http://www.morningstar.com.au/Tools/StockScreener




Thank you Superglue. I do have a trial going with them. While their screener is one of the better and more versatile once it still doesn't offer exactly what I'm looking for. Will say more about this later though.


----------



## SuperGlue (1 March 2015)

Found this useful website that I might be able to use myself.
Someone has gone to all the trouble to set it up.

http://asxiq.com/ftdata/cFundMainPage.php?gtVal=RoE

https://www.aussiestockforums.com/forums/showthread.php?t=23888&highlight=asxiq


----------



## ottg (23 June 2015)

SuperGlue said:


> Found this useful website that I might be able to use myself.
> Someone has gone to all the trouble to set it up.
> 
> http://asxiq.com/ftdata/cFundMainPage.php?gtVal=RoE
> ...




Are these guys still active - no recent updates


----------



## mit (23 July 2015)

ottg said:


> Thank you Habakkuk. Yes I will be able to use those fundamentals and will be able to assess them in Amibroker and use data extraction via AmiQuote.
> 
> For a start the three main balance sheet data required: DY, EPS and not found there is Return on Capital employed. I also cannot see a way to exactly derive that.
> 
> ...




I certainly used to import fundamental data and use it in AmiBroker. Can't remember the specifics as it was 7 years ago and the computer long gone but I used it to test a Dividend system.


----------

