Fast trade exeuction

Discussion in 'Automated Trading' started by Iggy_Type_R, Aug 6, 2009.

  1. Hi folks,

    Firstly thank you to everyone who posts on here... I found a hell of a lot of great info for my black box which I finished last night after 3 weeks of all-nighters :)

    I have a question that I havent been able to find a solid enough answer for, so I am hoping you guys can help.

    I am using IB as my platform for executions. I have just signed up for an account with IQFeed because IB's data feed is not robust enough for my requirements. I am executing around 200 trades simultaneously and sometimes I find I get OrderID errors (child orders lose their parentID in TWS, but not because I am not passing it through) so I have to slow down the execution by a 400ms break between bracket orders.

    I am wondering if there is a platform out there that can handle several hundred orders a second. May be even a thousand? Something that a Quant fund would use I guess ... :)

    And perhaps a better reporting interface :)

    Thank you in advance for your time and help.

    Iggy
     
  2. rosy2

    rosy2

    does IB generate the ids or do you? if you generaet the orderIds I would creaet a little orderId server and have your algos grab the next 100 or 1000 ids available and store them in the algo itself.

    as for platform, not sure about IB but at my firm we use lime brokerage.
     
  3. trd

    trd

    Me too please! :)
     
  4. NazSpaz

    NazSpaz

    If you are willing to go prop --> http://www.echotradeonline.com Have to have enough in funds that they allow you on the direct servers, not running through Echopro (Sterling) API. Any API running alongside a trading platform stinks for that matter for high-frequency trading...

    Their direct exchange servers can handle a ton, not sure where they top out exactly, but I throw a lot per sec at them and it can take it. Prob might be though that they do require a lot to get on the direct stuff (capital & maybe experience with the firm), not for the average Joe. No idea what exactly for a new guy they would look for to allow you on it, but can tell you it is very good stuff, fill times are ridiculously fast (milliseconds - varies a bit by exchange).
     
  5. Just out of interest, what would be an example of these orders? What's the objective of the system? I have experience with IB's api and don't know whether it could come close to handling that volume. Now I'm designing to Transact's api and I imagine it could handle that volume, provided your system could pass their certification and conformance criteria. It's futures contracts only. It's not a published api, though, just available to their heavyweight customers. Probably best to go with a firm that specializes in black boxen. ;-)
     
  6. rosy2: IB generates the first ID as an event for Connect() method. To say that that is silly is an understatement :) So I get that ID, and then iterate it in my code until I disconnect.

    I definitely am hitting the message limit even with threads.

    I am currently looking at Saxo bank as the platform for this - but finding info on their API is bloody impossible! :)
     
  7. With IB, so long as ID's you use start with the one you are given and are monotinically increasing, then there's usually no issue. You could even skip by two's and it wouldn't care.
     
  8. I agree. The problem is not in the OrderIDs as such... it's in placing orders. For each equity I am interested in, I place a 4 order bracket order. Entry, SL, EOD liquidation and a Trail with trigger. I do that for up to 400 equities.

    The problem is if I do it any quicker than having a 400ms break between each bracket, I get orderid's disappearing and an error message "Order id= cancelled" and the child order ID does not show up in the KEY field on TWS.

    So a normal order has Key fields like this:

    204 Entry
    204.1 Stop Loss
    204.2 Trail
    204.3 Liquidation

    what I get is

    204 Entry
    204.1 Stop Loss
    Trail
    204.2 Liquidation

    and it gets worse and worse the faster I go.

    with 400ms I put on all 400 brackets no problembo.

    Hope that makes sense :)
     
  9. Well, if you're TWS as the mediator, and not FIX then I could suggest you run TWS under the Java Server VM for higher performance. Also, if you're on Windows, adjust the scheduling so your client and TWS have equal priority. I imagine you're well beyond these details, but just fyi.

    Just in case you're interested, here's a .bat file to run TWS under the Server VM in Windoze.

    REM Works ONLY if Java Server VM is installed, which can be obtained from the JDK
    c:\WINDOWS\system32\java.exe -server -Dsun.java2d.noddraw=true -Xbatch -XX:+UseConcMarkSweepGC -XX:+ForceTimeHighResolution -XX:ThreadStackSize=256 -XX:CompileThreshold=250 -XX:+AggressiveOpts -XX:CICompilerCount=2 -XX:+UseBiasedLocking -XX:+CMSIncrementalMode -XX:MaxGCPauseMillis=75 -XX:+RelaxAccessControlCheck -XX:-TieredCompilation -XX:MaxInlineSize=128000 -XX:-DontCompileHugeMethods -XX:+UseFastAccessorMethods -Xss192k -Xms300m -Xmx300m -Xnoclassgc -XX:+DisableExplicitGC -XX:ThreadStackSize=128 -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -cp jts.jar;pluginsupport.jar;hsqldb.jar;jcommon-1.0.12.jar;jfreechart-1.0.9.jar;jhall.jar;other.jar;riskfeed.jar;rss.jar jclient/LoginFrame \jts

    Java is much faster than most people think !!
     
    #10     Aug 9, 2009