Skip to content

Using Margin in Blotter package

6 messages · Peter Carl, Ulrich Staudinger, Brian G. Peterson +1 more

#
No, although it isn't outside the realm of possibilities some day. 
Finding an enthusiastic author of such code has been, well, difficult.
As a quick but perhaps impractical solution, you could export your
positions to an external span engine.  Barring that possibility, I'd say
that you can do some back of the envelope calculations based on positions
and transactions kept in blotter to estimate margin use if you need.

Contributions would be welcome, of course.

pcc
#
Margin depends on both the instrument and the position.  Most exchanges 
use SPAN, and certified SPAN engines are extremely expensive.  Beyond 
exchange margin, your broker often charges additional margin, and may or 
may not cross-margin using SPAN.

Ulrich is right that you could add a field to your instrument data (in 
the FinancialInstrument package) to describe minimum initial and 
maintenance margin: that's trivial as the instrument model is 
deliberately extensible, but it's also useless because it doesn't cover 
cross-margining, and the only accounts that don't get cross-margin are 
typically retail.

Even funds that use leverage in the futures space typically tell their 
investors that they will invest a certain *notional* amount from equity. 
  While they usually report margin/equity, this has nothing to do with 
most backtests, you backtest on notional exposure, and your reported 
leverage to your investor is usually based on notional as well.

While efficient use of margin is obviously very important, I don't 
really see this as having anything to do with blotter, since we're not 
going to license and write a SPAN engine.

Regards,

    - Brian
On 11/01/2012 06:19 PM, Ulrich Staudinger wrote:

  
    
#
Brian,

All very good points.

For this particular project, I'm looking at commodity futures. (i.e., corn, wheat, etc.)  So, for those assets, there is a fixed "deposit" per contract amount.

For example, each corn future contract requires a margin deposit of $2,700


So, I'd love to find a way to extend the financial instrument or blotter to use that instead of the notional value.

Thoughts?


--
Noah Silverman, M.S.
UCLA Department of Statistics
8117 Math Sciences Building
Los Angeles, CA 90095
On Nov 1, 2012, at 6:49 PM, "Brian G. Peterson" <brian at braverock.com> wrote:

            
#
Noah,

I already told you that you can add initial and maintenance margin to 
the instrument definition, but your gains and losses are based on the 
notional value of the contract and its multiplier, just as in real markets.

Also, your description of how margin works just isn't true.  commodity 
futures *are* subject to SPAN.  Initial and maintenance margin are for 
single contracts, and don't take SPAN into account. Corn and soybeans 
are even used in the base examples on the CME's pages about SPAN.

http://www.cmegroup.com/clearing/margins/spread-calc.html

Physical commodities are subject both to 'basing' and to 'inter-spread' 
margin via SPAN.

Regards,

    - Brian
On 11/01/2012 09:06 PM, Noah Silverman wrote: