Paper trading back to normal and 1800 in 30 min !

Discussion in 'Automated Trading' started by tommaso, Jul 1, 2008.

  1. tommaso

    tommaso

    Paper trading is working fine again and my bot today seems to fly.

    5 symbols, max value employed -20.000 / +40.000 $

    has gone beyond 1.800 in the first 30 min

    (window left bottom

    the other 2 windows show the long/short game being played
    asyncronously on different accounts)


    I would be nice if each day were like this!
     
  2. tommaso,

    One thing I should point out that you may not be aware of. In IB's paper account the data is not accurate. I ran into this problem a year or so ago. I developed a strategy completely on the paper account, only to then realize in the real money account my signals were way off.

    This is due to the fact bid/asks will be off due to bids/asks from other paper accounts showing up in the system that are not real orders. Volume will be off.. even prices will sometimes be off..

    At least this was my experience, now I only use the real account and sim my own fills.
     
  3. tommaso

    tommaso

    Thank you very much frostengine. I will watch that out
    whenever trying with the real money.

    I do not expect however that a problem of the nature you are mentioning will be of exceeding importance to my strategy.
    In fact I am not relying on short trades, but both my stops and trailing starts are quite far away.

    In the past I have tried also an approach using a fast pace trading but I abandoned it soon, because not profitable and also probably very dangerous (disconnections and so on).

    My current problem with the paper account (hopefully the last one), which I am trying to solve at best is with partially filled orders and very big latencies (which should however not be present in the real account), which if not dealt with carefully may lead the bot positions to go slighly out of sync with respect to the IB positions.

    Thanks a lot for the kind warning.

    Tommaso
     
  4. edbar

    edbar

    Tommaso, you're far from being out of the woods. Every problem you have with the IB paper trading account will still be there when you go live, AND SOME!

    Also, when your orders/fills hit the real market, you will affect the market and if you float limit orders and stop losses guaranteed you will cause prices to behave differently. The "easy money" you made in the paper trading account will vaporize in the real world.

    I highly recommend moving the live system. Even if you trade lower cost stocks and lower share-lot sizes, it's infinitely better than playing around in the paper trading account.

    To me, the paper trading account only serves as a test ground to ensure basic programming functionality like can your program execute an order, retrieve your positions, get your account balance, etc. Your better off in a live system for working with your strategies.

    Good Luck!

    Ed
     
  5. tommaso

    tommaso


    Thank you edbar,

    I will soon follow your suggestions.

    I am doing the last refinements. As you indicated, I cannot
    expect the real trading can be "forgiving".

    So I just wish to make sure everythings is at the right place place when the real "war" starts.

    Lately, I have been doing 2 big strategies changes to my bot which have been suggested by my brother (he is an expert trader, while I am the a software writer).

    I think he has suggested 2 very ingenuous ideas which are making the big difference. Before I also had nice results, but the problem were the big drawdowns that sometimes occurred.

    His ideas have improved a lot the whole thing and reduced drastically the drawdown.

    T
     
  6. tommaso

    tommaso

    btw, talking about code refinements, does anybody know
    for what reason the last FILL event is sent 3 times instead
    of just 1 ?

    I have been guessing that perhaps there was a concern that we might skip events. But, actually this seems to me quite confusing.

    Is there perhaps a specific reason I am missing ?


    Tommaso
     
  7. edbar

    edbar

    It's probably because the order was not filled in one event.
    For instance, if you bought 1000 shares, it may have been purchased in 3 chunks (250, 550, 200).

    If you're building an automated trader, you have to add all of that up so you know the complete order got filled.

    Ed
     
  8. tommaso

    tommaso

    Thanks fot the attempt Ed, but that is not what I am referring to.
    It's clear that what you say is true.

    I am saying something different.
    For instance, if you buy 1 goog contract (100 shares) you will receive 3 (three) events with status "filled" (each one reporting filled=100), not 1.

    That's what I am wondering about, and I am not sure why this is so.

    T
     
  9. edbar

    edbar

    Right, filled = 100%.

    You should always match the event-id with the id of orders that you have sent.

    IB works in mysterius ways! Best and possibly the only solution is to just ignore the duplicates.

    Ed
     
  10. tommaso

    tommaso

    Thanks Ed,

    Actually, now that I am focusing this thing with your help, I think I am finally realizing why this is so.

    It would seem strange to see multiple events in a row with the same order ID and same status and same filled value if we regard this event as a "status changed" event.

    Now I realize that this is not meant to be a "status changed" event but evidently it's a mere "polling" that periodically returns the order status.

    So, in this perspective, it's perfectly possible and actually fine, to have several events which carry the same information (apart the polling time).

    I have done some experiments for confirmation. For instance I have executed a big order (1111 shares) on EOG and received 19 fill events.

    But at a closer inspection, many of them are just equal. See the picture enclosed which I have grabbed from my bot, slightly modified on the fly to show these fills (I have put the fill events in a pile to avoid overlapping, but the prices are nearly the same).

    so it's just a polling on the event status...

    Tommaso
     
    #10     Jul 4, 2008