I don't think the comparison with a hypothetical reality TV show is very meaningful.
402 karma · joined May 16, 2014
I don't think the comparison with a hypothetical reality TV show is very meaningful.
I mean, I guess you could do that in C++ instead. But why would you bother if C is good enough (and it typically is for most numerical algorithms).
I'm sure that a large proportion of derivative trades are still done over the phone, but that's because they tend to be (a) quite customizable and (b) quite hard to price.
It is incredible that treasuries are still traded over the phone, however, given how (relatively) easy they are to price. Even treasury futures, which are harder to price due to the basis and optionality, are mostly traded electronically, which tells me that there must be some parties with a pretty strong interest in keeping bond trading a "closed shop".
There is no possibility to "back away when a matching order comes in" because the first time you find out about the matching order is when you are informed about the trade that you just did!
What can happen is that a market maker will post liquidity on multiple exchanges A, B and C, and will remove their orders from exchanges B and C if they are filled on exchange A (assuming they are fast enough to do it!)
This is not shady or nefarious. In fact, it is the only way that a distributed market could possibly work.
The market maker has some finite capacity to provide liquidity (e.g. they have position limits, they need to post margin, they have certain risk tolerances). They want to maximise the chances of their orders being traded on (i.e. providing liquidity), so they post liquidity on all available markets.
When they match on one of those markets, their capacity to provide liquidity has diminished, until they manage to offset their position somewhere (either on the same market, or on a different one). Moreover, they have just received a new piece of information about the supply/demand imbalance for this particular stock. For both of these reasons, it is natural to assume that they would want to adjust the prices they are offering on other exchanges. The market cannot function any other way.
data Root
= RootPosix
| RootWindowsVolume Char
| RootWindowsCurrentVolume
data FilePath = FilePath
{ pathRoot :: Maybe Root
, pathDirectories :: [String]
, pathBasename :: Maybe String
, pathExtensions :: [String]
}If not, how much would you put at risk for the chance to win $1 if he is convicted?
If you are trying to learn about electronic / high frequency trading by reading "Flash Boys" you are actively working against yourself. You will literally be more incorrect after you have read this book.
One proviso is that I've never worked on US equity markets, so if this rule is in place there then I wouldn't know about it.
The cheeseburger market is rigged.
An incredible achievement if so!
Market state -> price forecast
Price forecast + other factors (risk, liquidity) -> trading decision
If you know (or have a good guess) how the algorithm works, you can work out what state of the market would lead to a price forecast in your favour, i.e. would lead to the algorithm offering liquidity at a price favourable to you.You then manipulate the state of the market to look like that (generally this is "spoofing" or "layering"), wait for the algorithm to respond, and then take advantage of the favourable liquidity it offers.
When people calibrate their algorithms, they use real market data. Most of the time, someone isn't actively manipulating the market, so the model is not calibrated to handle those situations.
I don't think programmers in the field have an appreciably shorter lifespan than in other industries. I don't think that working in an algo trading company is intrinsically any riskier than working in any other kind of firm.
The hours tend to be longer and the work tends to be slightly more stressful than if you are working at a generic bigco, however.
It also allows an endless pissing contest of comparing new brainteasers among your colleagues, and telling stories of helpless candidates who couldn't even manage the first gasp of a hint of an idea towards the solution.
I tend not to like extremely complex brainteasers as interview questions, and especially not ones that require an "aha" moment to solve them correctly, because mostly what you're testing for is whether the candidate has seen that question before (or one like it).
On the other hand, I am a big fan of asking relatively easy math questions (i.e. first year undergraduate) in interviews, because if I'm going to be paying someone $100k+ to work on mathematical models, I'm damn well going to make sure that they understand basic probability, statistics, calculus and linear algebra. These are a bit like fizz-buzz for quants - if the candidate can answer them it doesn't prove anything, but if they can't answer them then you can stop the interview right there.
Self-doubt is a quantity often found wanting among smart people, computer programmers, and especially among the intersection ;)
But a list is much more than that - conceptually it's any ordered collection of things, and not necessarily even the same type of thing. Overloading `+` to mean concatenation and `*` to mean replication means that the operators can work with any kind of list, not just lists that are mathematical vectors.
If you do want a mathematical vector, you should use a numpy array - not only are you making it clear that you have a vector of numbers, but your operations will be more efficient (because using a numpy array guarantees that the elements in it are all of the same type, so you don't have to do type dispatching on every element).
In the second case, you now know that you are not in one of the states of the world where the host accidentally opened a door that had a car behind it. They could have opened a door with a car, but they didn't. That gives you some information - it stands to reason that since they didn't open a door with a car, it was probably a bit more likely that they would pick a door with a goat, which makes it more likely that there are two goats than that there is one car and one goat, which is equivalent to saying that it's a bit more likely that you have already chosen the car.
> There are two doors with goats and one with a car. You choose one door from the three. The host selects one of the doors with a goat from the remaining two doors, and opens it. Should you switch doors if given the chance?
has a different answer than this one
> There are two doors with goats and one with a car. You choose one door from the three. The host chooses one of the remaining two doors at random and opens it, showing a goat. Should you switch doors if given the chance?
In the first example the hosts choice is either forced (if you chose a goat initially) or doesn't make a difference (if you chose a car).
In the second example, the host could have opened a door with a car because he was choosing the doors at random. Given that he didn't, your estimate of the probability that you have chosen the car should increase - in fact, it should increase to 1/2, and switching doesn't make any difference.
To me, this is the really interesting thing about the Monty Hall problem - the knowledge and intentions of the host are important in the correct solution to the problem! So there are two ways to come up with the answer "it doesn't matter if you switch" -
1. You understand the problem in the first sense above, and your intuition leads you to an incorrect answer.
2. You understand the problem in the second sense above, and you are correct that it doesn't matter whether you switch or not.
Um..?
> Though the idea of a street grid seems perfectly ordinary to city-dwellers today, it was unusual at the time. Most great cities in Mesopotamia, for example, had curving streets and a more organic-looking layout.
Maybe a street grid seems ordinary if you live in a large city in the US, but most European cities don't have gridded streets (and I don't think it's the norm in many other places in the world either).
w[t+1] = w[t] + (c[t] - alpha * w[t] - beta * d[t] * w[t]) / 3500
and assuming c, d are both constant (i.e. assume they are your long-run average of calories consumed and exercise done) you can solve to get w[t] = c / (alpha + beta * d) + const * (phi ** t)
where phi is a number smaller than 1, and const is some constant that depends on your initial weight. Over time, the phi t term decays away, and you are left with your long-term stable weight, w = c / (alpha + beta * d)
Using c = 2000, alpha = 12.5, beta = 0.63 and d = 0 you get a long-run stable weight of w = 2000 / 12.5 = 160 lb
On the other hand, if you eat 2500 calories per day but run five miles, you get w = 2500 / (12.5 + 0.63 * 5) = 160 lb
so if you want to eat an extra 500 calories per day, you should run 5 miles per day.It'd be interesting to see how accurate this is.
(1 + 4 * 10) * 8 = 328 bytes
per tick, so 1KB isn't far off. Obviously not every level changes on every tick, so there are opportunities for compression, that can be significant.Note that the "tick data" from histdata.com gives you prices sampled every 1 second (so not every tick) for the top level of the order book, and doesn't give you any size information at all.
fizzbuzz x = case (x `mod` 3, x `mod` 5) of
(0, 0) -> "FizzBuzz"
(0, _) -> "Fizz"
(_, 0) -> "Buzz"
_ -> show i
mapM_ (putStrLn . fizzbuzz) [1..100]The reality is that most of these patterns fall into one of the following categories -
(a) Test patterns (e.g. checking that your orders are appearing in the market data) which are normally done at times of very low liquidity.
(b) Software bugs (this is probably the vast majority). This might not be a "bug" as such, but an edge case of an algorithm that nobody has thought much about before. Writing robust order placement algorithms is surprisingly difficult.
(c) Positive feedback loops, where you detect and react to your own orders in the market data.
(d) Unanticipated interactions between two or more algorithms.
Of these, (a) is mostly benign, (b) and (c) can be actively harmful, and (d) can go either way. None of them are generally beneficial.
Real market manipulation doesn't look "weird" like this because people doing it are taking care to make it look like they're not manipulating the market. For example, they might spoof with a large order quite deep in the book (which wouldn't change the best bid and offer at all) or layer orders at multiple levels.
It's actually quite difficult to spot this kind of behaviour in market data, even if you spend your whole day watching algorithms trading.
On the other hand, it's easy to spot unusual-looking activity in categories (a)-(d) above, which is why Nanex is full of that kind of chart.