Thanks for posting a very top level view of automated trading for engineers.<p>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.<p>Proceed at your own risk of time and money.
I'm just going to leave this here.<p>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."<p>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.<p>Here are a few notes from my time in FX:<p>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.<p>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.<p>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 ;).<p>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."<p>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.<p>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.<p>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.
Very neat story. Thanks for writing it up. The nuts and bolts of this kind of operation are fascinating. I know a lot of people out there have trading ideas, but don't really know how to implement them.<p>If you just finished the post and you want to try coding up a trading algorithm for free, check out <a href="http://www.quantopian.com" rel="nofollow">http://www.quantopian.com</a>. It uses Python, not MQL, and provides free data and backtesting. (Yes, I work at Quantopian)
I posted this on topal too, but I want to get your opinions also:<p>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.<p>I always thought that algo trading would be a good fit for channel strategies since the strategy is recursive in nature.<p>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.<p>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.
I have taken different approach. I decided that the best way is to train by own brain how to trade. Basically my approach was to trade as much as possible and have results, without waiting for the market to let me know how I was doing.
So I wrote my own program called turtrades (test your trades). It basically presentments you with random stock in random past date and lets you trade or pass. Doing this I am using real historical market data and train my brain to spot winning patters and I get instant result.
For those interested you can find it here <a href="http://www.turtrades.com" rel="nofollow">http://www.turtrades.com</a><p>Yes it is as selfish plug but program is free and I have nothing to gain.
I think there was a Bloomberg article at the front page of HN a few weeks ago talking about how algorithmic trading was producing less and less profits - can't find the source/link right now.<p>Is that still true? Or is algorithmic trading on a rebound?
Thanks for the comments!, this is just the tip of a huge iceberg down the water... As you'll see the logic is very basic, and the system is rather blind; but the main idea was to post this simple example because I noticed how unknown is this subject among programmers.
From this point forward, the imagination is the limit when talking about trading systems creation.