Sharing investing and trading ideas. Helping traders get started.
Advertisement
Showing posts with label trading. Show all posts
Showing posts with label trading. Show all posts

Tuesday, June 23, 2009

Can I do it too? Learning Quant

My first experience of being a quant was when I worked for a hedge fund dealing in commodities years ago. Ironically, it was a matter of luck that I got the job as I didn't have any formal training in mathematics or programming back then. My background was more in the financial markets. However, the experience got me started on my multi-year learning journey in quantitative finance and I realized that people who want to embark on a similar route need to know that this is a VERY VERY diverse field.

Most quantitative finance programs in universities focus a lot on the pricing and risk management part of finance. You learn probability, statistics and advanced calculus to price financial instruments or to estimate how much risk your company is taking. Such advanced knowledge and skills are needed because companies are trading increasingly complex derivatives which are hard to value and trade. This in turn makes it harder for risk managers to estimate the (probabilistic) losses that a firm can incur on any single day.

On the other hand, there is an even more arcane part of quantitative finance, concerning the prediction of market prices and direction, which is not really taught in business schools yet. Increasingly, people are implementing statistical models to predict where the market will be heading next. These models typically draw on knowledge from a variety of fields such as artificial intelligence, computer science, statistics and signal processing. While there are available papers published on them, many people usually choose not to publish such strategies. I provide an example of such a paper at the end of this article.

To complicate matters, there is another area of quantitative finance that has very little to do with mathematics. Instead of trying to price complicated financial instruments, some engineers focus on arbitraging identical instruments, such as buying gold futures and selling gold bullion if prices between these two similar assets diverge. However, such market inefficiencies are usually short-lived. Traders usually build very fast computers to automatically spot and exploit these opportunities.

If there is one lesson that I want to share, I must say that these three areas of quantitative finance are very different and likewise require very different skill sets to be successful in them. To trade complex derivatives, you will probably need to work at an institution and have the educational credentials, such as a master's in financial engineering or a Phd to be hired in the first place. To build models to predict market direction, you will need to have read extensively to have an idea of the more successful formulas out there. In addition, you need the know how to amend and implement these models in live trading. The last aspect of quantitative finance that I mentioned will require good engineering and programming skills to reduce latency in your computer program.

These skills need not be complementary. If you are planning to be a quant, you need to consider your objectives and the competencies you want to create, i.e. know what you want and find out what you need. Unless you are thinking of working for a top institution, you do not necessarily need an advanced degree. If you are thinking of implementing your own quant trading strategy, what you need is basic knowledge in either math or programming. At the very least you need to believe that you have the intellect to complete a college degree in a non-liberal arts program. This is because both math and programming require a certain amount of logical analysis and abstract thinking. The rest of the knowledge can be acquired through hard work and patience. Over the years, I have lost count of the models that I have built and thrown away despite their academic rigor. On the other hand, I have personally met academics who started their own funds. If you want to build your own quantitative trading model, you will need to be prepared for the long haul. After thinking for some time, I realized that the easiest way to get started in trading is to match your strengths to your trading strategy.

These are some books (and links) from Amazon.com that I recommend if you are considering going "quant". I have read all of them before and I find them easy to comprehend for most people. Emanuel Derman is one of the first few quants on wall street and his book My Life as a Quant: Reflections on Physics and Finance will give you an idea of what quants do. Fooled by Randomness: The Hidden Role of Chance in Life and in the Markets by Nassim Taleb will teach you how to think like a quant, with some basic statistics. Neural Networks for Financial Forecasting (Wiley Trading) is an old book. However, it makes a good starting point for some one to get acquainted to building trading models.

The sample paper by Neely that I promised earlier.



Like what you have just read? Digg it or Tip'd it.
The objective of Finance4Traders is to help traders get started by bringing them unbiased research and ideas. Since late 2005, I have been developing trading strategies on a personal basis. Not all of these models are suitable for me, but other investors or traders might find them useful. After all, people have different investment/trading goals and habits. Thus, Finance4Traders becomes a convenient platform to disseminate my work...(Read more about Finance4Traders)

Thursday, June 18, 2009

Cleaning your data: A free excel spreadsheet with VBA code to screen your data

I have previously written a post on ensuring that the historical data you use is of reasonable quality. The quality of your data is potentially worsened if your dataset is pieced together from multiple sources, which is not surprising, given that I have spotted a few firms selling data that is older than them. To help myself clean or scrub my data, I created an excel spreadsheet to automatically screen for potential data errors. It is also available free to you through this blog.

1) While it is definitely far from perfect, it is unprotected which means you are free to edit the VBA code for your own purposes.

2) Without additional VBA coding, it can read most indicative data types, i.e. data with or without the volume, high, lows and open prices.

3) The output is calculated using excel functions and formulas – not hard coded. Hence, you can edit the formulas without further coding to customize your results.

4) It does not amend your data. It is up to you to filter them and decide for yourself whether to remove the data points that the spreadsheet flags out.

Screen Shot 1:

Screen Shot 2:

There are two ways you can use the file. You can paste your data into the file, click onto the “Try” button, select where you left your data and a new spreadsheet will be generated with the output. Alternatively, you can open the Visual Basic Editor (Alt+F11) and copy the entire code over to your spreadsheet.

There are only 3 main restrictions that I can think of which will require you to edit the VBA code. Your data must be arranged in rows, not columns. And the first and second columns must contain the day and time information respectively. Finally, real tick-by-tick and quote-by-quote data is inconsistent in frequency due to its nature. Hence, such data will show an especially high error rate in my spreadsheet, unless you change the formula.

If you find this post or tool useful, you can help me by promoting my blog to your friends or sharing an article or tool that you find useful or providing feedback on this tool to finance4traders@gmail.com

Download

Alt site: http://sites.google.com/site/finance4traders/

Notes: You need to enable macro to let it work. Please be informed that I am not liable for any damage or losses out of this spreadsheet and no warranty is provided. Ironically, do not worry about viruses. I sent this file to VirusTotal to be scanned by more than 20 antivirus software engine before I uploaded it.

Related Articles: What is good quality historical data?




Like what you have just read? Digg it or Tip'd it.
The objective of Finance4Traders is to help traders get started by bringing them unbiased research and ideas. Since late 2005, I have been developing trading strategies on a personal basis. Not all of these models are suitable for me, but other investors or traders might find them useful. After all, people have different investment/trading goals and habits. Thus, Finance4Traders becomes a convenient platform to disseminate my work...(Read more about Finance4Traders)

Friday, June 12, 2009

Why technical indicators alone are not enough?

It is inherently difficult to decide on a trading strategy or indicator. You have to decide on how often you want to trade, what you want to trade and what kind of indicators you will pursue. I deliberately avoided technical indicators when I started and only restarted looking a indicators recently for a mini-project. The model or system that I would use had to involve some amount of quantitative analysis. The rationale is simple. The financial markets are highly competitive with many people trying to make a living off speculation. Any single or combination of technical indicator(s) that can be easily picked up by a layman is unlikely to be consistently profitable over time, as there is no free lunch in this world.

Consider the example of moving average rules, i.e. where you go long if a moving average over the last n days crosses above another moving average over the last n+m days, and vice versa. If asset returns have momentum, i.e. follow trends, moving averages should ideally work. However, following market trends can be compared to a “hot potato” game where the last player catching the soon-to-end trend loses money.

Academics have in the past done considerable research on technical trading rules. Brock once tested the moving average rule on daily data from 1897 to 1986, on the Dow Jones Industrial Average. He found that using any two of the 1, 2 and 5-day short averages and the 50, 150 and 200-day long averages produced statistically significant profit over time. More recent research by Olsen found that profitability from moving average trading strategies have largely disappeared in the foreign exchange markets by the 1990s.

However, innovative uses of moving averages have spawned strategies that were profitable. Okunev and White used the difference between the short moving average and long moving average as a measure of momentum and showed that a strategy of going long currencies with the most momentum and shorting currencies with the least momentum produced significant profits. Moving average rules are also used with other technical indicators in more complicated strategies. For example, Neely used a technique known as “genetic programming” to successfully search for profitable trading rules, inclusive of the moving average crossover, over time.
Hence, it becomes apparent that the same technical indicator has to be implemented in an increasingly sophisticated manner in order to make money.

References
Christopher Neely, Paul Weller, and Rob Dittmar (1997). Is technical analysis in the foreign exchange market profitable? A genetic programming approach. Journal of Financial and Quantitative Analysis Vol 32, Issue 4, pg 405-426

Dennis Olson (2004). Have trading rule profits in the currency markets declined over time? Journal of Banking and Finance Vol. 28, pg 85-105

John Okunev and Derek White (2003). Do momentum-based strategies still work in foreign currency markets? Journal of Financial and Quantitative Analysis Vol. 38, Issue 2, pg 425-447

William Brock, Josef Lakonishok and Blake LeBaron (1992). Simple technical trading rules and the stochastic properties of stock returns, Journal of Finance Vol. XLVII, Issue 5, pg 1731 – 1764


Like what you have just read? Digg it or Tip'd it.
The objective of Finance4Traders is to help traders get started by bringing them unbiased research and ideas. Since late 2005, I have been developing trading strategies on a personal basis. Not all of these models are suitable for me, but other investors or traders might find them useful. After all, people have different investment/trading goals and habits. Thus, Finance4Traders becomes a convenient platform to disseminate my work...(Read more about Finance4Traders)

Sunday, June 7, 2009

About Finance4Traders

Finance4Traders is a site targeted at traders wishing to build a strategy or model of their own. It shall contain information on trading platforms, technical indicators and quantitative models such as neural networks etc. Hence, the name finance for traders simply refers to the promotion of relevant finance know how for traders.

Unbiased trading research: Bringing open source to trading

These days, there are a lot of internet websites that promote materials and courses purporting to help traders. Yet there are surprisingly few websites that compile and publish, in an impartial manner, the profitability of various technical indicators and trading strategies etc. Furthermore, traders tend to be secretive of their strategies and methods. Hence, the first objective of this website is provide unbiased transparent research so that aspiring traders do not need to reinvent the wheel.

Bridging the knowledge gap

Sophisticated models are often explained in an unintuitive manner in books. Most websites do not explain how they work, but promote some software to that aim to help traders get started. Even if the computer code is freely distributed, the trader might need to run it on highly expensive software such as Matlab or SAS. Part of the objective of Finance4Traders is to explain such models to visitors in a highly intuitive manner and help them build these models using commonly available software such as Excel or NinjaTrader.

A hobby site

Finance4Traders is first and foremost a hobby site. No, we still have not come up with a trading strategy, that we believe is highly profitable. After all, the holy grail of trading is not easy nor quick to achieve. Nonetheless, this website helps us to deposit and keep track of our work, and contribute to existing knowledge and disseminate new knowledge. At this stage, we do not intend to charge for, nor seriously provide any services.

Visitors are welcome to comment and exchange ideas.


Like what you have just read? Digg it or Tip'd it.
The objective of Finance4Traders is to help traders get started by bringing them unbiased research and ideas. Since late 2005, I have been developing trading strategies on a personal basis. Not all of these models are suitable for me, but other investors or traders might find them useful. After all, people have different investment/trading goals and habits. Thus, Finance4Traders becomes a convenient platform to disseminate my work...(Read more about Finance4Traders)