<p>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.</p>

CC BY-SA 3.0
2011-09-16T23:47:29.360Z
Thanks. All that talk about "renting the closest apartment to Wall-Street because of 10ms" got me thinking a lot about performance.
nmat
CC BY-SA 3.0
2011-09-17T00:22:43.287Z
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
CC BY-SA 3.0
2011-09-16T23:38:54.887Z
2011-09-16T23:38:54.887Z
Brian Carlton
<p>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.</p>

CC BY-SA 3.0
2011-09-14T03:24:46.577Z
2011-09-14T03:24:46.577Z
David Schwartz
<p>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</p>

<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.</p>

CC BY-SA 3.0
2011-09-14T17:12:08.800Z
2011-09-14T17:12:08.800Z
Evil Spork
<p>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.</p>

<p>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.</p>

CC BY-SA 3.0
2011-09-14T16:17:39.187Z
2011-09-14T16:17:39.187Z
Jez
<p>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.</p>

<p>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?</p>

CC BY-SA 3.0
2011-09-15T22:19:07.427Z
This is just a general programming question.  It belongs on Stack Overflow, not here.
xyz
CC BY-SA 3.0
2011-09-15T22:46:30.257Z
@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
CC BY-SA 3.0
2011-09-16T02:26:02.347Z
Then it's a question about websockets.  Still a programming question.
xyz
CC BY-SA 3.0
2011-09-16T15:43:41.783Z
Specifically, the reason it's off-topic is that this question could apply to any type of trading bot, Bitcoin or not.
eMansipater
<exchanges><trading>
Is performance really important when choosing a language for a trading bot?
nmat
# Is performance really important when choosing a language for a trading bot?

(Asked by: username_0 on 2011-09-14)

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?

**Tags:** exchanges, trading

> **Comments:**
> **username_1**: This is just a general programming question.  It belongs on Stack Overflow, not here.  
> **username_0**: @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...".  
> **username_1**: Then it's a question about websockets.  Still a programming question.  
> **username_2**: Specifically, the reason it's off-topic is that this question could apply to any type of trading bot, Bitcoin or not.  

---

## 4 answers

### Answer by username_3 on 2011-09-16. Score: 2 | Accepted answer

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.

> **Comments:**
> **username_0**: Thanks. All that talk about "renting the closest apartment to Wall-Street because of 10ms" got me thinking a lot about performance.  
> **username_4**: 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  

---

### Answer by username_5 on 2011-09-14. Score: 7

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.


---

### Answer by username_6 on 2011-09-14. Score: 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.


---

### Answer by username_7 on 2011-09-14. Score: 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.


---

