Search results

  1. D

    Trading bot construction (IB)

    IB's API code may reach "error(Exception e)", which the bot is required to implement. Here is some pseudocode that considers what might be done there: error(Exception e) { if 'e' is a socket exception if the bot is disconnecting no problem else...
  2. D

    Trading bot construction (IB)

    The bot finished for the day. It made .25 pt. When the entry order was submitted, TWS was docked in the toolbar; when the exit order was submitted TWS wasn't docked. The large difference in order confirmation times may be a consequence of that. The delay for several seconds on the entry...
  3. D

    Trading bot construction (IB)

    I exited the bot and TWS, then restarted later. This is what the log, so far, shows: 08:32:22 logger time zone is set to America/Chicago 08:32:23 connecting to TWS on localhost at port 7496 with id 0 Server Version:31 TWS Time at connection:20070209 07:32:21 GMT-07:00 08:32:29 TWS...
  4. D

    Trading bot construction (IB)

    I've emailed the files to chameleontrader. He may put them on SourceForge soon. If you download and run it, it is important to know that out-of-the-box it will attempt to connect to a TWS running on 'localhost' at port 7496. I recommened that you only have one instance of TWS running and...
  5. D

    Trading bot construction (IB)

    Today, the bot sold at 13:52:36 and bought at 14:42:29, Chicago time. It wasn't the best time to sell, but the buy to cover timing wasn't bad -- sold at 1451.50, bought at 1451.50. I added the capability to limit the number of trades per session, and today I ran it with one trade. I...
  6. D

    Trading bot construction (IB)

    dcraig: Thanks for the input. Right now the bot just has one 'Session', because it only trades ES at the CME during regular trading hours. With the concept of a session, though, it could easily loop over more than one session. That would require the bot to set-up a list or an array of...
  7. D

    Trading bot construction (IB)

    chameleontrader: That's good news. I think they use CVS, which lets people browse the source code, so someone could copy and paste if they have trouble using CVS. The initial code should be ready soon. I do want to put some more comments into it about known and potential problems. I am also...
  8. D

    Trading bot construction (IB)

    Yesterday, the bot traded four times. The longest was about seven minutes, another for about five minutes, another for a few seconds, then one with entry/exit at the same time, at the last second of the day session, which didn't execute until two seconds later. One trade made .25 pt., one...
  9. D

    Trading bot construction (IB)

    There may be an arithmetic mistake in that last post. The bot should generate a transaction report at the end of session, summarizing the trades. Later. Six things can go wrong while RandomBot works on a round-trip. To communicate some status back to RandomBotMgr about what happened while...
  10. D

    Trading bot construction (IB)

    When the bot traded yesterday, it was run from a script and traded a 5 minute session each time it ran, so it made a lot of trades over the hour or two that it ran. Today, it was started about 1/2 hour after the day session began and wasn't run from a script, so a single session ended when...
  11. D

    Trading bot construction (IB)

    I mentioned that I had a problem with "static context". Here is some code that illustrates the problem. That 'main' is "static" has nothing to do with it. The compiler's error message isn't very informative. class A { public void b() { } } class AA { static public...
  12. D

    Trading bot construction (IB)

    By monday, I hope to put the new files up. It needs a lot of work, but I have found it useful. It does random-trading and does logging, so I could begin running it each trading day, but won't start doing that until the log format is settled. As is, it is very useful for finding out about...
  13. D

    Trading bot construction (IB)

    In the last post I may have given the impression that RandomBotMgr computes the trade times, then hands them off to RandomBot for scheduling. What happens is that RandomBotMgr decides if the exchange is open and, if so, connects to TWS, creates a RandomBot, providing it with the 'open', which...
  14. D

    Trading bot construction (IB)

    I've retrofitted that last randTime.java into a bot and ended up with additional files: X.java, Logger.java and RandomBotMgr.java. It traded last night, several times, for 5 minute sessions and made a little money. I lost track of how many times it traded, so did the bot. Early on, I had to...
  15. D

    latency

    If you know the name or ip address of a server, you could 'ping' it, which will give some info about how long it takes to reach it. The time may vary.
  16. D

    Trading bot construction (IB)

    I've attached a new randTime.java, in randtime.txt, which fixes the problem mentioned last. Here is the log output for a session between 05:30:00 and 06:00:00, started about 05:35: 05:34:04 Bot.run: round-trip interval begins at 05:34:04, ends at 06:00:00 05:34:04 Bot.run: scheduling...
  17. D

    Trading bot construction (IB)

    re: "Note that if the 'seconds' part of 'close' (in main's preliminaries) is 'n', then the 'seconds' part of every exit/entry time will be <= 'n'. A 'close' of XX:XX:59 may be best. Is this a bug or a feature?" One implication of this may be that if XX:XX:00 is specified, then the...
  18. D

    IB's FIX interface

    I am not an experienced FIX user, but may be able to answer a couple questions. re: "Is there offered open source code that handles the FIX msgs already or did you have to code them yourselves? " Yes. If you google for "FIX protocol open source" (without the quotes), you'll get several...
  19. D

    Trading bot construction (IB)

    attachment retry ...
  20. D

    Trading bot construction (IB)

    I've attached a new randTime.java, in randtime.txt. It appears that trade entry and exit times are computed correctly, so I think that the bot's random-trading strategy is ready. The random number generator hasn't been evaluated; however, it is one that generates a long sequence and doesn't...
Back
Top