The best detailed explanation on how to use Matlab, C++, and C#. When and where?
This is easily of when the best explanation I have seen on using these three classic technologies for quant work. This was posted in a great Linked In group debate:
MatLab is very good for modeling and studies. I personally use Maple for my modeling and stat work and that is just personal preference.
There are some add-ins for Matlab (and even excel) that will interface to your brokerage for trading. Some traders are doing just that and it is working well for them. Probably this is the fastest way to get your strategy to production.
However, understand that you wont have as much flexibility and performance as if you were implementing in C++
For those that want to implement a custom solution. Here are some factors to consider when choosing C++, C#:
The language that your brokerage API supports.
Or another option would be to use a trading platform like NinjaTrader (C#),
or TradeStation (Easy Language).
A platform will allow you to focus on your strategy and not have to code a lot of networking infrastructure, i.e. FIX, FAST, etc.
However, there is also open source FIX and FAST frameworks that you may wish to use, in both C# and C++
If speed and performance will be an issue to your trade strategy success.
If you are planning to implement a high-frequency strategy with collocation then
probably your only options would be low level C++, and assembly.
Some stat arb algorithms also need to be very quick, and for others performance is not significant factor.
C# is slower than unmanaged c++ because of the CLR garbage collection.
But a good developer will know how to optimize C# to avoid not as being slowed down from the gc.
How much time (and money) are you willing to spend to get your strategy to production.
C# is a language designed for rapid application development. Memory is managed for you and the .NET Framework 3.5 and 4.0 framework is very powerful.
I don’t think you will find a language with such a versatile built in library.
Your programming level and expertise in C++, C#
Is not necessary true that a good C++ programmer will make a good
C# programmer, etc. Both have their own tricks and best practices.
Will you need rich GUI support?
If your trade app will need windows GUIs and need performance, one option would be that you can implement it in all MFC C++.
However, the look and feel of MFC is very outdated, but never less MFC is fast.
Or a better way, maybe also try to use something like platform invoke to provide manage, unmanage code interoperability and then you can have the critical performance algorithms implemented in C++ and the GUI in a C# layer.
You can make the GUI look very nice with WPF or Silverlight and follow a MVC architecture.
However, do understand that cross code mange/unmange interob will not be best performance practice, but for your GUI – reporting purposes only, then this doesn’t matter much since your critical trade algorithm will be in C++.
I assume the database access will be for back office- reporting purposes, unless maybe you need to look up a lot of fundamental data in your strategy and
don’t want to/ or have the time to implement or mess with a lot of abstract data structures such as containers, trees and hash tables to manage this data on your own.
Then, I would strongly recommend C#, SQL Server, with .net entity framework. An ORM Mapper like entity framework takes out a lot of the work in regards to handling the impedence mismatch in your relational database code interacting with your C# domain model, and you will be able to go to production a lot faster. Do understand the ORM mapper will add some slownesss to your application, however it will save you alot of development efforts.
Make sure that you know or have an DBA that implements table partitioning functions and indexes well, this will give the database a huge performance boast when dealing with huge amounts of historical-fundamental data that needs to be access quickly.
HOW DO YOU START A PROFITABLE TRADING BUSINESS? Read more NOW >>>NOTE
I now post my TRADING ALERTS
into my personal FACEBOOK ACCOUNT
. Don't worry as I don't post stupid cat videos or what I eat!