Back to Community
Interesting stuff from a Microsoft Developer regarding Python development

Hi,

Here some 'free promotion' by a Microsoft fan who is using paid and free non-commercial Microsoft tools. I have no relationship with Microsoft other than Office365 (great product! also on iPad/ iPhone and integrates great with Lync / Skype), a Nokia 620 (not so happy due to back driving software, but has been improved recently), and a MAPS subscription of 400 euro a year (for Microsoft Visual Studio Professional). Currently I am learning Python since in C# I did not find nice stuff like Quantopian. Algotrading seems to have started already years ago when there was only C++ and C. Today, also managed code like .NET is fully capable of running real-time. However, generations have grown up with C, C++ and Python...and C# is quite lonely...

I like Microsoft because it is paid, and that drives innovations and hands to improve things when needed. Not in freetime like many open source projects..those can also speed up, but having people dedicated is better!). The result is great architectural frameworks, great support and plenty of help, online labs and tutorials. Above all, Microsoft is for years a software development company with many developers who need to collaborate efficiently. Therefor, they have now Visual Studio with Team Foundation Server. Both have integrated scrum board and version tracking (also for GitHub since Spring 2013). Now you think paid....most open source developers/ most technical background dislike Microsoft. I know....have a look at Promise, where Microsoft still has the patents on their innovations, but you and others can freely use is. Like C#, but also oData, which is in Entity Framework..and since last year heavily adapted by SAP and others. Of course there are leaks..but not that many as in Java :-(. Microsoft is also on the Javascript 'tour'..which I personally dislike since that looks spaghetti.....but also that spaghetti is taken care by Microsoft: tools to visualise and use code snippets..have it integrated in the IDE for automatic deployment to the IDE (nuget is MS version of PIP/ EasyInstall)....but than with version integration, a nice GUI and even rollback of code in your projects..Microsoft is like icecream to me...or my children...otherwise I grow fat.

By the way, I have a MSc. in Electronics Engineering, and in the past coded also in assembly, C, and C++.....then moved to VB, C#.NET and also a bit X++ (Dynamics AX ERP)..X++ is nasty and will be converted to .NET since X++ is really DOS...Python is also a bit like going back to MS DOS... sorry....IPython is great since it is like Matlab and provides instant runtime, which Microsoft does not have or I do not now how to activate it.

C# has millions of developers world wide. Microsoft has great open source projects as well, and on Microsoft Research you can read a lot of interesting projects. However, seems in algotrading I am alone...so to get a bit of my own world into Python I have some interesting links here, because I don't believe this thread will invite people here to start coding in C#..although an automatic port (like Java to C#) would be great :-). Then C# people can use the open source libraries, but glue it with C#.

An intermediate stage is adding all Microsoft tools to Python. A team at MS did, but I read somewhere, they now do that voluntary (not sure I am right).

My tool kit [won't run on Ubuntu/ you need Windows, but will install at once :-), I had Python, Pythonxy, IPython..and tons of compilation bugs of outdated source files...so a lot of manual stuff...and I already get headache in having all those libraries up-to-date in future...I will not get instant notification in VS that there is an update of Zipline or other library used :-(.

  1. Microsoft .NET C# / SQL/ MVC development with Visual Studio as IDE; You can go for the free version Express, but for the VS you need at least the Professional edition since it allows 'projects' and named dll compilation. I believe also for the Python integration you need at least that version. No problem, with MAPS you can get for 400 euro a year a license..and that is up to 5 developers including all Windows 8 licenses, etc.
  2. Team Foundation Server as Application Lifecycle Management (http://www.visualstudio.com/). This was an expensive one for small teams, but today it is ony in the Azure cloud. It is free up to 5 users and it can even handle GitHub. It is great for scrum/ agile development. You have all integrated, even with nightly build (not sure also Python, C# has) and INTEGRATED testing facilities...not to forget..how to test Python decently? A small bug can have great effect....in terms of money here!
  3. Microsoft SQL Express is a free database which can hold GB's of data, but is limited in its number of processors. You have Microsoft SQL Studio Management Express which seamless integrates with MS;
  4. The vanilla is a nice plugin for Python (PTVS) http://pytools.codeplex.com/..Now I have intellisense (http://pytools.codeplex.com/wikipage?title=Features%20Editor#intellisense) I can quickly run through the syntax, and understand with the aid of the debugger line-by-line what is happening.

Bullet 4 helped me a lot. I use IPython for trial-and-error and then add it to Visual Studio. With TFS I commit all my changes and with the taskboard of TFService I have all my tasks....but for now....learning Python and trying which algos are succesful.

I hope more people will move to C# since Microsoft has great tools and > 1 million of C# developers world wide.

J.

5 responses

There are platforms based on C# like NinjaTrader. Python has the advantage of having a lot of math functions readily available at no cost. There are heavy math libraries for C# but most are not free.

I have tried using IronPython in attempt to interface with C#. I couldn't get libraries like numpy or scipy to initialize. IronPython seems to have been mostly abandoned by Microsoft. Although there is a project on Codeplex, progress with Python to .Net seems pretty much dormant. The Numpy/SciPy documentation on their wiki is marked as depreciated.

The focus primarily appears to be on using Visual Studio as an IDE for CPython

Dear Brent,

I understand what you mean. You want to integrate with C# already. I just want to learn Python with help of the Visual Studio IDE. I did not install IronPython since I found it already difficult to have so many opensource Python projects with different compilation times. From Microsoft I am used to get just one framework (currently .NET 4.5.1). Updates from packages created by others are installed through nuget in the Package Manager. I had many compilation errors with Python at start and tried Python, IPython, Pythonxy. The last PythonXY is what I am using now. I installed PTVS on top of that. Is seems VS just looks to the Python 2.7 directory. I have not looked further for C# integration.

In this video you see all the features, and the narrator also states that you can use any Python version. https://www.youtube.com/watch?v=JNNAOypc6Ek. They use Python 3.3 version.

I believe if Python has compilation errors on libraries itself, it has to do with Python..the same pain I went through to get all libraries from everybody working. That is a problem with open source projects with many sources......an open sources project. I ended up with Pythonxy, but also have Ipython running..realizing that maybe IPyhton is an add on top of Pythonxy :-(. I will look into C# integration later. If I have time I will look if it works in my IDE. Do you have a video or page to read how I can quickly see what you tried or used as a starting point?

J.

For integration of C# with Python, you need indead some IronPython dll.s, not all! So if you don't use IronPython completely, you can stay with PythonXY or something else. C# 4.0 has dynamic language which allows to interact with Python. You simply can develop and share in Python and then build database integration and GUI in C#, which is most likely faster...with LINQ etc.

Samples can be found here:
https://www.simple-talk.com/dotnet/.net-framework/dynamic-language-integration-in-a-c-world/
http://ironpython.codeplex.com/wikipage?title=Samples

"IronPython is an open-source implementation of the Python programming language which is tightly integrated with the .NET Framework. IronPython can use the .NET Framework and Python libraries, and other .NET languages can use Python code just as easily. ".

Since the community of Python maintains the Numpy/SciPy libraries in Python, and most algotraders use Python, I would stick to Python, but integrate database and GUI in C#. So only use .NET al call functions from Python. For instance load data from MSSQL database, run TradingClass and pass results back to the database. Doing all this in Python does not make sense. Entity Framework and MVC will simply not work in Python. You will miss the Visual Studio IDE, which is still the Vanilla....

Maybe I did not understand you completely, but this is how I would approach it.

C# is well used in the industry, even in retail cloud algorithmic trading.

Please take a look here for something that might help you with your Python Woes:

https://store.continuum.io/cshop/anaconda/

Free for use, though you can pay for the additional features, and will basically resolve your package compilation/management woes...

Did you run into so many compile issues using PIP, or were you manually downloading/installing packages yourself? If you weren't using pip/easyinstall, those would be your friend for the most part no matter what package you make use of (in Anaconda you'd use conda which usually falls back to pip when a package is not available from conda... or you can still use pip).