Is performance really important when choosing a language for a trading bot?

0

The C programming language outperforms interpreted languages such as Python or Ruby, but when it comes down to programming productivity, it is much easier/faster to write a Python program than a C program.

Considering that I want to write a trading bot, what would be the most appropriate language? If I use C, will I see a noticeable performance difference, or would the latency from HTTP calls make my decision time irrelevant?

nmat

Posted 2011-09-14T03:20:01.000

Reputation: 10 879

Question was closed 2011-09-19T17:25:15.293

3This is just a general programming question. It belongs on Stack Overflow, not here.Chris Acheson 2011-09-15T22:19:07.427

@Chris Acheson Maybe. But for example, MtGox has websockets which reduces latency a lot I think... I have no idea how other forex/stock exchanges work. If I went to stackoverflow I would have to write: "considering that I want to use the API from Bitcoin's exchanges...".nmat 2011-09-15T22:46:30.257

1Then it's a question about websockets. Still a programming question.Chris Acheson 2011-09-16T02:26:02.347

1Specifically, the reason it's off-topic is that this question could apply to any type of trading bot, Bitcoin or not.eMansipater 2011-09-16T15:43:41.783

Answers

2

No. The trades in Bitcoins just aren't that frequent. That is relevant to HFT in stocks, where there are many thousands of trades per second.

Brian Carlton

Posted 2011-09-14T03:20:01.000

Reputation: 240

1Thanks. All that talk about "renting the closest apartment to Wall-Street because of 10ms" got me thinking a lot about performance.nmat 2011-09-16T23:47:29.360

that is because you are literally banking on those extra ms to be able to arbitrage extremely tiny opportunities. (Same as those platforms between the US and UK.) http://www.cityam.com/wealth-management/the-optimal-locations-hft-systems

lemonginger 2011-09-17T00:22:43.287

8

The latency for gathering information and executing decisions will swamp the performance difference between languages. That assumes you don't write horribly awful code, but you can do that in any language. You should use whatever language you are most proficient in or whichever one you find easiest for the task.

David Schwartz

Posted 2011-09-14T03:20:01.000

Reputation: 46 931

0

If you want to base your work on the original client, you might find it easier to use C++, since that was the original client's sourcecode language. However, the performance difference is negligible for different languages (especially when you take into account network latency as a speed-limiting factor), so you'll probably want to use the language you're most comfortable with for a trading bot.

Where you might want to consider performance a little more is if you're writing a program to mine Bitcoins. In that instance, you may be able to get a C/C++ program (or even assembly) to perform a little better than an interpreted language.

Jez

Posted 2011-09-14T03:20:01.000

Reputation: 919

0

Performance of the language isn't the most important factor in such a chunk of code. Room for error is the biggest I think. C if you are very good at writing C, then do it in C. Python elsewise simply because its harder to write crashing buggy code. Oh and PHP if you want a language that rewards you for writing sloppy code. :P

Also python integrates with C libs fairly easily, so you could always write your efficient pieces in C, then import their functionality in to python.

Evil Spork

Posted 2011-09-14T03:20:01.000

Reputation: 491