Focusing on FIX protocol and testing with it

Discussion in 'Automated Trading' started by Rocko Bonaparte, Nov 28, 2012.

  1. I'm developing something I'd like to eventually try live, although I haven't even settled on a Broker yet. So in the meanwhile I thought I'd start focusing on trying to do execution using the FIX protocol, or at least have 1:1 mappings of the functions in that to what I'm trying to accomplish. Generally is that a good approach? If I end up with an API for a broker that isn't FIX, would that then be pretty trivial to remap?

    One thing I want to do is have a live test with a mock server that I would communicate with and check executing orders. It would just be a safe and contained way to test the whole process. If I stick with the FIX API, are there open implementations for the server side? I found this:

    But I don't know yet if that's really just a client engine or what.
  2. QuickFix includes two serverside examples, "executor" and "ordermatch." Configuration is via a simple .cfg file.

    Stick with FIX 4.2 if you want to run these out of the box, going to 4.3 or higher requires a minor rewrite of the examples.

    If you are using the java version, QuickFixJ, there is a bug in ordermatch -- targetCompID and senderCompID are reversed in the reject message handler.
  3. Craig66


    It should not be too hard to make your order engine agnostic of the on wire protocol, my code can use FIX or IB API with no mods at the business level, I think this is a good approach in general. As for testing, MB used to have a FIX server which you could paper trade against if you have an account.
  4. Occam


    Most brokers will give you a FIX connection if your account is large enough ("large enough" varies by broker, so be sure to ask -- it may also depend on your anticipated volume). FIX is the standard for sending orders, so most (if not all) brokers are using it themselves anyway; it's just a matter of opening it up to a client in such a way that they can do the risk checks.

    There are differences amongst brokers with respect to FIX implementations, although they tend to be minor, provided you're using just the default FIX functionality.
  5. 2rosy


    why go through all the trouble for testing a strategy?
  6. I don't think I wrote "strategy" there, just "something." I have given that plenty of testing, but I'd like to practice execution with it. At the least I don't have the order execution logic in place at all so I need something to try that. I also don't have a brokerage account yet since I'm still not entirely convinced this thing will work. I'm hoping through a total decoupling of the testing from the strategy that I'll see if I'm really doing it.

    I was also planning to use it to do a synthetic, accelerated test where I'd do 1-minute bars every 15 seconds, so I can simulate a 24-hour day in 6 hours. Stuff like that.
  7. jb514


    I didn't think anyone who knows what fix is, is interested in candlesticks.
  8. 2rosy


    You wrote something but you dont know what you wrote? You dont need to write a full FIX implemented system to practice execution. Just get ticks (maybe in a csv file) and pipe them through your strategy :D
  9. I swear you guys deliberately try to take me out of context here:

    I did not write "strategy." I have been backtesting a strategy fine and plenty. I want to start executing mock orders and checking that I have the full flow working. It's integration testing. As much as possible I'd like to get it to mimic what I'd really be doing, but have some knobs to do things like stretch time so I could debug or test things.