Automated folio trading - Role of Information and Hedging

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

  1. Just closed a "scalping session" on CL.

    This time, instead of let it run forever, I set up a take profit at about 8K.

    I prefer to do that at the moment because this way I have time to think again, make possible changes on the scalping parameters (frequency is too high to trade futures with this account, I must reduce it) and also possibly let the mkt breath before re-engaging it.

    All orders:

    CL_3All.png

    Only open players (instrument in manual mode right now: I will start a new layer)

    CL_3Players.png

    I have also closed the ("speculative") pair of options

    +3 call 60 (march 2015)
    -2 put 56 (march 2015)

    because they were both in profit and there are good chances CL will continue to fluctuate for a while, so we have time to replicate it some more times.

    Call 60

    CL_Call60.png

    Put 56

    CL_Put56.png

    The IB info communicated through API report the following account situation:


    Code:
    ACCOUNT INFO from IB (Accounts in login: DU212781 Selected: DU212781)
    
    
    ============================================================ DU212781 =============================================================
    
    Session account (where orders are sent) is: DU212781
    Acct update event last received from IB: Mon 22 Dec 2014 14:57:59:126 [ Mon 22 Dec 2014 08:57:59:126 edt ]
    
    
    - Currency: USD Exchange rate: USD/USD 1.00
    
    - Current values (received on: Mon 22 Dec 2014 14:57:59:126 [ Mon 22 Dec 2014 08:57:59:126 edt ]) -
    
    AccruedCash                         0.00 USD                      [Min: 0.00, Max: 0.00]
    AccruedDividend                     0.00 USD                      [Min: 0.00, Max: 0.00]
    BuyingPower                 3,860,096.07 USD                      [Min: 2,927,586.33, Max: 6,666,666.67]  (6.67 x 578,506.81)
    FullAvailableFunds            578,506.81 USD                      [Min: 431,633.40, Max: 1,000,000.00]
    FullExcessLiquidity           579,014.41 USD                      [Min: 439,137.95, Max: 1,000,000.00]
    FullInitMarginReq             453,009.70 USD                      [Min: 0.00, Max: 587,490.78]
    FullMaintMarginReq            452,502.10 USD                      [Min: 0.00, Max: 579,986.23]
    NetLiquidation              1,031,516.51 USD                      [Min: 935,121.84, Max: 1,032,426.59]
    
    
    
    - Initial values (received on: Mon 08 Dec 2014 15:19:16:873 [ Mon 08 Dec 2014 09:19:16:873 edt ]) -
    
    AccruedCash                         0.00 USD
    AccruedDividend                     0.00 USD
    BuyingPower                 6,666,666.67 USD
    FullAvailableFunds          1,000,000.00 USD
    FullExcessLiquidity         1,000,000.00 USD
    FullInitMarginReq                   0.00 USD
    FullMaintMarginReq                  0.00 USD
    NetLiquidation              1,000,000.00 USD
    
    Current - Initial (elapsed: 13.99 days)
    
    Δ AccruedCash                       0.00 USD  0.00%
    Δ AccruedDividend                   0.00 USD  0.00%
    Δ BuyingPower              -2,806,570.60 USD  -42.10%
    Δ FullAvailableFunds         -421,493.19 USD  -42.15%
    Δ FullExcessLiquidity        -420,985.59 USD  -42.10%
    Δ FullInitMarginReq           453,009.70 USD  -42.10%
    Δ FullMaintMarginReq          452,502.10 USD  -42.10%
    Δ NetLiquidation               31,516.51 USD  3.15%
    
    
    ================================================== DAILY FOLIO UPDATES SENT BY IB ==================================================
    
    Symb                                    Pos/AbsPos             AvgCost                Real                 Unr          Real + Unr     Curr
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
    CL        [CLZ5]                                 0                0.00            21222.22                   0            21222.22      USD
    ····································································································································
    DGAZ      [DGAZ]                             -2358                5.43             -458.67            -2408.92            -2867.59      USD
    ····································································································································
    ERY       [ERY]                               -367               20.31               -8.54              -69.57              -78.11      USD
    ····································································································································
    ERY       [ERY   150117C00027000]             -200               69.21                   0             4553.65             4553.65      USD
    ····································································································································
    ERY       [ERY   150117P00024000]              -50              259.20                   0            -10469.8            -10469.8      USD
    ····································································································································
    ERY       [ERY   150117P00031000]              100            1,070.79                   0             3021.18             3021.18      USD
    ····································································································································
    ERY       [ERY   150417C00025000]              -80              459.20                   0            14552.77            14552.77      USD
    ····································································································································
    ERY       [ERY   150417P00025000]               50              620.79                   0             3353.59             3353.59      USD
    ····································································································································
    CL        [LOH5 C6000]                           0                0.00             1966.14                   0             1966.14      USD
    ····································································································································
    CL        [LOH5 P5400]                          -5            3,607.69                   0              990.85              990.85      USD
    ····································································································································
    CL        [LOH5 P5500]                          -5            4,377.69                   0             2801.52             2801.52      USD
    ····································································································································
    CL        [LOH5 P5600]                           0                0.00              590.76                   0              590.76      USD
    ····································································································································
    CL        [LOH5 P5700]                           6            5,562.31                   0            -4893.59            -4893.59      USD
    ····································································································································
    CL        [LOH5 P5800]                           5            5,852.31                   0            -2923.42            -2923.42      USD
    ····································································································································
    CL        [LOH5 P6000]                          -2            5,047.69                   0            -2765.43            -2765.43      USD
    ····································································································································
                                                 3,228                                                                  29,054.74 USD
    ____________________________________________________________________________________________________________________________________
                                                 3,228                                                                  29,054.74 USD
    ====================================================================================================================================
    
    
    ============================================== NOT MATCHING PRESENT IN THIS INSTANCE ===============================================
    None
    ------------------------------------------------------------------------------------------------------------------------------------
    
    
    ================================================ POSITIONS STRANGER TO THIS INSTANCE ===============================================
    None
    ------------------------------------------------------------------------------------------------------------------------------------

    Which, of course :), does not match with my own PNL computations which say instead we are still about -15K. (Evidently I and IB compute the PNL for the open position of options in a different way.):

    PNL_1.png

    instrument-wise:

    PNL_1_Instr.png


    However, when the close, we do agree :) at the penny (cfr the 2 pictures above), which is reassuring.

    Code:
    ····································································································································
    CL        [LOH5 C6000]                           0                0.00             1966.14                   0             1966.14      USD
    ····································································································································
    CL        [LOH5 P5600]                           0                0.00              590.76                   0              590.76      USD
    ····································································································································
     
    Last edited: Dec 22, 2014
    #11     Dec 22, 2014
  2. I have started a new layer for CL:

    CL_4.png

    I have also made the game less frequent and slightly changed the terminology for the scalping parameters (and "grouped" visually the rules). Instead of using the terms "outer" and "inner" entries, seems more appropriate to use the terms: averaging and pyramiding, which gives a more immediate understanding of what distances we are considering:

    NewParams.png

    In essence, for buy players the "averaging" distance is the distance of a new buy player from the nearest above it, while "pyramiding" is from the nearest below it. For sell players, the situation is just symmetric. The unit of measure is, as always, the 0.1% of price.

    Distances.png

    The reason why I like to differentiate between "averaging" and "pyramiding" distance, is that, depending on the "phase" "loading/protecting/reversing/realizing") we are, it is just nice to be able to control them separately.

    Now the situation appears momentarily slightly "in the green" for my app too (while IB gives a +24.9K, probably because it does not include the closing expenses).

    PNL_2_Instr.png
     
    #12     Dec 22, 2014
  3. The new CL layer has started placing some orders, 17 fills so far. Overall PNL still underwater for the layer, but scalped away about 1K, which is not bad

    To make this information more evident in the app, I have also added an additional on screen-info (see circled green figure "closed players"). I think this info is a useful complement of the "G-L" figure ("Gain - Loss"), because this one it is not based on "order pairing" (that is, the "shares identification" method used), but it gives straight the exact amount scalped away by the players which could close thus far.

    CL_5.png

    (picture shows the "all orders" view)

    In the meantime, I have also replicated (and noted it in my brand-new "notes" facility) an option structure similar to the one we closed before in profit, to try make another option "scalp" with it:

    +3 CALLs 60 (Feb expiration)
    -2 PUTs 55 (Feb expiration)

    CL_Opt_2.png
     
    Last edited: Dec 23, 2014
    #13     Dec 23, 2014
  4. +3 CALLs 60 (Feb expiration)
    -2 PUTs 55 (Feb expiration)

    I have closed it already. Made $306.14 on CL FOP 201502 60 C NYMEX 1000 Light Sweet Crude Oil [ LOG5 C6000 ]
    and $310.76 on CL FOP 201502 55 P NYMEX 1000 Light Sweet Crude Oil [ LOG5 P5500 ]

    not bad for a 5 minutes incursion :)

    Opt_Incursion_1.png

    (If I just had more time to dedicate to these things .. )
     
    #14     Dec 23, 2014
  5. Since we are playing a bit, I had an idea for another experiment.

    We have been adapting the games to various "drifts" and for instance applied the biased scalping games to various leveraged ETFs which have an apparent drift.

    Looking at CL options and noticing how liquid and relatively tight they are, one idea could be that of applying the automated game to the (long) options themselves. Why ?

    Since we are anyway using long options to protect a "long-biased" scalper on CL, it may be interesting to explore the possibility to automatically scalp the option itself with a "short-biased" game.

    In fact, in case CL goes up, the option would experience a massive decay and we may want to scalp that. If CL goes down the option will go up, but since the option has already a relatively large position, that should be ok.

    Since we never attempted to scalp options. We might give it a try to see if the scalping engine needs adjustments in this case.

    I will give it a try with:
    CL FOP 201503 58 P NYMEX 1000 Light Sweet Crude Oil [ LOH5 P5800 ]

    which currently has a position of +5, a delta of -.51 and IV of about 51%. I will activate the "Bias-" with a short-position constraint, and we will see...

    PS
    and also to:
    CL FOP 201503 57 P NYMEX 1000 Light Sweet Crude Oil [ LOH5 P5700 ]
    (current position: +6)
     
    Last edited: Dec 23, 2014
    #15     Dec 23, 2014
  6. Added another pair:

    +4 CL FOP 201502 61 C NYMEX 1000
    -2 CL FOP 201502 57 P NYMEX 1000

    CL_Opt_3.png
     
    #16     Dec 23, 2014
  7. ok. Closed this "incursion" too (another $1,700 which won't hurt :) ):

    Opt_Incursion_2.png

    The logic for these "incursions" is obviously to grab as many scalps as possible, by replicating the action, while the instrument fluctuates and before the it starts running for real, in which case we have the CL layer ready to kick in with the automatic players:

    CL_6.png

    Clearly, in our scalping / hedging approach we are more focused on fluctuations than just sitting waiting for some large directional moves on a large timeframe.
     
    #17     Dec 23, 2014
  8. End of day... and begin of some overnight fun with CL :)

    Situation currently as follows. IB credit us with $47K in terms of of net liquidation, even though my app shows we have "actually" made about $11K. Not bad for 15 days.

    All looks fine except the short position on ERY put 24 (see yellow circle below). In hindsight, I think I was definitely sleeping when I opened it and it's clearly a mistake (won't do it again :) ).

    I can't "take it back", but tomorrow I will try "correct" it, by opening some short calls (around 24). So, it either gives me back that ugly loss or I will make a boatload on the short calls, and, if the price rises beyond that, I would be anyway happy to have a large short position on ERY at that price.

    PNL_3.png

    Certainly, trading the ERY options, once you tried CL's, feels pretty much like riding a wreck after you tried a Rolls Phantom.
     
    Last edited: Dec 23, 2014
    #18     Dec 23, 2014
  9. How about some general strategic considerations, taking advantage of the holidays ?
    Happy holidays by the way! :)

    As you can notice I have arrived essentially at the conclusion that we need to perform creatively and dynamically, by using all the arsenal of tools that both mkt, technology and our own personal productivity put at our disposal to realize the best performances.

    In the past, I have tried several "avenues", ranging from trading without stops to hedging with the same instruments being traded, with a lot of variations in the middle.
    What we gathered from these tests is that, in fact, we need an articulate approach to trading where everything must be used according to what it does best. So while hedging through automatic player superposition is certainly very effective, on the other hand, it cannot provide a complete answer to the problem of profitability. In this sense, it appears that an appropriate use of options is also fundamental to complete the picture.

    Why is this so? By its very nature the automatic scalper tends to give the highest profits when the price passes multiple times over the same price ranges. The reason for that is obviously the fact that this way a larger number of players can close successfully.

    For instance, if there existed an instrument forever continuously ranging in a relatively small price range with high volatility, we would actually be running a "mint" :) Problem is that such an instrument does not exist at all in the real world (or I have missed it), but we need to deal with relatively large or even unlimited price ranges (like for the leveraged ETFs), and various drifts for most instruments.

    Another difficulty, that we see in instruments like stocks is the particular microstructure they have which makes them, in practice, unsuitable for scalping activity. In particular, there seems to be a "gapping" component dominates the moves, while the intraday moves tend to be not exploitable with an automatic scalping engine (either "flat" or "vertical").

    These consideration restrict de facto to 2 possible classes of instruments:

    - futures
    - leveraged etfs

    [forex pairs actually makes no sense to consider from our perspective as for most significant pairs exist in the form of futures + options. They make sense only to traders with no capital, who should not be trading at all and make wiser use of their little money.]

    Obviously, the scalping engine activity is most suitable to provide effective hedging action during the phases where there are a lot of fluctuations, compared to vertical moves.
    This is right where a human trader (or options) would have the greater difficulties to trade, and there really nobody can beat the machine. On the other hand, the scalping engine becomes practically ineffective and unarmed on gaps or large moves with no retracements, and there we do need to enforce other hedging devices, like options, or else there is no automated scalping activity that can help. So, these are actually complementary tools and hedging devices that we need to learn use together for best synergy. Clearly, there is a learning curve in this process. And therefore experience and practice and learning through errors and experience are anyway crucial elements.

    It may seem odd that I myself, have to learn use my own application for instance, but that seems the way it works, and also there is a feedback from actual experience toward the application itself. Pretty much, I imagine, like when the Wright brothers where creating their airplane prototypes: even though there were creating them, they still needed to learn how to drive them, and when they had difficulties to control them, they needed to go back to the drawing board or their shops and redesign some mechanical components or find new ideas (see: http://en.wikipedia.org/wiki/Wright_brothers).

    On the other hand, when the plane was relatively stable, and they could drive it, still people wanting to drive the same plane had a steep learning curve, and still many people got killed in the process. On the other hand, many pilots developed skills way beyond the original designers. But nowadays we have thousands flights everyday and flying now is a relatively save activity.

    When trading we do have "balance" and "control" problems which do have analogies with the difficulty of keeping stable a plane or an helicopter and we do need to work out some basic principles which can at least provide general guidelines, on top of which personal skills can add further value.

    In the following posts, I will try, whenever possible, to extract the general principles which can be of general usefulness and keep the navigation safe and productive.

    In the picture below, a quick preliminary scheme of some useful "option structures" which can complement the scalping engine, respectively under long or short "drift" (or directional long-term expectation) which we can use as general future reference to understand the "logic" of the options which are being used:

    Options_GeneralSchemes.png

    (where the time-decay-neutralizing options, could be replaced, or integrated, with CALLs or PUTs under some circumstances and depending on preferences). The app provides the facilities to compute the combined time decay of all options and make sure we keep it positive.

    As previously discussed, regarding the part on the right (short-biased scalping), we have seen in previous tests it is not really viable for downward drifting leveraged ETFs (ERY, VXX, TZA, etc) for various practical reasons and we should, rather, replace the short-biased scalper, for instance with one of the 2 following alternative schemes:

    DownwardScalping.png

    Where the preeminent short position is maintained through the deep ITM PUTs. (In the second alternative, clearly the number of shares must be chosen in such a way that combined with the long ITM PUTs we have an overall short position.)

    Here an additional benefit provided by the deep ITM PUTs, as replacement of a share position, is the limited upward risk (if we also use PUTs to neutralize the time decay). For instance, in case of a "monster gap" upward, we might save all the DD from the strike up to the point where we, later on, recreate the short position to eventually ride the drift.

    On top of all above ideas, another idea we have started exploring lately is to also scalp automatically the long options themselves. This way we might save a good deal of time decay. Clearly, this is possible in the real world only with the very "top" instruments (ES, CL, etc.) which obviously are not many (forget the ERY, NUGT, and alike), and require good capital.

    The purpose of the app is clearly, first of all, to provide the most efficient automated scalping engine to deal with price fluctuations and, also to provide a suitable environment where the fund manager can convey his "driving" skills.
     
    Last edited: Dec 25, 2014
    #19     Dec 25, 2014
  10. A lot of action just after the holidays, with crude oil (CL) plunging quite massively to new five-year low: http://www.reuters.com/article/2015/01/06/us-markets-oil-idUSKBN0KE06V20150106
    We have also taken a substantial hit with a large drawdown (15%).


    In this case he DD was only in very small and rather acceptable measure caused by the scalping action (just 2%), which hedged quite well (I am dealing with December 2015 contract):

    CL_7.png

    Same thing for DGAZ. (ERY shares remained stuck because of the the problem of being not shortable most of the time).

    The rather totally "disastrous" part is represented, instead, the ERY options which added a massive and scarcely containable DD:

    PNL_4.png

    We have 1 error and 1 excuse: the "error" is the position too large and actually unnecessary(since the scalping of ERY was actually "blocked") with ERY options, the "excuse" is that this stuff, unlike CL options, once open, it is totally unmanageable due to the prohibitive spread (ridiculous values like about 50% are not uncommon at all):

    ERY_Spread.png

    (In practice and slightly exaggerating, when you buy an option of these it's like you are paying all the decay in advance, or if you sell it you get the premium only at expiry: so you are "stuck" with it). In addition to that, we cannot even try to place a closing order using some "midpoint" in between bid and ask (which on a real account might have some chance to be executed, but no chance on a Dxxx account).

    Anyway, in few days (16 Jan) the ERY options will expire and in the future will use them only when strictly necessary.

    In the combination of automated scalping action and options, it appears that one crucial problem is the right balance of these 2 separate components. In fact, if we use too few options, then there might be insufficient "protection" against vertical moves. But if we use too much, in practice we are making the "horizontal scalping" component marginal, respect to the option trades, and that is not what we want, because we want the option to play, mostly, a protective role, and not dominate the game.

    Once we get out from this dd, I wish to link more precisely the scalping action with the option position. We might try that first at conceptual level using the mechanisms we already have, and, then, introduce some more automation if necessary.

    The idea I have is as follows (this is for a long-biased trading, for a short bis, just exchange puts and calls):

    AutomationScheme.png

    We need to watch periodically that the protective PUTs be balanced with the futures contracts which are traded automatically, and while the futures moves we need to add more strikes and watch for the balance.

    Also the long options will also be scalped automatically, with a short-only constraint, so we have an additional mechanism to recover some some time decay (when the price moves up we do not need to just stare at the put plunging down).

    [Clearly, this can be done only with liquid instruments, like CL, ES, and similar, certainly not with the ultrashort ETFs which, when they have them, have very illiquid and problematic options]. The short options, instead, should not be scalped (or they might, in case one wishes to take more risk).

    Some more time decay can be recovered by selling some CALLs and PUTs. I intend the process in a dynamic sense, so we need to be able to dynamically adjust the various structures as the trading proceeds.
     
    Last edited: Jan 6, 2015
    #20     Jan 6, 2015