4 ms·
Ask HN: Python as a Trading Platform
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.
- Sambdala 14y agoI haven't heard of that, but I'm sure lots of people would be interested in hearing about your experiences.
- haliax 14y agoCan 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.
- mrkmcknz 14y agoWhat setup do you use for this? I'm quite interested in testing some trading strategies with Python.
- haliax 14y agoI 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.
- true_religion 14y agoYahoo finance data is notoriously inaccurate, and that may invalidate many strategies based on it.
- washedup 14y agoWell, 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.
- wusatiuk 14y agodo 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?
- elb0w 14y agoFIX is actually a protocol
- washedup 14y agousing 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.
- washedup 14y agoalthough if you count ALL messages to the exchange, easily thousands an hour
- MrMan 14y agodon'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.
- kolbe 14y agoSome. What are you wondering?