Trading with automation (with IB)

Discussion in 'Journals' started by fullautotrading, Sep 8, 2015.

  1. I came back just to see the last ticks of the session. Another week is gone.

    We have been trading for 24.3 solar days, current maint. margin is around $38.K (max maint. margin ever seen around $67K). We have executed 281 lmt orders with $678.39 comms.

    PNL created is currently $34.4K (min PNL was just a brief peak of -$4.3K) and G-L is $72.4K. So we end the week with the "fireworks" of today's crazy fluctuations and a "stratospheric" performance:

    PNL_20.png

    Let's take a look, for instance on a ESZ5 layer, it was just crazy:

    ES_11.png

    and, similarly, one layer of SIZ5:

    SI_5.png

    Apparently, limiting the load on a single layer was the final, simple but crucial, ingredient which were missing from the approach, along with the long/short overlay.

    Now that we see it, it's obvious, that to continue capturing the fluctuations and "neutralize" the vertical components of moves you cannot let grow one side too much. Pretty obvious... in hindsight.
     
    Last edited: Oct 2, 2015
    #51     Oct 2, 2015
  2. :p
     
    #52     Oct 2, 2015
    fullautotrading likes this.
  3. Not much happening up to this new Monday morning, just 6 more fill. In the meantime the broker has ready the "statement" for the period up to Friday and we can see their report of the trades too (attached below) from its point of view. Clearly, looking at the trades on the broker report, it would be quite hard to infer the "logic" behind the orders (which I have explained here), as, in fact, what we have been doing is exactly equivalent (in terms of logic and final result) to trade multiple accounts with long/short constraints, and combine the results.

    In essence, the application is holding the entire logic to drive and supervise, from a unique "mission control center", the process of "player superposition" and "layer overlay", while, in "physical" terms, all the activity is "channeled" into the same account. It is also providing us with an insight into the G-L evolution, which is quite useful to follow the development of the scalping/hedging action.

    Most importantly, it is holding the trading information which we use to make new orders that are "consistent" with those already done. Since we do not care about "prediction", all the information is instead used to try ensuring that each "order cloud" being built on each logical layer is "self-consistent" and also provides an hedging action with respect to the other existing ("logical") layers.

    [ In essence, we have returned to what we started several years ago, but after a long "detour" and exploration in several alternate approaches (under the influence of "external sources") and the need of dealing with an unexpectedly high number of technical and implementation details. The most important difference is that, at that time, we were actually running on multiple accounts, before obviously realizing that all could be done better and much more powerfully (since we can create and coordinate as many "logical" layers as we want) on a single account. ]
     
    Last edited: Oct 5, 2015
    #53     Oct 5, 2015
    dartmus likes this.
  4. Starting a new day here, while yesterday we experienced some DD. It was mostly imputable to SIZ5 and NKDZ5. This is no big surprise, has we have already anticipated that this instrument, with its crazy volatility and moves, and relatively large multiplier, is going to challenge us. The DD was particularly sharp also because it appears that all layers of this instrument have managed to take the same direction (all short players are in exceeding number).

    In these conditions, according to my experience and since we are still looking ok after all, I would avoid doing anything and see how it evolves. Just in case it starts trading at a significantly different and higher price, we can start a new set of layers.

    PNL_21.png
     
    Last edited: Oct 6, 2015
    #54     Oct 6, 2015
  5. This morning we have some more DD, mostly due to CLX5 and SIZ5 which are pulling up.

    The fact that we are using small packets (=1 contracts) does not allow a "smooth" action for the hedging players, so I am afraid we must get used to these "locally steep gradients" in the PNL curve.

    PNL_22.png

    The "plan" it to to let it go as is and wait for 2 mutually exclusive possibilities:

    - if there is a reversal to previous prices we do nothing
    - in case the price of an instrument starts fluctuating for good at a "new level" we start a new set of layers

    The situation of the unrealized is as follows, where we can see that CL, NQ and SI are leading:

    Unrealized_1.png
     
    Last edited: Oct 7, 2015
    #55     Oct 7, 2015
  6. This morning the situation is looking a bit better, with PNL curve bouncing back. We have a pretty high G-L (over 90K), that is a "potential profit" whose actual speed of "realization" now depends pretty much on the evolution of the future price curves. Total number of lmt orders executed is now 327 (in about 30 solar days), with $797,91 gone in commissions. Current maint. margin is $87,6K.

    PNL_23.png
     
    #56     Oct 8, 2015
  7. Another week is gone (about 31 solar days) and we end it with a marked DD this time. This is caused mainly by CL and SI and in part by YM and NQ, all pulling up. ES, instead has continued to print money, probably due to favorable fluctuations. 327 lmt orders fo far, comms: $797.91.

    PNL_25.png

    Now since CLX5 has risen a bit, as explained in the previous post and according to our plan, we have added another set of layers.

    The general idea is to "occupy", if necessary all the instrument price range with various set of layers which will be in charge of scalping/hedging each one in the corresponding "price corridor":

    CLBarchart.png

    In the image above, the blue vertical segments on the right indicate possible "price corridors", at different "price levels", were we might open new set of layers.

    What I did not like in this run is the DD on some layers of CL and SI, which seemed a bit too much for my taste. The issue arises, as mentioned before because when there is only 1 contract open, the opposite "hedging" (or "stopping" if you prefer) player does not trigger, because the size is computed as a fraction of the other side and it does not even reach the unity. (To trigger it needs another sell player, and that causes a larger DD.) This is evidently an area of improvement I need to investigate. For the moment, this is going to cause some steep up and down locally on some pieces the PNL curve. Let's see if during the weekend I can find something to improve that behavior.

    Another thing I wish to try (but in a future run, not now, as we need to maintain consistency) is to use only 2 layers per instrument instead of 3, at each price level.
     
    Last edited: Oct 9, 2015
    #57     Oct 9, 2015
  8. I missed a couple updates and I am currently lying in bed with a leg up, after paying visit to a local hospital (gym accident). The application, instead, continued working as expected and I can see a few swings in the PNL curve mostly caused by CLX5. (People trading CL manually have been probably having fun making "predictions" ;).)

    PNL_26.png

    Maint. margin is at the moment around 94K. 35 solar days, 366 lmt orders, comms: $896.86.
     
    #58     Oct 13, 2015
  9. Today we are back to $22K PNL, but much higher G-L (Gain-Loss) which is towering at $106K.
    Executed 375 lmt orders in 36.3 solar days, comms: $920.37. Current maint. margin is quite small and around $75K.

    It turns out that having opened a new set of long/short layers on CLX5 is temporarily tapering our PNL because, since CL reversed quite a bit these days, the new layers have started "loading up".

    That is fine of course, as we are not predicting anything and just making systematic actions. Sooner or later that DD will also be recovered when CL will go up again, just as we are now recovering the DD occurred in the first set of layers when it shoot up.

    PNL_27.png

    SIZ5 is now in a similar situation, as it raised quite a bit, and if it actually starts trading at a significant different level of price, we will start a new set of long/short layers, just as we did with CL.

    ES and NKD are those doing better at the moment with just 1 set of layers. Evidently, they had kind of "fluctuations" and volatility which allowed to enter and exit more easily the various trades of the players.

    You see, here our PNL is fed mainly by the price fluctuations occurring on each "price corridor" (captured by a set of long/short layers) and, most essentially by the fact that, in principle, we can "recover" (or "undo") all our "stopping (or "hedging") orders".
     
    Last edited: Oct 14, 2015
    #59     Oct 14, 2015
  10. Let's recap a bit the approach we are following in this illustration, for those who have started following only recently.

    In essence, we start at the current price level by defining a "long/short scalping/hedging entity" which has certain "known mechanical abilities". In particular, this entity can be made of a set of 2 (or 3 as we are doing now) layers which in general terms work scalping in "opposite" directions.

    Since we do not rely on a price direction prediction, it's obvious that we are in a non-predictive realm (at least, in the sense in the specific sense that we do not care about price direction, as we start, almost independently, both long and short trades.)

    The "mechanical properties" of the "game" played by the set of layers are normally determined through extensive simulation study, and particular care is used to make sure that the properties are maintained through the space of all the conceivable "realistic" price curves.

    [ As corollary, backtesting alone is banned, as, in most cases, it would surely lead to adopt a "specialized" scalping/hedging game which, though the incredible efficiency of the PC in searching and adapting, would show incredibly good results on the fitted data, but very large losses in forward (real or paper) trading. At most it could represent just 1 of the curves to check "for curiosity" and, more importantly, a lead to infer features for the simulation study (eg. drifts, decays, contango, volatility levels, etc.). ]

    Once we have started such a long/short scalping/hedging entity, we simply work by replication of the concept whenever the price "escapes" to another significantly different "price level". The final effect should be that we might get a DD (drawdown) when the price tends to escape almost "vertically" from the the price levels where we have started the scalping entity. Instead, we will profit when the price either remains within the range of action of a scalping entity or even moves monotonically, but with enough fluctuations to close the scalps (eg, what happened so far with ES and NKD).

    Replication.gif

    Once we have "populated" the price range with enough of those entities, appropriately spaced away (eg. 10 of them might suffice), we should have players active and scalping price fluctuation all over the place, and every time the price returns to a "previous level", all the DD (drawdown) suffered by the corresponding scalping entities is recovered permanently.

    In very intuitive terms, this is like having the very crucial possibility to "undo" the "stop loss" (of "hedging") orders at a future point in time, due to the fact that we do not throw away the relevant trading information, as is normally done instead.

    [ Clearly, this is an approach almost entirely antithetic to taking "directional bets". As you remember, we tried that in a previous illustration and we almost bankrupted the account. However, I still think that some (small) betting could still be maintained as a complementary approach, if there is enough risk capital, but I'd say it should be triggered only on particularly favorable circumstances (so we might need to wait months just to trigger one) and then let run for good. ]
     
    Last edited: Oct 15, 2015
    #60     Oct 15, 2015
    dartmus likes this.