Automated folio trading - Role of Information and Hedging

Discussion in 'Journals' started by fullautotrading, Dec 7, 2014.

  1. End of the week. We are still "alive" :) and some open players could be closed on the CL layer, thus recovering a just a bit.

    Before going overnight I now close the (CL) options (and any ETFs, if we had it) as we noted before. In fact there seems to be no much point in keeping precious funds allocated on stuff which is not trading (not to mention the possibility of gaps). The cost of "flattening" is negligible with this liquid stuff.

    CL_26.png

    (considerations about order sizing moved in next post)
     
    Last edited: Apr 17, 2015
    #81     Apr 17, 2015
  2. Still huge DD on the CL layer. This morning the may contract CLK5 was not tradable anymore and I was getting the "physical delivery" warning from the broker (http://ibkb.interactivebrokers.com/node/992).

    So even if contract expiration actually occurs in a couple days, we are forced to roll over to be able to place (non-closing) orders (with other commodities this has to be done much earlier).

    CLK5Rollover.png

    So I loaded next contract CLM5 and moved all the trading information on the new layer:

    CLM5AfterRollover.png

    Note (yellow circle, top right) the amount of contango, here visually represented by the buy/sell orders necessary to reproduce the position. We actually find ourselves above most of the open buy players. (Unfortunately, there are no funds available to close all those buys.)

    With the occasion, I also added a new feature to the rollover. Previously, I was just merging the existing players and orders on the new layer. I have now added also the transfer of the old tickdata too, and the shift back of the time origin for the layer, as it appears quite useful to be able to see them on the new layer. If one does not want to see them, it is anyway possible to move the time origin for the layer to a more recent date. I am happy with this change :).

    This is the current situation now on this layer. We are receiving several order rejection messages for sell orders (see messages in "last events" window, bottom left): in this case the application automatically reduces the order size to try execute at least what it can, as new funds are possibly made available. That is, even if it cannot close all the buy players due to funds shortage, it tries to reduce their averages, closing them partially as soon as some funds are made available:

    CLM5_1.png
     
    Last edited: Apr 20, 2015
    #82     Apr 20, 2015
  3. I have been regrouping and resplitting the open player to reorganize them. The procedure is, as we have seen before: 1) group all open players into one: 2) split it into two in appropriate players located in suitable places of the price range; 3) split them using desired size and distance. In this case I used 5 and 0.2% respectively:

    CLM5Split.png

    current:

    CLM5_2.png

    (I have been using as distance a % of the original player price, but I think I will change that, and use instead 0.1% of the current price (that is, the "gridspacing"), a that is the distance unit we have been using throughout the application, so it comes more natural and comparable. I have also found a small bug in the computation of the PNL of removed layers on session resume and fixed it.)
     
    Last edited: Apr 23, 2015
    #83     Apr 23, 2015
  4. Today I have noted another pretty serious issue related with the new concept of (virtual) "split" players. This has become evident quite with today large move up of CL, where no hedging order has been placed :eek: (thus unfortunately deepening the DD an losing a quite good opportunity for scalping).

    The issue here is the fact that the split players arranged in that way form actually a physical "barrier" where no further buy player can open, due to the spacing rules.

    This needs to be fixed of course. It is evident that the split players have actually a position that is in part arbitrary (as their spacing is specified by the fund manager at split time).
    For this reason, I have introduced a new feature to skip the split players in the distance computation, as actually we need them for their size, but their actual position (which is in part arbitrary) cannot interfere with the scalping game.

    So too bad for the huge DD and loss due to this move, but anyway, as usual, we have learned something good for a new significant improvement :)

    Now the "split" player as "flagged" as such, and their sequence should not interfere anymore with the spacing rules. So I have made this fix and recreated the player "distribution":

    CLM5_3.png
     
    #84     Apr 23, 2015
  5. Not much happening with CL. We remain in large DD. Doing very little: just some maintenance to reintroduce liquidation order (green dot on the right). Essentially we have no sufficient funds to close the buy players, so some move downward is needed to close some of the sell players. Further moves up would cause accumulation of new buy players, which for the most part would not be possible to close (unless the move becomes large.)
    Patience is now the game :)

    CLM5_4.png
     
    #85     Apr 29, 2015
  6. CL going up and we have almost finished up our financial resources. Even if probably too late, I have opened 2 additional CL layers to increase the upward hedging action, as the spacing rules on the main losing layer have been slowing too much the entry of new buy players (in particular the effect of the parameter to increase the spacing proportionally to current number of packets).
    Too large positions from the start of the test, and too many losses accumulated due to lack of margin. This test may be ending up soon :)

    CLM5_5.png
     
    #86     May 6, 2015
  7. We are still surviving, though in the middle of several liquidation actions from the broker which is forcing new buys (at high price.)

    On Monday, since we are near expiration, we will need to roll over the 3 CL layers we have seen in the last post.
    This will be interesting as it shows how to deal with rollover when multiple layers are concerned.
    This is even more interesting due to large DD, as we clearly do not have enough money to close one layer at a time (the respective positions are -67, +12 and +16, with a real position in the account of just -21, after the last liquidation of 18 contracts forced by the broker) and it will be interesting to see how we deal with cases like this one (multiple layer's rollover).

    The way we will deal with this is, of course, as follow. First of all we need to introduce the liquidation order through a "virtual fill", so we are in sync with the broker. Then we can close the global position manually with a unique manual order and, finally, we can distribute such an order as "virtual closing orders" on the 3 layers. At that point, we can roll over normally, transferring all the trading information on new layers with new contracts. Then we restart trading normally (the virtual orders can be transformed into players.).
     
    Last edited: May 16, 2015
    #87     May 16, 2015
  8. I made actually a small change to the above rollover plan. Since I found on Monday that all positions had been liquidated by the broker, and I did not have the information about the liquidation order (available in the next day report [note for the broker: it's a bit shameful this info about liquidation orders is not reported by the API]), I made anyway the rollover (even if the layer had a "position", clearly not "real"), and then re-synced the position on Tuesday.

    So I made a small change to the rollover procedure in the application, allowing to roll even if a layer "thinks" it has a position. This will be useful in general as it allows greater flexibility. In fact, to the purpose of getting in sync with the real account is actually immaterial if a virtual order is added before or after the rollover. (Clearly, this is a special case, arisen from the fact that our position was already liquidated by the broker, while ordinarily on ordinary roll over we move the position to the next contract before the expiration.)

    Now (after the rollover, position resync and transform of virtual orders into players) the 3 CL layers (updated to the mew contract CLN5) look as follows:

    CLN5.png

    We can note that the 2 "hedging" layers even if reached a good PNL (about 127K and 50K respectively), when the price retraced a bit down, could not actually cash in (close the buy players) and practically gave (almost) all back, as there were no enough resources for further short positions (most of which required by the layer with large DD). So the situation becomes a lot of "reciprocal deadlock" across layers, where profits can be only partially realized and only when some funds become available.
     
    Last edited: May 20, 2015
    #88     May 20, 2015
  9. Still surviving amid various liquidations (mostly occurring when going overnight) which we can "resync" as soon as the report is available by the broker:

    Liquidation_2.png

    the situation of the 3 CL layers is as follows:

    CLN5_1.png

    As expected the 2 "hedging" layers could not close the buy players due to lack of funds and also there are a number of new buy players resulting from several liquidations (practically "forced stops") at pretty high prices, eventually converted into automated players. The most recent liquidation is the one indicated in the yellow circle containing the resync order (15 contracts, which will also be turned into a player).

    Total of commissions is about 170K.
     
    #89     May 27, 2015
  10. More liquidations in the last couple days on CL going up, but account still barely alive :). I have re synced the platform with the underlying account by "projecting" new fills (eventually transformed into automated buy players):

    liq_2.png

    liq_3.png

    CLN5_1_1.png

    CLN5_2_1.png

    Another liquidation yesterday:

    liq_4.png

    which I am going to resync now.

    Currently, the problem is that the buy players can't be closed due to fund shortage. However, the presence of several previous buy players causes the short position to be automatically recreated every time the fund margin requirements decrease again (on exiting the overnight margin requirements).

    The layer with the large DD has decreased the number of buy players (these were causing constant "sell pressure"). On top right the virtual fill of 16 contracts (green dot), to resync after liquidation. Due to fund shortage, in practice, most of these players have just "migrated" to the other 2 layers (long).

    CLN5_0_1.png

    Now we can continue, in perfect sync with the underlying account. The account situation is pretty desperate :) , but actually from a developer point of view a very useful situation to test the application under extreme "stress" and I have been doing a number of useful refinements to deal with all the various occurrences happening in these cases.
     
    #90     Jun 4, 2015