Algorithmic Trading a large folio with small orders

Discussion in 'Journals' started by fullautotrading, May 3, 2012.

  1. kabalgr

    kabalgr

    Just started testing the new version with paper ib account.
    For now seems to be working well and smooth, cant wait for update so eventually i can move to real money account.
     
    #51     May 30, 2012
  2. HI

    Is your hedging strategy just based on cointegration ?

    or further items as price and volatility changes are required.

    BTW, which tool or formulae do you use for volatility changes ?

    Thank in advance

    regards
    john
     
    #52     May 31, 2012
  3. Hi John ,

    thanks for asking that, it was also partly explained in the previous posts (see formulas above). <b>Volatility</b> is always take into account for both mechanisms:

    - <b>Packet size auto-calibration</b> (this uses price, multiplier and volatility to allocate evenly risk across instruments)
    - <b>Cointegration hedging</b> (this uses volatility to "weight" the "volatility-ajusted exposition" of cointegrated instruments).

    One cannot leave volatility out of the equation, as intruments have deeply different dinamics, and the same nominal value can clearly mean a totally different exposition depending on the instrument volatility. So ignoring volatility would lead to a wrong (unbalanced) risk allocation, i think.

    To answer your question "Is your hedging strategy just based on cointegration" ... no actually that is just one aspect of several hedging devices which are in place.

    The most important are:

    <b>[1] * Microlayering *</b>
    - Games (scalping action played on single instrument): they are inherently self-hedging, because, for each game, we have 2 opposite teams, called CT and T which "play" asynchronously one against the other (depending on the user setup).

    <b>[2] * Macrolayering *</b>
    - Instruments can be layered so that one async instance of an instruments can hedge existing layers of the same instrument (with which will have cointegration 1, and the cointegration rules will force the new layers to hedge asynchronously the existing ones)

    <b>[3] * Folio balancing *</b>
    - Even allocation of small risk on many instruments, to possibly avoid solitary "run away".

    <b>[4] * Cointegration hedging *</b>
    - Correlation relationships are turned into an "advantageous force", as they are used to "force" scalping entries in such a way to possibly hedge the existing exposition.
     
    #53     May 31, 2012
  4. Ok many thanks

    I am going to check the messages below
    I have an another question.

    Where to find the Cointegration matrix program shown in your previous post ?

    regards
     
    #54     May 31, 2012
  5. That's just a screenshot of my app. (I make it freely available to interested people and can be requested from <a href="http://www.datatime.eu/public/gbot/#copyrequest" target='blank'>here</a>) . The cointegration index varies within -1 and 1 and by googling "scx cointegration index", you will find it soon.
     
    #55     May 31, 2012
  6. Occam

    Occam

    But it's not really good for the market -- internalization trashes the market for the benefit of brokers. Ultimately there is a cost (easily in billions per year) to everyone else.
     
    #56     Jun 1, 2012
  7. Ah yes ? Why is this so ? How does it work ?

    For retail traders this would seem something positive: if we had to trade multiple of 100 for all instruments, we would probably be soon in troubles (unless serious cap is used) ...
     
    #57     Jun 1, 2012
  8. Ok let's see what we have here.

    The <b>cointegration rules</b> blocks a lot of trades (those which would increase "unilateral exposure").

    As a result even juggling 42 ETFs and 2 futures (the small VM) my margin usage has been around just 1K (using the default "Bounds3" game). Now it is:

    <code>
    FullInitMarginReq: 1554.36 (Min: 1312.55 Max: 2678.36) EUR
    FullMaintMarginReq: 1554.36 (Min: 1312.55 Max: 2678.36) EUR
    </code>

    In about 3 weeks we have almost $500 net profits. The ETFs have still a potential for profit because there is a relative massive investment going on on single instrument (UNG), which is in sharp and solitary drawdown (we call it "investment" ;-)) )

    <img src="http://www.elitetrader.com/vb/attachment.php?s=&postid=3549610" width="1000" />
     
    #58     Jun 11, 2012
  9. This means that to make good use of the small capital i have in this account, <b>i need to increase the number of instruments </b>and probably the frequency.

    I have also raised the <b>cointegration threshold to 0.5</b>, to allow more exposure.

    The following picture gives an overall view of the folio. Followed by the "bad guy" (UNG) and a "good guy" (TVIX).

    I can follow UNG to the abyss. And actually when it will hit the bottom, i may just have the right size to be on the buy (right) side ;-))

    <img src="http://www.elitetrader.com/vb/attachment.php?s=&postid=3549621" width="1000" />

    My friend Michael (who will be soon juggling millions with our toy ;-))) by the way ) has suggested to work put a <b>measure of global exposition</b> based on <b>cointegration and volatility</b>.

    I think this is a brilliant idea, and i think in next posts i will be also discussing some ways to measure that. To get your valuable feedback and help, as usual.
     
    #59     Jun 11, 2012
  10. Here are some draft notes on the use of cointegrations and volatility to the purpose of balancing a folio exposure. I have also posted this also on a Linkedin <a href="http://www.linkedin.com/groups?gid=4394344&trk=hb_side_g" target="blank">group</a> for more feedback.

    Feel free to post corrections, proposals, comments or further research etc.

    <b>Notation</b>

    Let call the instruments Instr(1) ... Instr(n)
    the volatilities Vol(1) ... Vol(n)
    the signed values Val(1) ... Val(n) [taking into account multipliers, clearly]
    and the pairwise cointegrations CO(Instr(i), Instr(j)) = Co(i,j)
    RefVol a "reference volatility" and f = 1/RefVol a "volatility factor" to be applied to volatilities
    Also let's denote by 1[E] the indicator function of event E (that is 1 if E is true, 0 if E is false)
    Define VolExp(i) = Val(j) * f * Vol(i) a single instrument "volatility adjusted exposure".


    <b>Cointegration Rules</b>

    For any instrument Instr(j) i have defined the "volatility-adjusted exposure of instruments cointegrated with Instr(j)" as:

    CoI(j) = ‡” ( VolExp(i) * 1[ Co(i,j) > T ] ) - ‡” ( VolExp(i) * 1[ Co(i,j) < -T ] ) (i‚j)

    Now if Instr(j) is closed we have been adopting the "cointegration rule" :

    if CoI(j) = 0 then do nothing (no constraints on Instr(j) entries)
    if CoI(j) > 0 block LONG entries
    if CoI(j) < 0 block SHORT entries

    Now it's time to develop further this rule. Let's consider the general case where Instr(j) may have also a nonnull position. ( Let's denote the position as Pos(j) ).

    In such a case we can apply this extended rule:

    if CoI(j) = 0 then do nothing (no constraints on Instr(j) entries)
    if CoI(j) <> 0 then
    ... if CoI(j) + VolExp(j) > 0 block LONG entries
    ... if CoI(j) + VolExp(j) < 0 block SHORT entries

    Finally, we can generalize this further by introducing a sort of "indifference" zone or <b>"tolerance threshold"</b>, to avoid an immediate blocking, and allowing some exposure before starting the unilateral blocking:

    if CoI(j) + VolExp(j) > TL block LONG entries (TS positive)
    if CoI(j) + VolExp(j) < TS block SHORT entries (TS negative)

    the 2 thresholds TL and TS could be exposure levels specified by the trader.

    However, too avoid subjectivity, they could also be computed automatically. For instance as:

    TL = a fraction of min ( |VolExp(i)| such that Co(i,j) > T )
    TS = a fraction of max (-|VolExp(i)| such that Co(i,j) < -T )

    where the fraction could be for instance 0.5 or any other < 1.

    This would allow an excellent control of unilateral exposure by allowing also some tolerance when anyway the overall exposure of a set of cointegrated instrument isn't very high.

    Next we will see how to measure global exposure of a folio, using cointegration relationships and volatilities.

    My friend James (Canada) had also the brilliant idea to "modulate" the cointegration rules, so that, they instead of working as semaphores, would also affect order sizes. Currently order sizes are balanced at folio level by dynamically equalizing the max volatility adjusted exposures. This can be an interesting area of research that we might investigate later on.
     
    #60     Jun 12, 2012