Python/R in Trading

For those of you who are traders, how frequently do you use python/r in your job? I know that this question varies for someone who works at a market maker vs. someone who works at a trade house, but for those of you who do program can you give me a sense of how you use it on a day to day basis?

WSO Elite Modeling Package

  • 6 courses to mastery: Excel, Financial Statement, LBO, M&A, Valuation and DCF
  • Elite instructors from top BB investment banks and private equity megafunds
  • Includes Company DB + Video Library Access (1 year)

Comments (22)

  • Works at Citadel Investment Group
Feb 10, 2021 - 11:27am

A lot! Although I don't use R much. I would say 75% Python 25% VBA (I hate VBA, but a lot of the tools that my PM (as well as many others that have been in the industry for a couple decades) uses are built in Excel...). For what it's worth I'm on the HF side, but I did work at a market maker for a couple of years ~4 years ago and mostly used Python there as well.

Feb 10, 2021 - 12:59pm

Don't mean to hijack the thread, but what coding language would you say has the best payoff? That is, if you had to give a ratio of how hard one is to learn vs. how applicable it is to trading. Like I'm sure there are easy ones to learn that are damn near useless and ones that make your life a lot easier but are extremely difficult. Have you found any that are a happy medium?

  • Works at Citadel Investment Group
Feb 10, 2021 - 1:38pm

It depends on the fund, role, and PM you work for, but in general for a trading role I would say VBA and Python is a good toolbox. C++ isn't really necessary unless you're working on pretty low latency strategies, and some people use R - you could argue R is easier to learn than Python, but I'm not really sure if that's true. Anyway, the industry is generally moving away from R towards Python.

For some roles you'll only use VBA, for some you'll only use Python, and for some you won't use either. Honestly I never really 'learned' VBA - I learned Python (and a couple of other basic languages, but Python is by far the most useful), and initially when I had to work on something in VBA, I struggled through but made it work just using Google and my experience with Python. At this point I feel pretty comfortable in VBA. I guess what I'm trying to say is that VBA is pretty easy to learn, but if you learn Python then VBA won't be that tough to figure out if/when you need to, but the other way around isn't necessarily true.

Learn More

300+ video lessons across 6 modeling courses taught by elite practitioners at the top investment banks and private equity funds -- Excel Modeling -- Financial Statement Modeling -- M&A Modeling -- LBO Modeling -- DCF and Valuation Modeling -- ALL INCLUDED + 2 Huge Bonuses.

Learn more
Feb 26, 2021 - 6:42pm

Python is the easiest popular language to learn, and it allows you to use industry standard statistical, data science, and deep/machine learning packages. I would do a comparison in how easy and robust analysis is in pandas/matplotlib vs excel once you pick that up to a reasonable amount of proficiency.

  • Prospect in PropTrad
Feb 10, 2021 - 3:45pm


Might I ask you is it easy to transfer from the prop shop to a hedge fund role? I assume you were a trader at the prop shop.

Feb 22, 2021 - 3:13pm

Using a lot of R, Python and 10% VBA (mostly legacy stuff). R is great for statistical models, but Python improved a lot during the past few years and is much easier to integrate with any tech stack. If you start from zero, nowadays I would go with Python.

The most important thing is don't get lost in stupid X is better than Y stuff, be language agnostic and select the best tool for each task. If everybody in your team is using R, use R. If your manager wants some fancy excel models use VBA. It makes no sense writing code in a specific language if it takes you 5x as long and your code quality sucks.

Most Helpful
Feb 28, 2021 - 9:28am

Oversimplified breakdown:

Python: Multi-purpose use/versatility. I might be interested in creating a very simple simulation of a broad trading strategy I have in mind. I also might be interested scraping data directly from certain websites using packages like BeautifulSoup, Selenium, etc and using Pandas to do some preliminary data analysis. Standard data science libraries. Maybe I want to build a simple alert bot for when certain thresholds pass or there's live news events I want to trade off of. 

R: Very useful if you want to get heavy with statistical analysis. Your bread and butter for running ML/AI analyses on datasets. You certainly can do plenty of quantitative deep downs with Python, but R will have the overall "edge" if you want to go all out. Goes without saying it offers great data visualization options, though I wouldn't discount Python either

VBA: Usually for lesser intensive automation processes. Lot of firms still rely on Excel so VBA is a great bridge. Working with spreadsheets, it's extremely useful for the operations side such as EOD P&L recap as well as position reconciliations. When you start out in a trading role, you typically need to oversee and master the operations aspects of the desk. You certainly CAN use Python but it could also be overkill in a lot of scenarios.   

Feb 28, 2021 - 11:07am

Hey ActuarialQuant,

I don't really use python on a regular basis in my daily work, but it's something I am interested in learning. Specifically the data-analysis and website sentiment scraping. As someone looking to self teach do you have any recommendations as to the best place to start?

I recently spent an entire weekend downloading python, sublime, and a few libraries and going through sentdex's "introduction to python" course where he builds a tic tac toe game. It was interesting but I felt I didn't really "learn" too much, just picked up on a few things. I went to try his "Finance" tutorial next but it seemed the videos were pretty old and he was relying on APIs that are no longer functional so I gave up.

I then learned about anaconda and that a lot of data-scientists prefer to use this vs traditional python and adding all the libraries they need as it comes "pre-loaded" out of the box with most everything you would want to use. Jupyter notebook also seems like the preferred way to teach/learn or am I off on this?

Do you know of any good resources for learning financial concepts/data-analytics through the anaconda framework, preferably free and as up to date as possible?


Feb 28, 2021 - 8:40pm

Nam aut provident non laboriosam rerum. Non autem ea aut sapiente voluptate deserunt ab. Iste dolor quis molestias et et aut distinctio. Officiis consequuntur cum et blanditiis et.

Start Discussion

Total Avg Compensation

October 2021 Investment Banking

  • Director/MD (10) $853
  • Vice President (39) $363
  • Associates (227) $232
  • 2nd Year Analyst (136) $154
  • 3rd+ Year Analyst (30) $147
  • Intern/Summer Associate (103) $143
  • 1st Year Analyst (496) $136
  • Intern/Summer Analyst (382) $83