Notepad, Jupyter or IDEs for financial research?

I travelled on a plane for the first time in 18 months recently. It felt kind of similar to before, aside from things like masks, and the packing took a lot longer than before. But in all, I really enjoyed going on holiday, and I think I appreciated being away a lot more than in the past! Before travelling I explored other means of transport. What about driving? Well, that’ll be 22 hours. What about the train? Well, not much better. What about by ship? Even longer and the cost was much more. Whatever the means of transport, I’d hopefully still reach my destination. However, it doesn’t take a genius to guess that a 22 hour drive will be more tiring than a 2 hour plane ride. 

 

When doing research in the market, our ultimate destination or objective is to make money. This might be in the form of a trading strategy or some unusual observation about the market etc. In my case, this research often involves doing a fair amount of coding often in Python. But how do we get to our destination in this case? One of the choices we need to make is how we setup our coding environment. We have many choices on how to setup our programming environment, do I use the cloud? Do I use Docker containers or create a conda environment etc. In this article, I’m going to focus on how we write our code, rather than where we necessarily run it when developing.

 

I know folks who love to use notepad like applications to write code. Some like vi, and are adapt at using all the shortcut keys with it. I find vi frustrating to use, and find it all a bit spartan typing code into a notebook-like editor. Then we have Jupyter notebooks. Whenever I do teaching for Python, I find Jupyter notebooks invaluable, being able to mix plain text with Python code and the output, particularly when trying to illustrate output such as charts etc. It makes the coding process very interactive. Jupyter notebooks are also ideally suited for doing early stage research, where you are exploring a dataset and beginning to build an algorithm. They also have things like syntax highlighting, which makes code easier to read. The great thing with Jupyter notebooks is that you can also use them to present research to folks which is particularly important in finance too! JupyterLab takes things a bit further, and ends up looking a bit more like a development environment. 

 

If we take things a step further we could use an IDE, which makes it easier to write reusable code. They also often have version control, debuggers and code profilers too, and they make it easier to organise your code. As to which IDE you might like most, it’s often a personal choice. I like using PyCharm a lot, even if it has its own peculiarities (indexing takes a long time…). Other folks like using VSCode, and there’s also PyDev too, which is popular, particularly if you’re used to using Eclipse for Java.

 

There isn’t really a right code editing environment for you to conduct your research journey. What might work for me, may not work for you. It also depends on your objective. You can use multiple coding environments. Earlier on in research, having a Jupyter notebook can be a very nice way to play around with an algorithm. However, as the code becomes more mature and if you want the code to become more reusable, you might choose to rewrite it as coding library perhaps using an IDE. You can still use a Jupyter notebook to present your findings too, but hide the complexity of in a library. Hopefully, whatever coding environment you choose, you’ll get the right answer to your research! Just make sure to explore several different alternatives first, to see what suits you best.