ROBOT autotrading futures (through IB Gateway)

Discussion in 'Journals' started by fullautotrading, Jun 22, 2010.

  1. Trading is proceeding fine. There has been a general uptrend (on all instruments) at the beginning of the week.
    The bot has been investing on CL and EUR mainly.

    At the end of the week will post trades.

    [ I have also done a quick experiment running the algorithm on a folio of 80 ETFs/Stocks. The algo seems able to capture a lot of "noise". Made over 30K in few hours:

    <img src="http://www.datatime.eu/public/gbot/EtfTest.png">

    (will not post the charts showing all single trades for this "side test" as these are too many pictures, but for the people interested just PM me as usual, I will send them). The initial packet size was 1.000 shares. Max number of shares open at same time was about 86.000. ]

    Tom
     
    #31     Aug 5, 2010
  2. We just reached the end of another week. (CL and EUR have mostly "dominated" the week.)

    <a href="http://www.datatime.eu/public/gbot/Sun%2011%20Jul%202010_port4001_Cli1_6/GBotReport_2010-07-11_port4001_Cli1.htm"> Chart update </a>

    <img src="http://www.datatime.eu/public/gbot/res_sun11_7.png">

    On sunday we might either start a new trading session or continue this one (as PNL and realized are close).
     
    #32     Aug 6, 2010
  3. All is proceeding fine. This morning around 6:07 edt it closed all positions and restarted.

    <img src="http://www.datatime.eu/public/gbot/res_sun11_8.png">

    (The current rules in the algorithm actually cause frequent global close: the bot actively fights the possibility of position to grow large, from the very beginning.)

    I am currently working on "correlation rules" refinements for optimal "investment distribution" within the folio.

    (I will also slightly change the lmt price computations to possibly reduce slippage on close.)

    Since i have made many code changes, I will probably shut down in a while this trading session, to restart with the new program "version" and possibly refined rules.

    Tom
     
    #33     Aug 11, 2010
  4. Ok market closed!
    At the end of the week, most instrument plunged. The bot dealt ok with that, adding some nice profit.

    Here are the detailed charts of all trades (automated report):
    <a href="http://www.datatime.eu/public/gbot/Sun%2011%20Jul%202010_port4001_Cli1_7/GBotReport_2010-07-11_port4001_Cli1.htm"> Chart update </a>

    <img src="http://www.datatime.eu/public/gbot/res_sun11_9.png">

    Next week will start a new trading session, as i have made changes to the code and introduced some algorithm variations (i wish to scale more the entries, and "watch" a larger folio).

    (Any question welcome.)

    Tom
     
    #34     Aug 13, 2010
  5. As anticipated friday, have restarted an algorithm variation with a bigger folio (20 instruments). Initial packet size 1 contract. Min trade size = 300$

    <a href="http://www.datatime.eu/public/gbot/Sun 15 Aug 2010_port4001_Cli1_1/GBotReport_2010-08-15_port4001_Cli1.htm"> Chart update </a>

    <img src="http://www.datatime.eu/public/gbot/Res_Sun_2010_08_15_1.png">

    The new folio is:

    ES FUT 201012 GLOBEX 50 E-mini S&P 500
    YM FUT 201012 ECBOT 5 Mini Sized Dow Jones Industrial Average $5
    NQ FUT 201012 GLOBEX 20 E-mini NASDAQ 100 Futures
    AUD FUT 201012 GLOBEX 100000 AUD.USD (6A)
    GBP FUT 201012 GLOBEX 62500 GBP.USD (6B)
    CAD FUT 201012 GLOBEX 100000 CAD.USD (6C)
    EUR FUT 201012 GLOBEX 125000 EUR.USD (6E)
    CHF FUT 201012 GLOBEX 125000 CHF.USD (6S)
    MXP FUT 201012 GLOBEX 500000 MXN.USD Forex (6M)
    NZD FUT 201012 GLOBEX 100000 NZD.USD Forex (6N)
    ZB FUT 201012 ECBOT 1000 30 Year US Treasury Bond
    ZN FUT 201012 ECBOT 1000 10 Year US Treasury Note
    ZF FUT 201012 ECBOT 1000 5 Year US Treasury Note
    GC FUT 201012 NYMEX 100 GOLD
    CL FUT 201012 NYMEX 1000 Light Sweet Crude Oil
    NG FUT 201012 NYMEX 10000 Henry Hub Natural Gas
    SI FUT 201012 NYMEX 5000 NYMEX Silver Index
    RB FUT 201012 NYMEX 42000 NYMEX RBOB Gas Index
    HO FUT 201012 NYMEX 42000 Heating Oil
    HG FUT 201012 NYMEX 25000 NYMEX Copper Index

    [I know i am including futures with date too far away: i wished to take a look at liquidity / slippage issues (particularly, HO, RB do have ridiculously large spread at this time). ]
    Also, included MXP for curiosity because I have never followed this one. Anyone knows it well ?

    Realized=10.5K, Min PNL=-2.3K and current PNL> 1K (>100$ comms). CL again is the most lucky performer so far (almost 4k realized and PNL with -180$ min PNL).

    Have also launched a simultaneous run of the previous algorithm version (same start time) on the same folio of 20, to take a look at strategy differences. [This new variation is doing better so far: it's clearly too early to say, anyway.]

    (Will post here only new algo variation, if anyone interested in the previous variant results, just PM, as usual)

    Tom
     
    #35     Aug 17, 2010
  6. Dr Who

    Dr Who

    Tom,

    You're obviously a really bright guy even though you're Italian (that's a joke by the way as I love Italians...well Italian women anyway) and you do have some cash but why are you still trading ? By now you should have accumulated enough wealth even for Croesus, so where have you gone wrong ? Or are you still playing with G-Bot for the intellectual challenge ?

    The world needs to know.....
     
    #36     Aug 17, 2010
  7. unco

    unco

    Hi Tom,

    I trade MXN spot sometimes, liquidity is poor outside US session (i'm based in Europe) and it can be difficult to find a reasonable spread. I suppose it's the same for the future. See attached chart (time is UK time) Orange dots are average volume.

    I'm not sure to understand why you are not trading U0 or V0 for nrg contracts. Test something you already know? (poor slippage) :). However I understand than rolling every month is a pain in the @@@...

    Very interesting thread !
     
    • bb1.gif
      File size:
      99.2 KB
      Views:
      178
    #37     Aug 17, 2010
  8. wave

    wave

    la madre dei cretini e' sempre incinta.

    All of these people come from Italy:
    Leonardo da Vinci
    Galileo Galilei
    Machiavelli
    Dante
    Petrarca
    Boccaccio
    Michelangel
    Giotto
    Donatello
    Amerigo Vespucci
    Filippo Brunelleschi.

    Where would the world be without the inventions of Arabs and Italians?
     
    #38     Aug 17, 2010
  9. Dr Who

    Dr Who

    wave, I did say it was a joke....

    I'm a photographer and my favourite contemporary was Helmut Newton....bugger, he was German not Italian.....anyway, I'm sure there are some good Italian photographers out there......
     
    #39     Aug 17, 2010
  10. Hi unco,

    Thanks a lot for the compliments and your interesting question. Thanks also for the nice info on MXN.

    Besides test purposes you mention (I have changed the algorithm to compute LMT prices of new orders), I also sort of wished to introduce "gradually" the readers to the various aspects of this approach. Strategy first, details (like rollover mechanisms) later.

    I will show later how the robot does the rollover. It's not a pain in this case ;-)
    The user can decide when and how to perform it, but for the rest it's completely automatic.
    What the trader will see is a continuous price curve with a vertical line indicating where the rollover happened. All trading information
    is "transferred" to the new instrument and the old one is closed.

    The Rollover works as follows. Assume we are rolling over one of those energy futures instruments from December 2010 to January 2011.
    The user has a period during which to perform the rollover (say 15-20 days): he would have various possibilities:

    <b>NEW SESSION</b> (this is not a "rollover", clearly)

    - If the trader thinks he wishes to close the whole session (PNL close to Realized), he can do it and restart a new folio.

    <b>ROLLOVER of some instruments</b>

    - If there are no positions open or little money invested, an instrument can just be dismissed. Opening a new one (new instruments can be added while trading).
    (this is not a "rollover")

    - If an instrument is "caught" in a situation where it's "investing" and we wish to continue trading it, without taking the losses, the bot does an "automatic rollover". In such a case it takes all the "trading information" of December instrument and literally <b>"clone"</b> it into the January instrument.

    Then the 2 price curves are literally <b>"joined"</b> on the January instrument tickdata display (with a thick vertical line showing the "rollover instant"). At this point December contract is closed and trading continues on January contract, "as if" nothing happened (clearly we spend a little in commissions). This way, The possible "loss" due to closing (stopping) the open positions on December
    will be "recovered" when January contract has a reversal, due to the fact that these positions are "reopened" at a further down (buys) or up (sells) location.

    Hope this description is understandable. Anyway I will show later how the rollover works in practice. Let me know if this sounds reasonable.

    Tom
     
    #40     Aug 17, 2010