Discussion in 'Automated Trading' started by paulbechard, Oct 4, 2006.

  1. Hey guys.

    I am a newly graduated computer science / math student, specifically focusing on artificial intelligence, machine learning and high speed computation. Rather than continuing my career in industry I decided to take a year or two to see if I could create a black box AI system which runs 24/7 and automatically detects / trades on stat arbs on all possible tickers coming out of whichever brokers it is connected to. Other than micro econ 101 I have no background in finance, so I am learning as I go, I am a quick study but learning all the intricacies is taking me a few months. So rather than continue my pattern of trail, profit, error, Iv decided to try reaching out the online community to see what you guys think and if you have any wisdom, hints, suggestions or offers.

    To date I’ve yet to create a steady stream of profit to cover living expenses, thus I am still living off the generosity of family. I have good risk management (hedging etc), so that on any given trade the maximum amount of money I can possibility lose is just a few hundred, so my trading capital is secure.

    So this is how its gone so far over that past few months. Iv broken even with the amount of good trades / bad trades doing this research overall. At best it was producing XXX% profit daily on used capital (on small test amounts), at worst it was bleeding money. The total volume the system has trade has is several million USD over the test period (I test with the smallest possible lot sizes also). There has been three basic things that seems to happen with each new arb idea I implement. Either

    1) It works on paper trading accounts and doesn’t perform the same on live accounts.

    2) It works on the live accounts but the brokerage shuts down the account after a week of trading due to 'off market' trading. (Yeah I sense something fishy going on too)

    3) It works on both paper and live, but the slippage on the live trades seems to lead to a loss in the long run. Ie. a bunch of good small trades. a few huge losses though.

    I’ve boiled it down that for good automated arb you need two things. The first is small costs, which means small spreads and commissions. The smaller the cost the more opportunities the AI can take advantage of. Second is the amount of slippage, this seems to be the make or break factor for the arb ideas I’ve tried. Execution speed and market volatility seems to be the biggest factors. I can see how big institutions have a much easier time of doing this than retail API traders, since they most likely have the best costs and the fastest execution times (makes me consider just getting a job doing this for a large institution).

    I have started looking at different brokerages and different levels on the exchanges (not that id be able to afford most of those options) to try to reduce trade costs. For execution speed I am planning on trying to run the box on a fiber optic connection in my city to reduce latency times, even though some of the brokers I use seem to have high latency to the markets (miliseconds make a world of difference apparently). As for slippage I have started playing around with a few ideas using limit orders and broker based conditional orders. So far iv been testing with purely market orders, which occationally lead to some really bad fill prices. The problem is that with most stat arb strats I use, its essential that all my orders get filled or none. On a single exchange this might be possible but some of the stat arb strats the AI system has created invokes multiple equities on different exchanges / brokers.

    I am hoping that anyone with some experience doing stuff like this, either automated or by hand could help me solve some of these problems. Even someone with general trading experience might be able to help me decide which brokers I should try trading on, maybe even trying to place black boxes on-site at the exchanges. I really need to figure out the best way to deal with slippage too, so if anyone knows any ideas, like combination of order types I can do to minimize slippage or maybe even analyze market conditions to prevent trading at times of high possible slippage would make my day. Any publicly known arb strats that I could research would be helpful also, I don’t expect anyone to give away their golden goose though (I have yet to look at option arbs).

    Feel free to reply and let me know what you think of the career path I am trying and if I should just get a real job.

    Thanks to everybody who took the time to read all of this.
  2. man


    i would think that IB are the cheapest for small
    i think "nitro" once had lengthy discussions of
    the ideal setup for speedy access.
    i for myself work on five minute data as my lowest
    time frame, so not much of help from my side.

    you sound good. you'll make it.
  3. Thanks for you're reply. 5min data is a bit different than what my ai trades on right now, usually its in and out of a position in under a second.

    I currently have an account on IB but I get a lot of slippage with market orders sometimes. Im hoping some combination of limit orders would get me a guarenteed fill with less slippage. I was thinking placing two limit orders far enough away from the current price that either both fill, or it less costly to let one fill, cancel the other and close out the other position at market. or cancel both if the opportunity is missed.
  4. Chabah


    If the system really works but then gets shut down by the broker, I think your problem is this "off market" thing. Now I don't know if your system is continually stepping in front of market makers or whatever, but the brokerage should be able to explain why it was shut down. If it is a matter of not pummeling a certain strategy, maybe you can build that in. Narrowing your range, as long as you aren't cutting out too many winners, could be a worthwhile change.

    As for the times your system runs about even, can you analyze which setups win and which ones don't? I know it sounds obvious but maybe the bottom 10% of trades have something in common that you could use as a filter to skip the trade. You don't (and can't) have to eliminate all the bad trades, as removing even a fairly small percent of them could move your result curve to just above zero.

    Similarly, if your best trades have something in common (e.g. tight stop loss, fewer involved positions, etc) you could focus on them. It is impossible to have a huge percent of winners but again if you can increase position size on high confidence trades, it would be like increasing your black jack bet when the deck is in your favor - a smart bet (btu not guaranteed).

    One other piece of analysis to perform is to take your trades as placed and then scale them up using a spreadsheet as if you had used a larger account size. This will make the commission less of a factor and may reveal a winning system if only you trade big enough. While that alone is not reason to suddenly start trading large, it is valuable information.

    Enjoy and please report back with your findings.

  5. Chabah, I am assuming that the strat kept stepping infront of the market makers. I am unsure why they would want to stop those trades though, since the brokerage first tries to fill against thier other users (which I was told fills 80% of the time). So I assume most of the trades found limits or stops to fill against, I dont know why the broker would'nt want that since they get commissions anyways.
  6. squeeze


    Most true arb is extremely competitive and you will almost certainly not succeed using standard retail brokerage over the internet.

    If you are serious then find a broker that offers server hosting and negotiate hard on comissions.

    For example
  7. I'm curious why you chose stat arb over other quantitative strategies. Is this solely for personal research/challenge or is there a business model behind it?

    I look forward to reading more of your findings!
  8. stat arb is the first techinique iv looked at other than a brief attempt at a pattern matching predictor in university which I have put on hold. stat arb seems to make the most sense to me mathematically and is pretty easy for me to wrap my head around. Plus it is pretty much zero risk other than the risk of slippage which is good because I am working with a small amount of working capital right now. I am not interested in the best returns right now, just trying to get small consistant returns.

    If you have suggestions on any other types of quantitative strats that I should spend some time researching, feel free to give me a name to google. I am giving myself a year to get something working before I get sick of living on no income.
  9. segv



    I would be interested to know why you consider a statistical arbitrage strategy to be "near zero risk". Would you elaborate?

  10. With an AI/math focus I think of rough sets, artificial neural networks, latent semantic analysis... Maybe there are traders here using these techniques, but most "anomalies" are the result of over extensive data mining.

    Take a look at "Beyond The Random Walk" by Dr. Vijay Singal
    #10     Oct 4, 2006