62 points · by bbeneschott · 13y ago · 41 comments
In case discussion goes cynical here, I can attest to the fact that this sort of thing can be done consistently and successfully for thousands of trades over months' time. These days though with HFT and "intelligent routing" your broker is your opponent in the equities world at least. When conditions become unfavorable to an algorithm things tend to fizzle out rather than wipe you out as long as you're not leveraged to the hilt. The point about optimizing is key: the best algorithm has the minimum number of parameters to tweak otherwise you're just curve-fitting. Whether you add value to the world is anyone's opinion.
Proceed at your own risk of time and money.
Then you know that forex is a bank driven market; these little "statistical arbitrages" (which should be a 4 letter word) are subject to scale. When they break, they drain you dry. The "street" is littered with failed FX traders. It is the crack rock of the consumer level game because you can muster such phenomenal leverage (it isn't regulated nearly as much as equities).
At the bank level, they can see who the counter party is and they track their interactions with you. If you milk them too much, they will block you and your trade is dead. I can attest to that.
What is worse is the consumer-level brokers are essentially running a game against you.
Caveat Trado
Even in equities, your brokerage is not your friend: if you place a limit order, there's nothing to stop them from placing the same order just a bit closer to the market and using you as their free stop loss.
If they are taking the other side of your trade and the market doesn't reflect that, they've actually given you a free roll.
As you see then, you may automate trading itself, but then your discretion is shifted from deciding what stock to buy or sell short to when to turn on or off an algorithm. The advantage I suppose is that an algorithm isn't necessarily directly tied to market direction.
I worked at a FX broker as a software engineer. When nerds first read about this stuff we all have the same knee-jerk reaction: "I write code. I'm smart. I could build a robot trader and make a Walter White pile of cash."
In short, I would recommend you stay the hell away from FX. It's bullshit. It's not like the any type of trading (algorithmic, quantative, manual, good luck charm) you see in stockes. I do thank the blog author for mentioning that his system never seemed to work long term. That's the key element most people can't accept.
Here are a few notes from my time in FX:
FX is traded on margin, and it's easy to lose all your money. Nearly every single person will lose all their money in FX, and those who claim success are riding a temporary wave. Even "experts" in the field can't hold big gains much more than a few weeks or months at best.
A few years back our company bought a trading system we'd been marketing like crazy and had customers buy into. Senior management decided to invest a 6-figure sum in this system with the intent of using the profits for employee bonuses. The day it crashed, not only did we have angry customers but our employees were pretty depressed.
FX trading systems are hype. Always. You'll hear the term "holy grail" in reference to trading strategies. That should be enough to keep you away. The real money is made by selling systems to idiots and writing books about it. As a matter of fact, you'll notice a lot of forums and blogs have referral links to brokers ;).
A common sentiment I heard tossed around traders and employees goes something like, "rather than trade FX, just go to Vegas and play roulette. At least you get free beers."
The technology is god-awful. You'd be blown away if you saw how shit-tacular the backend is that handles your money. I thought it was just the place I worked, but nope.
The company I worked for is very open and compliant, which I found admirable. This has continued to be their focus, so that's cool. Many brokers are corrupt, particularly if they're not in the US. Brokers have been caught increasing margins against traders, stop-gapping trades and worse. In the US the NFA is insane so they do a decent job of regulating, but it seems every year or so they nab a broker on something. Most NFA fines range in the millions so we took this seriously.
I have more war stories, but that's enough. Best advice: do not trade FX. I realize that may rile some of you, so be it. I wouldn't put my money near that shit.
The FX market is a zero sum game and due to that its' incredibly cutthroat.
If you just finished the post and you want to try coding up a trading algorithm for free, check out http://www.quantopian.com. It uses Python, not MQL, and provides free data and backtesting. (Yes, I work at Quantopian)
I studied a bit of market theory in college and learned about channel trading. The Efficient Market Hypothesis is just that - a "Hypothesis" - not a law. Plenty of academics have argued against it but they don't teach this in undergrad courses so as not to confuse students (this is seriously the answer I was given when I asked my teachers). Some people like Nassim Taleb are calling for a BAN on teaching entry level finance courses to MBAs who go out and gamble vast amounts of money based on incorrect theories.
I always thought that algo trading would be a good fit for channel strategies since the strategy is recursive in nature.
Does anyone have any pointers on how to implement channel type of strategies (as opposed to Moving Average strategies)? I'd be willing to chat about deeper into this topic.
FYI: Some (old) research shows that Exponential MA strategies make more and even out perform buy and hold strategies without taking into account tax advantages. If you have ever read a "Random Walk Down Wall Street" and don't believe in this "crap," it's actually in the footnotes of the sources the author cites.
What I found in my research is that the statistical analysis being done on markets is an approximation of the underlying phenomena. Yes - central tendencies and dispersion work 90% of the time, but they hugely under price tail events. This is the basis of Nassim Taleb's trading strategy.
What I see really happening is a recursive channel pattern at different time scales. As the recursion plays out it "zooms in" on the correct price of a security and the central tendencies and dispersion can be analyzed through traditional statistics. However, when a market correction takes place it "zooms out" by stepping back through previous market cycles and then statistical models break down. It's very weird to explain. Essentially, I see the market being a predictable Fractal pattern. Check out Mandelbrot's work on Finance to get some insight. I just disagree with his (and Nassim's) conclusion that these can't be predicted.
I've always been interested in trying to back test my theory but I didn't have the technical chops and didn't know where to start looking.
Thanks for your thoughts.
Yes it is as selfish plug but program is free and I have nothing to gain.
Is that still true? Or is algorithmic trading on a rebound?
High frequency trading typically refers to two concepts. 1) how long you hold your position, 2) how quickly you can send/cancel existing orders. Though I'll hedge and say there isn't a really accepted definition of high frequency.
Algo trading on the other hand refers to using a computer to automate trading strategies. The typical example is a pair trade with Ford and GM. When they deviate you sell one and buy the other, when the prices come back together you reverse the trade and sell the first leg and buy the second.
Algo trading is here to stay. High frequency has typically been more arbitrage focused and its followed the pattern that happens to all arbitrage opportunities and gone away as more people got in on the action.
There are algorithmic trading strategies that are high frequency, but not low latency for instance. Or low latency strategies that are not high frequency.
In my experience what people are talking about when they say that high frequency algorithms are producing less profits, what they really mean is that low latency arbitrage algorithms are not making as much profit.
Lots of high frequency algorithms remain profitable.