ROBOT autotrading futures (through IB Gateway)

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

  1. Robot continuing increase Realized (no big "investments" so far that are decreasing PNL)

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

    Best "performer" so far has been CL:

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


    The Highest P&L (8.4K) is with EUR, but to reach it had to "invest" with some drawdown (-17K)

    Tom
     
    #21     Jul 22, 2010
  2. No big events. "Realized" increased to 26K (has been doing more than 2K a day). Positive P&L (no big "investment").

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

    I could close and restart a new "session", as PNL is close to "realized". I let it continue, though.

    Will be traveling during the weekend and have to shut down the machine, but the robot saves its complete state and can fully resume anytime later (from any machine), just from where it left.

    So, will resume trading on sunday from this point. Any questions welcome.

    Tom
     
    #22     Jul 23, 2010
  3. No big news. Robot trading regularly.
    This week it has been "investing" (mainly in gold). CL is still the "best" (or most lucky) "performer", followed by CHF, which has accumulated over 7K with a very small drawdown.

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

    When market closes will post charts with details of all trades.
     
    #23     Jul 30, 2010
  4. I have actually some news now. It has just closed (5:57am edt) all positions at 27.7 K

    Will restart autotrading in few minutes, as soon as gets into the first "entry region".

    <img src="http://www.datatime.eu/public/gbot/res_sun11_5.png">
     
    #24     Jul 30, 2010
  5. Nice job Tom,

    Your results seem to reflect a fairly consistent 2K a day profit across a folio of 10 instruments. What are the cash requirements to trade this particular folio? Can the algo be set to trade intraday going flat by session end? If not do you have any set maximum position size for the over night carrys?

    Few questions regarding your folio approach relating to draw down and profit taking. Seems like your algo trades each instrument independently but use some type of rule to close out the folio.

    If a single instrument position is being drawn down does the algo cut its loss by offsetting profits from other instruments.. ie. folio based rules? or does the algo add to the position and wait for it to profit?

    Are the profit taking rules static or dynamic? does the algo adjust exits for each position based on the results of the folio... or does each instrument use hard and fast rules for taking profits.

    When you add to a position are you adding exponentially or linearly? 1,2,4,8 etc. or 1,1,1,1? Do you add size to profitable positions... pyramid?

    Outside of using the basket of instruments to hedge the trading risk what specific scenarios cause the algo to either scale size or take losses?

    Interesting approach.. Is this fully automated or a combination of discretionary and automated trading?
     
    #25     Jul 30, 2010
  6. Hi there guy. I like the interface youve designed very much. Congratulations on getting it right on. Anyway I use Interactive brokers and just wondered if theres any specific reason that you use the gateway to connect rather than having TWS open and doing it that way instead.. Is there any specific reasoning behind doing this?

    Also I am wondering about gathering of price data. Specifically I wonder wether theres ever any difference between the data that is gathered by the system and the chart data. The reason i ask this is that IB staggers there price data every 200ms so its possible that from time to time it misses a price quote that unfiltered tick data wouldnt of missed. My first system was built in excel and this used to happen frequently enough that I dont use it now. Does it ever miss a last trade price?
     
    #26     Jul 30, 2010
  7. I don't think it matters much... this appears to be a swing trading system rather than HFT/scalping system. The trade frequency is hours and days.

     
    #27     Jul 30, 2010
  8. <b>Thanks PocketChange! </b>

    Will reply to you questions later because, as usual, they are pretty tough and insightful ;-)
    I have actually derived this algo from a HF scalper, and in that case infrastructure issues (connectivity, latencies, etc.) are of greater importance. This approach is more generally "playable" and less hardware dependent.
    The money management issue is a very important one and i really would like some good suggestions. We have experienced during this test (end june) some significant crash (probably we did not see something similar since 2008) but the max position was just 59, with a quick recover. So this just to introduce the discussion on that matter, which I think is the most important here ...


    <b>Hi Big Game Hunter, </b>

    thanks for the compliments.

    As to the IB Gateway, I am using it just because it does not have that incredibly annoying - and frankly absurd in year 2010 - "autologoff" feature.
    I have asked many times IB to make it optional, but with no success, evidently. Still hoping, though!

    The IB Gateway stays always on (can get messed up occasionally during weekends), but, in turn, it also has a big drawback that it will not allow to check the PNL and position. This is also quite ridiculous (to me). Again, I have asked on some thread here IB to add a very simple "account view" (just Positions and PNL would be ok) to the Gateway. No success so far!

    I do think they should do both: make optional the autologoff in the TWS (or remove it) and add a simple account view to the Gateway (after all they already have that code).

    As to data, I miss nothing. And keep in mind that I usually run up to 7 instances of robots testing algorithms, running "robustness analyses" and other tick capture utilities and browser/filezilla/skype/IB/etc. windows on my quad with win 7 (the CPU indicator is always out of scale though! :))

    I am not sure what "chart data" you are referring to. If you are talking about IB charts, they only know what they do within their system. If you are talking about my charts, what i do is a "dynamic real-time resampling", or else you could not hold hundreds of instruments all at the same time running practically forever, as i can do. You would run out of memory after a while.

    I do not miss any data. As to "last trade" i only get bid/ask prices, don't need the "last trade" price. (Excel, while can be very useful for modeling, is not really suitable for running an automated system, in my opinion. Not the right tool for the job)

    Tom
     
    #28     Jul 30, 2010
  9. This is the topic I would like to discuss in depth with you guys at ET. One method to determine cash requirements is to backtest against worst scenarios and look at the maximum global position.
    For instance, I was mentioning the high volatile scenario be have experienced a few weeks ago. If we could assume that was a bad scenario, we could for instance get prepared to see a global max position of 60 contracts. Backtesting on worst case scenarios might indicate a bigger maximum position (it also depends on strategy parameters clearly). If we also assumed that, for instance, a conservative figure for margin requirements would be 3K, we could determine, following the above example, a max "initial cash reserve" of 180K. (But frankly, i would not even start with an amount, at least, double of that). But do we really need all that money in the account ? Most of the time only a small fraction of that is needed. Possibly, we could proceed with gradual "cash injection" when we see things are getting too volatile. After a while the bot might be self-funded. But I really like to hear ideas.
    (Clearly the results shown here are under the assumption of an initial packet size = 1. If this is set bigger, profit and drawdown will vary proportionally. Strategy parameters can be calibrated, so that given a certain initial cash reserve, there is a high probability not to need more cash.)
    The algo, in this case, is the same for all instruments (different parameters for each instrument could be specified, but I did not). However, the instruments do NOT trade independently. As I have anticipated in the previous post I have enforced some correlation rule which delayes new entries in a condition of volatility. This is because we want to use correlation in our favor, distributing the investments, and trying to avoid that all the instruments simultaneously enter the "investment" phase.
    Another reason because they are not independent is the take profit rule I have mentioned in previous posts. This causes the "running away" instruments to be stopped, if there is a favorable condition at folio level. In other words, the use of stops is justified at a folio level and not on single trade (as was asked by kxvid).
    Yes, exactly. It can be cut away if the folio allows that, or a more favorable condition can be waited for. In fact, you you take a closer look at the charts you will notice that there are instruments with negative "realized" (mostly eminis in this case), a clear sign that they have been stopped at a folio level.
    The take profit is currently completely dynamic. The concept is that it can "take profit" or "consolidate" (which means shifting $'s from the "Unrealized" component of the PNL to the "Realized" component) when an "cycle of investments" can be considered ended.
    No adding exponentially would lead to ruin. Further positions require price moves much more than proportional.
    Worst case scenario is all instruments highly correlated all engaging in "investments" simultaneously. This is an area where much research can be done and this algo can certainly be improved, as performances. I will be doing that in the near future (besides devising new algorithms, as usual).
    Full automated, with no need of trader intervention. Clearly, the trader can decide when to close all and restart a trading session (for instance might choose to start up after a period of high volatility). But, in theory, it could run forever. In practice, will not at least because the charts will become "cluttered" (though the bot has a way also to avoid that).
    Another area where the trader can intervene is how to make the rollover (I will show this later on). (The bot provides an automatic rollover facility.)

    Tom
     
    #29     Jul 30, 2010
  10. Ok market closed (over 30K).

    Could have actually closed all positions, as Real and PNL are very close, but I am letting it run (test purposes).

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

    <img src="http://www.datatime.eu/public/gbot/res_sun11_6.png">
     
    #30     Jul 30, 2010