Trading with automation (with IB) - II - spreads

Discussion in 'Journals' started by fullautotrading, Jan 8, 2018.

  1. traider


    You can't create entropy from processing info. Please enlighten
    #11     Jan 12, 2018
  2. High entropy (say, in general, a measure of randomness) correlates to high information (say, in general, a measure of uncertainty), however the keyword here is "useful", not information.

    Or, another more complete phrase we might use is: "useful to the purpose of generating long term systematic profit".
    This has parallels in the concept of "sufficiency" in statistics: we only want sufficient statistics, in the sense that it must embed all the information useful to the desired purpose (estimation in that case).

    For instance, for deciding whether to start a trade, I could get the information whether or not a flock of birds is flying over my building. Would that be useful to the purpose of generating systematic long term profit?

    The market is obviously generating data, and therefore information.

    Let's make an example. Say that CL has been crossing a lower Bollinger band. Or, in general, the mkt data has triggered my open "signal" and I am going to apply some deterministic take profit or take loss rule to close the trade. The question is: is this information really "informative" to the purpose of generating profit ?

    The approach I am taking arises from believing that the answer is the same you would probably give about the above flock of birds. (It's rather a philosophical stance, however, it is reflected in the way I approach the trading methodology.)

    As I see it, the kind of information a trading agent needs, is rather that arising from its trading scheme, because the overall "cloud of orders" it is generating must end up (sometime in the future) being profitable, so it must abide to some form of internal "consistency", which derives by the way it uses the data coming from the market.
    Last edited: Jan 12, 2018
    #12     Jan 12, 2018
  3. We have gone "underwater" just before the weekend and the mkt holiday. Just today the PNL returned a bit higher (around $11K, 74 fills so far, with $178.33 comms):


    so far no problems as the instrument did not move much:


    We have NG (NG FUT 201803 NYMEX 10000 Henry Hub Natural Gas [ NGH8 ] ) in drawdown, since it has 3 short players open, and it could not scalp much during these very few days of activity:

    #13     Jan 16, 2018
  4. traider


    For any instrument X, how do you choose the best hedging instrument Y?
    #14     Jan 17, 2018
  5. Hello traider, thank you for the question.

    In this illustration, for instance, in order to hedge the layer called CL FUT 201803 NYMEX 1000_L1, which is trading the futures contract CLH8 (Light Sweet Crude Oil), I have simply defined a "clone" layer called CL FUT 201803 NYMEX 1000_L2 which is trading an (identical) "clone" of the previous one. Therefore, in this case, we have 2 copies of CLH8, one of which is designed as "hedger" of the other one:

    Same thing for the SIlver index.
    #15     Jan 17, 2018
  6. We are still up, since the instruments are "going nowhere" and the scalping engine has therefore an easy time to grab some profit. Around $15K as to today, with a total of 95 fills and $229.74 in commissions:


    A view "by instrument", where I have paired (with cyan rectangles) the pairs instrument/hedger:


    The "hedgers" are slightly negative, as some hedging player obviously remained open when the price reversed.

    (I have some new intuitive idea to improve further the hedging mechanism, and I am running a few simulations to confirm it.)
    #16     Jan 18, 2018
  7. Some instruments such as NKD, SI, NG are getting closer to their expiration date and we get a notification on screen. Eg, NG:


    I have already rolled over NKD and I am going to show in minuscole detail, once for all, the rollover procedure for NG so that it can serve as a reference.
    The purpose of the procedure is to "transfer" the trading information to the new instrument [ NGJ8 ] so that the trading platform loses no information.

    In practice, this is done in few seconds, once one is familiar: I will show the various screenshots just for clarity.
    First of all, we add the new instrument in the list of instruments to be loaded and we load it:


    so we have it running:


    then, we start the rollover of our (old) instrument by selecting the task in the context menu:


    this will open the rollover window, where you choose the target instrument (the platform in its generality would even allow to "rollover" across any options or even from a stock to another stock):


    then in sequence: 1) you click on "Start rollover" which will set both instruments in "manual" mode (to avoid executions during the process) 2) add the player needed to flatten the instrument and 3) click on "Transfer" in order to move all the trading information to the new layer:


    Finally, we recreate the position we had (we where short 1) [this can be don in several way: I prefer to "inject" first an "out of game" order, and later decide if and when I want to "transform" it into an automated player]:


    In this case, the combination of backwardation and short position works against us, since the resulting trade is obviously a negative one. However, since both orders are (or can be transformed into) "players", they can both be "recovered" in future (possibly resulting in positive trades).

    So, this is the final result of the "information transfer" (rollover), with the sell order transformed into an automated player:


    Now, the same thing can be done to the other layers needed rollover. In the case of SI(lver), since we defined an "hedger", when rolling over the instruments all the information about the "hedging relation" which has been established (by us) between the instruments will be transferred to the new instruments (we talked before of "inheritance" of the relation), so we can continue trading forever just "as if" the price flow were "uninterrupted".

    Folio PNL has not changed much since last time we saw it, since these instruments are "calm" at the moment:

    Last edited: Jan 23, 2018
    #17     Jan 23, 2018
  8. Finally, we start to see some drawdown, as CL becomes more "agitated", and we can take a look at the working of the hedgers. Since we started, a few days ago, CL swiped a relatively small range of almost 8%. The last move upward has caused the "hedged" layer CL FUT 201803 NYMEX 1000_L1 Light Sweet Crude Oil to "load up" on the sell side, with consequent decline of PNL:


    This is due to the fact that, as explained before, we have disabled the "protective" players of the game plaid by of this instrument, and therefore it is relatively free to load up a "contrarian" position (up to the game limit).

    On the other side, this is not happening on the other layer CL FUT 201803 NYMEX 1000 Light Sweet, which as you may remember from earlier post is the layer which has no "hedger" associated with it, but it is running a game with "protective" players (which intuitively are the equivalent of (recoverable) "stop loss" orders in ordinary approaches):


    So the L1 layer is running without protective players, but has an "hedging instrument" associated to it (CL FUT 201803 NYMEX 1000_L2) which is providing a layer of "protection":


    in fact, we have 3.3K "recovered" of the -5.6K of the main layer, which sounds good (almost 60% savings on the "load up" or investment):


    (the rectangles indicated the 2 pairs "hedged/hedger" for CL and SI).

    And this is the overall graph of equity so far:


    The concept of an "external" (=on an overlaid layer) hedger seems ok, and, somehow, it is even more clear to look at the hedging action on a separate layers, instead of (or in addition to) the ordinary mechanism we use of player superposition. (There are however some implementation complexities which need to be examined in detail.)
    #18     Jan 25, 2018
  9. Another week is gone. Overall, not much happened to our instruments. Observed range for our futures instruments are approximately: 8% for CL and NG, 5% for ES and NKD, 7% for SI.

    Overall PNL situation, instrument by instrument, is:


    Compared to last time we checked it, the differences are.

    First of all, I added an (active) instrument. It's CL PUT: since CL were short of a few contracts it seemed logical, as "complementary game", to sells a few puts in order to "get paid" for our time while we wait a reversal. This will expiry soon (on 14/2).

    The 2 CL pair: "hedged/hedger" have turned both positive, evidently by effect of favorable scalping action. ES and SI remain in good shape, while the PNL for NKD and NG has gone down.

    Overall equity at this time:


    Volatility has been going up a bit, as also shown by the chart of the VXX ETF:


    (If this continue, we might also play, with moderation, some other game by putting some short trigger on peaks to exploit the rapid decay of these kind of instruments. This is a "complementary game", we have investigated in the past. It's a bit controversial, as the interest paid is quite high, but if plaid on very large peaks and with enough capital, it can be sustained most of the times.)
    #19     Feb 3, 2018
  10. Yesterday volatility has finally "exploded". Unfortunately, I was busy with work and other affairs so I arrived a bit late to watch the party.

    The trading engine did quite well all by itself, in fact when I arrived the PNL was peaking up. I decided to "reinvest" a little bit on a position on VXX and SVXY (which right now looks like it has been halted). Just a complementary small bet around our main game, to earn some extra buck from the sudden spike and the rapid "decay" of these ETFs.

    Situation instrument by instrument:


    and PNL trajectory:


    We are about 35K up, but we have been using almost nothing of the available capital. It's probably time to double the default "packet" for each layer (right now set to 1 contract), to start investing a bit more.
    #20     Feb 6, 2018