tag:blogger.com,1999:blog-35364652.post1784842031130327716..comments2024-03-22T10:29:59.088-04:00Comments on Quantitative Trading: A reader comments on trading using Excel VBA and Factor ModelErnie Chanhttp://www.blogger.com/profile/02747099358519893177noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-35364652.post-61718788626140376032018-03-06T09:17:04.295-05:002018-03-06T09:17:04.295-05:00Hi Massimo,
It may be faster in the short term, bu...Hi Massimo,<br />It may be faster in the short term, but it cannot handle a massive amount of data.<br />I have completely given up on using spreadsheets for almost anything.<br />Matlab or Python is the way to go.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-9350020174667236932018-03-06T08:45:12.765-05:002018-03-06T08:45:12.765-05:00About spreadsheet and quantitative finance:
Since...About spreadsheet and quantitative finance:<br /><br />Since I also find the strategy development on spreadsheet much faster and simpler,<br />I wondered if there is a better tool than Excel / VBA.<br /><br />Someone told me about quantrix/Groovy (https://quantrix.com). Do you know it ?Anonymoushttps://www.blogger.com/profile/02910197882314453904noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-55746789780246230982009-05-17T17:13:00.000-04:002009-05-17T17:13:00.000-04:00Hi Vinay,
I have used matlab2ibapi for several mon...Hi Vinay,<br />I have used matlab2ibapi for several months, and have found it to be quite useful and reliable for automating my strategies. In fact, I will be publishing an article illustrating how to use it.<br />ErnieErnie Chanhttps://www.blogger.com/profile/02747099358519893177noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-43082665426537397702009-05-16T13:08:00.000-04:002009-05-16T13:08:00.000-04:00Hi Dr Ernie Chan
I have read your book on Quantit...Hi Dr Ernie Chan<br /><br />I have read your book on Quantitative trading. It is said that MATLAB is good tool to develop complex strategies. But there is no well approved API for that. There is one recently found MATLAB2IB. But is it good enough and well tested?<br /><br />It is said in your book that Excel/VBA is slow as compared to C++.<br /><br />I am interested in developing a Automated Trading System. Shall I use this new MATLAB2IB and continue to develop strategies in Matlab? I am good in Matlab and I have used it extensively during my Ph.D and other work. I have not used C++ much and I found it more difficult as compared to MATLAB. Given a choice, I will always do coding in MATLAB. <br /><br />But is it necessary to develope strategies in C++, if I want to develop a automatic trading system?Unknownhttps://www.blogger.com/profile/11220522671107808779noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-45045841128328121372009-04-20T22:49:00.000-04:002009-04-20T22:49:00.000-04:00"However one problem I have encountered is my ongo..."However one problem I have encountered is my ongoing desire to regularly modify and improve the system which I have found can become counter productive as there is a real danger that system development becomes an end in itself!"<br /><br />Dear John,<br /><br />I was very surprised by your post. In the world of quantitative analysts (derivatives models design and implementation etc. for top tier investment banks, I have spent 6 years doing that) Excel VBA is believed to be the least flexible and sustainable programming language we have to deal with; systems written using these languages are about to be retired. I understand that now you are still happy with it, but thought you might wish to study the alternatives. At a relatively modest entry price, you can get performance and sustainability that would surprise you.<br /><br />VBA issues that come to mind are: <br />* poor performance, <br />* poor memory management (this can make the performance even worse), <br />* you cannot use version control system that would allow you to track changes (who-what-why-when) and would facilitate collaboration (see e.g. http://svnbook.red-bean.com/nightly/en/svn.intro.whatis.html#svn.intro.righttool and http://tortoisesvn.tigris.org/; there should be some Microsoft version control tools). Based on my experience, starting from some volume VBA code become unmanageable, one of the reasons for this being that you cannot use version control.<br />* poor flexibility (compared to the alternatives I will be <br />** absence of classes (class = structure + methods that can access and modify the contents of the structure)<br />** virtual absence of abstraction mechanisms (Variant is very error-prone). You might need them if you want to use the same algorithm for a stock and for a yield curve (same action, different objects).<br /><br />Alternative "easy to use" programming languages would be Matlab and Python. Both languages are SVN-friendly (see the third bullet), Excel-friendly, but have poor performance. <br /><br />Matlab is quite costly ($1K - $10K, depending on what packages you need and on your location), much nicer and user-friendlier, support team is at the ready,... Matlab performance tip: vectorize your code (operate with vectors and matrices rather than on element-by-element basis, e.g. vector where element i would be a price of stock X on date [observation date + i days] or matrix where element ij would be a yield of currency Y on date i for maturity j). Another way to speed up Matlab is to buy a package that can convert Matlab code code into C++ code, that can be compiled in a DLL you can use in Excel. Such DLL would work much faster (may be a hundred times faster... depends on your task). <br /><br />Python is a freeware, quite austere, it takes a bit of time to get into it, but it would be worth it. It is more flexible, more of a "proper programming language".<br /><br />Other languages you might wish to consider are C#, VB.NET and stand-alone VB (all by Microsoft, all reasonably priced). I would position them in between C++ (see below) and Excel VBA; C# would be the most powerful one, VB would be the simplest for you to use - it is almost identical to VBA. Again, there is a trade-off between performance/flexibility and straight-forwardness/similarity to Excel VBA.<br /><br />Hand-written C++ code is the best from the performance point of view, this is a quite versatile language, but it takes a lot more time to learn it.<br /><br />Hope you would find it interesting...Yuccanoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-82479643496781126282009-04-09T09:49:00.000-04:002009-04-09T09:49:00.000-04:00"However one problem I have encountered is my ongo..."However one problem I have encountered is my ongoing desire to regularly modify and improve the system which I have found can become counter productive as there is a real danger that system development becomes an end in itself!"<BR/><BR/>Interesting point. I reckon that the best way to deal with this is to accept (or refuse) the kind of Win/Loss ratio your trading method produces. What I mean is that if you trade counter trend and, psychologically, you only feel confortable with a high level of winning trades, you'll have a hard time coping with a system that generates as many wins or losses. In these circumstances, perhaps you (and the system) will be better off by setting up stricter criteria and sacrificing some setups - but not too many - in order to achieve a higher level of winning trades (even though, in the process, you also might reduce your Avg Win / Avg Loss ratio!). <BR/><BR/>But I agree: it's tricky issue that burn out event the most seasoned traders.Ricardo Arrojahttps://www.blogger.com/profile/08742407647587033313noreply@blogger.comtag:blogger.com,1999:blog-35364652.post-57163377511623374972009-04-06T11:00:00.000-04:002009-04-06T11:00:00.000-04:00a little bit of luck will not interfere in the for...a little bit of luck will not interfere in the forexmerkehttp://xucpxfo.lookseekpages.com/iowho.htmlnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-45061964620638159722009-04-02T19:39:00.000-04:002009-04-02T19:39:00.000-04:00I definately think the bandwagon factor is at play...I definately think the bandwagon factor is at play, we are often like sheep, and I see no reason why investment strategy or systems would be any different.Greghttp://www.forex-info.comnoreply@blogger.comtag:blogger.com,1999:blog-35364652.post-11220003362928489962009-03-31T09:19:00.000-04:002009-03-31T09:19:00.000-04:00I reckon the major reasons behind a popularity of ...I reckon the major reasons behind a popularity of Excel/VBA in a quant and quant trading world are:<BR/><BR/>1. A lot of people already using it - so everyone think that's the way to go.<BR/><BR/>2. Simplicity of VBA (not sure if it correlates with its flexibility) - that makes it possible to effectively use by anyone - whether it is a trader, quant or a desk developer.<BR/><BR/>3. VBA and Excel could be easily extended (to improve a performance, integrated a 3rd party software or just to modularize/re-use purposes) by moving the actual model logic into C++, COM or .NET<BR/><BR/>As for the later (easy way to integrate quant analytics written in .NET with Excel and VBA) - one may have a look at my solution: <A HREF="http://www.excel4net.com" REL="nofollow">www.excel4net.com</A>Excel4Nethttps://www.blogger.com/profile/12409796772777725445noreply@blogger.com