AutoTrader software using TWS Java API

Discussion in 'Trading Software' started by autotrader, Aug 10, 2002.

  1. Hello,

    I wrote a small program using Interactive Brokers TWS Java API to do automatic position exit management.

    the main features are:
    uses Java, compatible with java 1.3 and 1.4. if TWS runs on your machine, then this program will run on your machine. no more missing OCX, DLL, etc headaches from using those VB based programs.

    TWS Java API uses direct socket connection to TWS, one less step compared to VB based program that has to go through the ActiveX component.

    Your entire position is protected at all times by a stop order, even partial fills !!

    Stop trigger can be based on Last price or based on bid/ask price.

    Automatic Trailing stop, you specify the increment.

    Ability to scale out of large positions. you specify the quantity and point profit to scale out.

    Option to log transactions to a file.

    Works with futures (including foreign exchanges), stocks, options.

    program is free.

    many other features....

    go to for more info and to download the program. Make sure you test it on cdemo or edemo first.

    I will be adding more features as I see fit from requests that I receive.

    Hope you find the program useful.

  2. WarEagle

    WarEagle Moderator

    Hi autotrader,

    Nice program. I've been playing with it on the demo and have a couple of questions.

    I submitted an order (that was filled) and then realized that I hadn't set my target/scale out orders like I wanted, so I hit "cancel all open orders". Now I can't seem to enter new target or stop orders without exiting the entire position and resubmitting a new order. Is there a way to resubmit the target or stop orders once they are cancelled? I see now that I could have just changed them on the fly without canceling them. Also, is there a way to cancel just one of the exit orders (i.e. the scale out and not the target) without doing it manually in TWS? I tried unchecking the scale out box, but this does not cancel the existing order.

    Thanks for sharing your program.
  3. nitro


    OK. Here is a program that I desperately need.

    I need a program that adds "defensive" mechanisms to the IB TWS execution. Here are a couple of examples:

    1) If the spread between the bid and the ask is really wide (user settable) and you try to buy on the ask or sell on the bid, it will bring up a dialog box and say "spread wide" or maybe even have it scream out the speakers "you idiot pay attention."

    2) If it is after hours, and I try to exit a position, bring up a dialog box up that says "Exit .75c away from last trade" (user settable,) and even better, have it connected to an ironing board that swings down on your head if you are EVEN attempting to do such a thing....

    Honestly, I would like such a program, minus the abusive stuff...

  4. Hello WarEagle,

    I see you figured out that you can change target offset and stop offset on the fly.

    regarding scale out, I need to do some more work on it. I'll add the option to cancel the scale out option while a position is active.