Regular visitors will have noticed ever increasing amounts of spam on the Trading Gurus Community Forum. On November 24th 2012 we implemented some changes:

1. New users will be moderated 2. Registered users who have a post count of zero will not be able to view attachments or download code. 3. Registered users who have a post count of zero will not be able to create a new thread

As an additional countermeasure we anticipate introducing a modest paywall in the near future.

If this is your first visit here our apologies for the inconvenience.

Existing users may wish to contribute their ideas to this thread.

Results 1 to 10 of 10

Thread: The Pros and Cons of AlgoTrader

  1. #1
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    494

    The Pros and Cons of AlgoTrader

    AlgoTrader is a new open source trading platform built around the Esper complex event processing engine. No less an authority than Ernie Chan (author of Quantitative Trading) says it's worth taking a look at. I'm a member of the AlgoTrader development team, so by all means take my views with a large pinch of salt, but here's a few of my own initial bullet points:

    Pros

    1. It's written 100% in Java. If you're not a fan of Java this might be con #1 of course.
    2. It incorporates the latest version of Esper (currently 4.3) and actually makes use of some of Esper's power.
    3. Because of #2 it uses the GPL 2.0 open source licence. If you're a fan of LGPL this might be con #2 of course.

    Cons

    1. It currently has no GUI. If you're not a fan of unnecessary bloat this might be pro #1 of course.
    2. Currently you need to be fluent in both Java and Esper EPL to make best use of the platform. If you happen to be fluent in both languages this might be pro #2 of course.
    3. It currently only interfaces to Interactive Brokers for placing orders and acquiring market data. More will be available soon courtesy of FIX however.
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  2. #2
    Junior Member
    Join Date
    Sep 2011
    Posts
    3
    Jim

    I would like to add a few pros to the list:
    • AlgoTrader allows to run strategies in a fully automated and reliable server environment. Which means, that you don't have to start-up your computer in the morning and manually engage your strategies. Instead one or more strategies can be installed on a local server or even distributed server
    • AlgoTrader allows to Backtest strategies based on Historical Data using the same rules that can afterwards be used in live trading. Of course other systems do provide this as well, but if you have been working with things like MatLab or R, this will definitely be an advantage for you
    • CEP (and Esper) is indeed a very powerful technology that allows you to implement new types of strategies that otherwise would be very difficult (or even impossible) to implement. If you only want to compute a moving average, there are probably better solutions. But if your strategy involves rules like "during, between, afterwards, parallel with, finishes with, begins with..." you should take a look at CEP, Esper and of course AlgoTreader.
    • Besides using Java and Esper as Jim mentioned, AlgoTrader is built using the latest Java technologies available: Spring, Hibernate, Maven 2, etc.
    • In reference to above Con #2, the combination of Java and Esper is actually very powerful. The original idea behind AlgoTrader was to take advantage of both worlds (Esper & Java). The more procedural related code normally goes into Spring (and therefore Java) Services whereas Event related codes goes into Esper Statements. This combination of both allows a whole new spectrum of strategies and actually reduces the required number of lines-of-code.


    andy

  3. #3
    Junior Member
    Join Date
    Dec 2011
    Posts
    4

    Smile excellent stuff

    I've been spending weeks assessing trading frameworks and this looks like one of the best. That said,
    it's extraordinarily complicated for doing simple things. I realize Andy pointed out that for a simple
    crossover system there are easier solutions, but still... I can't really see doing quick prototyping of ideas
    in Algo Trader, when the same idea can be backtested in Tradestation or ami with a dozen lines of code.

    So with all due respect to Jim, I think a (web based?) GUI would be a wonderful addenda to allow a more rapid strategy development cycle. Or at least a scripting language which hides some of the complexity. OK, who needs another scripting language for trading, but in this case there is no vendor lock in and if the project sticks around the time spent learning a scripting language will be worth it. What I'm looking for most of all is a solid system I can run on a BSD box 24/7, upload strats to it, and just monitor my IB account to see what it's up to. Algo Trader sure looks like it's being built with platform-independent, enterprise level design and components.

    One other thing...and perhaps I misunderstand this, but in reading through the docs, it seems to me to be extraordinarily dangerous to have the framework switch from backtesting to live via a single boolean. This is another good reason for a web gui. It can be just one status page, perhaps with a big red button in it labeled PANIC. Press it and all trading stops, and all positions are closed - at least until such time as one can get in there with a vi editor.

    I'm also not sure it Algo Trader can handle DTN/IQFeed for ticks, whilst executing against IB? IB's symbol limits and their backfill issues associated with it have me leery of using only IB for data and automated execution.

  4. #4
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    494
    Hi Gapper,

    Welcome to the Trading Gurus community! If you're not the shy type, please feel free to introduce yourself over in the Introductions section of the forum.

    Quote Originally Posted by Gapper View Post
    So with all due respect to Jim, I think a (web based?) GUI would be a wonderful addenda to allow a more rapid strategy development cycle. Or at least a scripting language which hides some of the complexity. OK, who needs another scripting language for trading, but in this case there is no vendor lock in and if the project sticks around the time spent learning a scripting language will be worth it. What I'm looking for most of all is a solid system I can run on a BSD box 24/7, upload strats to it, and just monitor my IB account to see what it's up to. Algo Trader sure looks like it's being built with platform-independent, enterprise level design and components.
    I did a straw poll on LinkedIn about "scripting languages" and there was very little consensus I'm afraid. I guess something that utilises the JVM would make most sense. Any preference amongst JRuby/Groovy/Clojure?

    One other thing...and perhaps I misunderstand this, but in reading through the docs, it seems to me to be extraordinarily dangerous to have the framework switch from backtesting to live via a single boolean. This is another good reason for a web gui. It can be just one status page, perhaps with a big red button in it labeled PANIC. Press it and all trading stops, and all positions are closed - at least until such time as one can get in there with a vi editor.
    You can currently use JMX to keep things under control!

    I'm also not sure it Algo Trader can handle DTN/IQFeed for ticks, whilst executing against IB? IB's symbol limits and their backfill issues associated with it have me leery of using only IB for data and automated execution.
    AlgoTrader doesn't talk to DTN as yet, but by all means add that request to the AlgoTrader "wish list". You don't by any chance fancy coding that interface do you? I have used IB market data with execution at LMAX via FIX, so the sort of thing you're asking for is eminently feasible.

    Cheers,

    Jim
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  5. #5
    Junior Member
    Join Date
    Sep 2011
    Posts
    3
    Gapper

    Also, a few things I would like to point out

    Quote Originally Posted by Gapper View Post
    ...
    it's extraordinarily complicated for doing simple things. I realize Andy pointed out that for a simple
    crossover system there are easier solutions, but still... I can't really see doing quick prototyping of ideas in Algo Trader, when the same idea can be backtested in Tradestation or ami with a dozen lines of code.
    I disagree on this one, we use AlgoTrader very often to prototype a new strategy. Using Esper, a small prototype is usually not more than the mentioned dozen lines of code. Of course Live Strategies will normally be much more complicated, this is where you need AlgoTraders flexibility. If however your entire strategy is very simple you might as well do it in a different tool.

    What I'm looking for most of all is a solid system I can run on a BSD box 24/7, upload strats to it, and just monitor my IB account to see what it's up to. Algo Trader sure looks like it's being built with platform-independent, enterprise level design and components.
    Exactly, this is what AlgoTrader is built for. At our hedge fund we run AlgoTrader on Amazon EC2 cloud servers and monitor it using JMX (as Jim mentioned)

    One other thing...and perhaps I misunderstand this, but in reading through the docs, it seems to me to be extraordinarily dangerous to have the framework switch from backtesting to live via a single boolean.
    There is one boolean to turn simulation on or off but there is also different Starter-Classes in Live-Trading (MarketDataStarter.java compared to SimulationStarter.java). So you will not end up in Live-Trading just by accident.

    andy

  6. #6
    Junior Member
    Join Date
    Dec 2011
    Posts
    4
    @Jim, I'm not an authority on what makes a good scripting language, but I've found the vectorized approaches in products like Matlab and Amibroker to be an efficient way to express common trading concepts, at least for prototyping and research. But I don't think either of those is a suitable automated execution platform, despite the various addons which do allow them to be used as such with IB. OTOH I was reading in Max Dama's book that some guy at (I believe) Goldman Sachs told him the vectorized approach is a poor way to do things in this problem domain...so there you go. The key thing for me is to take my already-developed algorithms and make them fully automated in as little time as possible, and with the maximum of platform stability. As I lack EE Java coding skills, it's a bit of a challenge doing it with Algo Trader and scripting seems the gentle middle way, even if it doesn't fully expose the true power of the platform. Rather than fully solving the question of what is a good scripting syntax, perhaps there could be a simple grammar which can do only the basics (buy & sell @market, compute things with the TA-lib library). Just enough that one doesn't need to get into Java coding to adapt a basic strat. For more complicated semantics such as what Andy is referring to, use the full-fledged Java/Esper approach. @Andy, I currently use Matlab and sometimes Amibroker for idea development, but I do always try to simplify the strategy. This often involves optimization, so I'm interested to hear how the optimization engine performs in Algo Trader. Is it distributed? Does it use CMA-ES? I was ready to pull the trigger on SmartQuant but the reports of crashes in their support forums scotched that idea, and in any event I would prefer to use an open source platform even if it involves a steeper learning curve. @ Jim, I'm not a coder but I hope to wrap my head around the complexity of Enterprise Java and then perhaps contribute. If I can figure out how to run my key strats on AT, I'll stick around.

  7. #7
    Junior Member
    Join Date
    Dec 2011
    Posts
    4

    the devil is in the details...

    I've spent a good part of my weekend trying to get AlgoTrader to do something useful, without success. Granted that I've stayed away from Java since I was forced to endure it in undergrad, but I can see some of the nonsense which was Java then is still the nonsense which is Java today, although thankfully Sun and its attitude have gone the way of the Dodo. 10 years later and the raison d'etre of all these Java frameworks is still supposedly the simplification of EE Java's complexity. Meanwhile Microsoft came along and made a fortune doing just that, and even threw in cross-platform.

    Anyway, for good measure, and after the checkout of AlgoTrader failed to build in Eclipse/Maven, I tried building in IntelliJ, which actually did somewhat better at the job, but still failed. The database part is fine (I ran that against mysql on one of my bsd boxes) but the main app just won't cooperate and barfs in the maven install. Undoubtedly a professional programmer would have fared better, and programming isn't what I did in grad school. Which is pretty much my point. This re-enforces my earlier impression that AlgoTrader is probably good if you're an enterprise Java programmer and see the world that way. If Java EE is your hammer, every trading problem boils down to a nail it can pound, and all the more power to you. If you're not, you have to decide if your time is better spent developing strategy, or finding the meaning of obscure java errors. Hopefully your trading pays enough to rent a coder for this, but in that case there are commercial apps which do what AlgoTrader does and have pro coders supporting them. /rant mode off/

    With all due respect to Andy and Jim, I also stick to my original contention that there are easier ways, at least syntactically, to model the semantics of trading. Whilst Java is not assembler, it's a general purpose language and there is an impedance mismatch in adapting its grammar to trading. For example, a crossover system complete with stops in one popular app's syntax is thus:

    Buy = Cross( MACD( 12, 26 ), Signal( 12, 26, sigavg ) );
    Sell = Cross( Signal( 12, 26, sigavg ), MACD( 12, 26 ) );
    ApplyStop(stopTypeTrailing, stopModePoint, 3*ATR(14), True, True );

    It really doesn't need any explaining, does it? And it doesn't even need 12 lines. Compare that with the machinery in AlgoTrader, both from a simulation/rapid strat development point of view, and from a comprehension POV. And the more complex the syntax, the more likely one is to mess something up, which in this business is not a good business. The concept of AlgoTrader is elegant and simple enough to understand, and I like its use of Esper and event-driven logic. The devil is in the details. With AlgoTrader you need to read pages of documentation just to build it (maybe), download & learn half a dozen apps & understand UML before you can design a strat, understand how to build enterprise Java projects, understand various Java frameworks (the jury is out on how well they'll do their jobs), have a working knowledge of Esper syntax and database administration, and that's all before you can even test the three liner crossover toy system example above. I don't care about not having a GUI, but it ought to be as simple as downloading a prebuilt Java exe and feeding it a text file with a scripting language.

    None of this is a criticism of Andy and Jim's fine efforts, or of the project. I will keep plugging away at AT in my spare time as it's conceptually interesting. The thread solicited opinions on this app, and these are strictly my own.

  8. #8
    Administrator Jim's Avatar
    Join Date
    Apr 2010
    Location
    South West England
    Posts
    494
    Hi Gapper,

    Quote Originally Posted by Gapper View Post
    I've spent a good part of my weekend trying to get AlgoTrader to do something useful, without success.
    Thanks for your feedback.

    I am a coder with over 40 years experience. I don't need to hire anyone! Please bear in mind that AlgoTrader is not a commercial project, and is provided for the benefit of the open-source community by the voluntary efforts of experienced programmers from around the world. If you need some support from that team please post a request detailing the nature of your problems on the AlgoTrader Google group, where someone will be along to assist you fairly quickly. Response times are typically longer at weekends however!

    Cheers,

    Jim
    Reality is merely an illusion, albeit a very persistent one - Albert Einstein

  9. #9
    Junior Member
    Join Date
    Sep 2011
    Posts
    3
    Gapper

    Yes, you do need some knowledge on Java, Enterprise Java, Eclipse and Databases to work with AlgoTrader (as pointed out in http://code.google.com/p/algo-trader...n#Introduction). It might be difficult to learn Java on this projects. On the other hand, if you are familiar with these technologies, AlgoTrader gives all the flexibility you need to develop advanced trading strategies.

    Again, for simple strategies, like the one you mentioned, you are better of with something else. We are not trying to compete with tools like Tradestation and NinjaTrader

    Also, we are currently not aware of any built problems in Eclipse if strictly following the documentation.

    Andy

  10. #10
    Junior Member
    Join Date
    Dec 2011
    Posts
    4
    Jim, Andy, I thank you for your efforts on Algo Trader. The trading community can surely benefit from this project.

    @Andy: the trivial crossover system example above is actually Amibroker syntax (which also has the ability to autotrade using this syntax) and I include it only to illustrate how many fewer LOCs are needed to do the equivalent of Algo Trader's simple crossover example. Of course there is nothing preventing Algo Trader from matching this syntactic compactness if you fellows can design a trade-centric AT script syntax. @Jim: That's why I'd not suggest JRuby/Groovy/Clojure, or any general purpose computer language, since they are not trading-concept aware and thereby are less compact for expressing common trading notions like buy, sell, setlongstop, setshortstop, setpositionsize, settradinginstrument, onFillDo, checkFillSize etc. You can have a simple if incomplete scripting language which can be fed to a prebuild binary for those of us who just want to transition to Algo Trader but lack programming skills, with the understanding that if the full power of the platform is desired, you need to get heavily into Java coding.

    See you in the AT support fora and best wishes!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •