Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Python as a Trading Platform
22 points by washedup on June 13, 2012 | hide | past | favorite | 12 comments
Anyone here have experience using Python to develop, simulate, and run trading strategies? I am currently an R user that uses a third party software to interact with different exchanges.



Can you go into more detail on your setup? I've been using Python to simulate interday ETF strategies -- which is a relatively simple matter, but haven't really done anything to complex with it yet.


What setup do you use for this?

I'm quite interested in testing some trading strategies with Python.


I get data from Y! finance, using urllib2, and then use csv.DictParser to get the daily price series. From there I write code that takes in those series for a given basket, and buys/sells and keeps track of P&L, then use matplotlib to view results. Email's in my profile if you want to talk more.


Yahoo finance data is notoriously inaccurate, and that may invalidate many strategies based on it.


Well, currently we do all our development work in R, and use the 3rd party software to simulate and build the trading mechanisms. However their software is limiting and slow. The idea is to develop, simulate, and trade the strategies using a mixture of Python and R, while ONLY using the API from the 3rd party software to communicate with the exchange.


don't do it unless you do not need to worry about latency. for things you need to do a few times a second, python is ok. for things that need to be in a loop responding to market data, use java or .Net. For code that needs to be very high frequency with very little latency, use c or c++ with the addition of hardware accelerators like FPGA.


I haven't heard of that, but I'm sure lots of people would be interested in hearing about your experiences.


do you want to work via the FIX API or what is the idea behind? please get some more into detail what you are exactly planning. which brokers, which strategies, how many transactions,... do you want to trade with high-performance, within milliseconds?


using the API connectors from the third party software.. thanks. I know very little about Python connectors to specific APIs but trying to learn more. This is high frequency, so moving lots of quotes around, although not thousands, maybe hundreds in an hour.


although if you count ALL messages to the exchange, easily thousands an hour


FIX is actually a protocol


Some. What are you wondering?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: