SERVING THE QUANTITATIVE FINANCE COMMUNITY

 
User avatar
JinhuaColin
Topic Author
Posts: 33
Joined: May 30th, 2013, 4:33 pm

how is HFT possible

September 21st, 2017, 11:38 pm

Hi guys, i was working on a small automated trading project myself and this crazy question popped up in my head. How do people achieve a millisecond trading strategy?  A C++ program takes 0.2s even i only program it to initialize a class object and run a 100-cycle for loop. i guess most trading strategies have a optimization process leaving alone those more complex machine learning strategies; also some strategies need to handle hundreds of stocks. Is it really true a program can finish all this within milliseconds, or is "millisecond" just a saying?  i understand there are more advanced tools/techniques out there like GUP computing, parallel computing and distributed computing etc which can greatly reduce the computation time. But it is still difficult for me to believe this millisecond run time. Appreciate your help!
 
User avatar
Alan
Posts: 9123
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Re: how is HFT possible

September 22nd, 2017, 5:33 am

Not my area, but it is hardware-based acceleration, pushing the trading logic to the network card with FPGA's -- for example see here for a circa 2012 discussion, probably with quite outdated timings by now. An excerpt:

For these products, precise latency figures are application dependent and difficult to obtain. However, Accelize claims their smart NICs can turn around financial trades on the FPGA in under 2µs. This is significantly lower than the minimum latency achievable with software, as discussed earlier.
 
User avatar
Billy7
Posts: 254
Joined: March 30th, 2016, 2:12 pm

Re: how is HFT possible

September 22nd, 2017, 10:57 am

Apart from the specialized hardware technologies/architectures such as the one Alan mentioned (which I was not aware of), even on the software side the initial premise for your disbelief (" A C++ program takes 0.2s even i only program it to initialize a class object and run a 100-cycle for loop") is false. Maybe when something starts and has to load a few things into memory it can take 0.2 secs, or maybe you're just starting the debugger? But as soon as the application is up and running, what you mention can be done in less than a microsecond (though you don't specify what every cycle loop does, but I'm assuming you're not talking about simulations of the universe!) 
 
User avatar
LocalVolatility
Posts: 124
Joined: May 27th, 2009, 10:07 am
Location: Amsterdam
Contact:

Re: how is HFT possible

October 9th, 2017, 9:53 am

ABOUT WILMOTT

PW by JB

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...


JOBS BOARD

JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...