clearing-member of the exchange = sponsor of a trade

Only the clearing members (big broker/dealer) of NYSE can trade on it. When you or any investor sells IBM short [1] using GS as a broker, NYSE always sees the trade under GS’s name. If investor can’t fulfill the obligation, GS is responsible.

Technically, GS “sponsors” your trade. I think most trades are sponsored this way (except trades GS does using its own money). A sponsor member like GS has to protect itself.

A pass-through broker who simply passes the order to the exchange without any check is running the greatest risk.

Same thing in other exchanges. I traded commodities in 1997. My broker was responsible to answer clearinghouse’s margin calls if I don’t. Integrity requires all margin calls satisfied (or clearinghouse has the right to liquidate your position). I had an account with the broker, not the clearinghouse, so all the positions were held under first-tier broker’s name, i.e. a member of the exchange.

[1] regular sell or buy also involve responsibilities and obvious financial risks to the broker.

top 3 subsystems – spot (and forward) FX dearler bank

There are 3 types of FX dealers – spot dealer, forwards dealer and (corporate)client-facing sales dealers covering spot and forward. They use the systems below differently.

Note ONLY the sales dealers would interface with clients (no retail client). Spot/Forwards dealers deal with sales dealers and counterparty dealers.

#1))) Heart of entire FX desk is the “position keeping system” or position-master. All “deals” are stored there, so as to “calculate current positions” and PnL. Same idea as MTS inventory-mgr and Reo main-grid.

Note sales dealers never keep positions. I believe they are internal brokers on bank’s payroll.

FX position systems usually show real time unrealized P/L.
#2))) AFTER (never before) a dealer executes trades via a voice broker, he needs to record trade details on a “deal-ticket” (see other post) and enter it in the “deal entry system”, just like MTS. Electronically executed trades don’t need this “deal entry system”

Spot trades are too many so seldom voice-based. Forwards dealers use voice brokers more often. Sales dealers do even more voice EXECUTION (often with a customer). These 2 groups definitely need the deal-entry system.

As of 2010, the most common execution model between clients and banks is not ECN (growing) or Reuters conversational dealing, but voice execution.

#3))) (Pending) order management — If a spot dealer wants to hold a position “open” overnight, she must leave a stop loss order. While she’s out, the order is looked after by the take-over time zone (NY -> SG/TK/HK -> London) which MIGHT execute the stop loss order.

Forwards dealers don’t leave overnight orders. Sales dealers often create customer orders for the spot/forwards dealers to execute.

Sales dealers can also create overnight limit orders on behalf of clients.

hide a source folder from eclipse

Background: i want “hide” an arbiturary directory (such as a source folder) from eclipse.

Conclusion: No easy way to mark a directory “please ignore me completely”, but a few tips:

* searcher — try “derived”. Also you can remove read permission from a directory.
* package explorer — try the filters, such as the “.*”

http://www.plaintivemewling.com/articles/ignoring-darcs-directory is good

java String[] is O(1) for lookup-by-index

int[] has constant by-index lookup time, because system can compute address of 55th element from base address and offset ie base address + 54 * 4 since an int takes 4 bytes.

For a String[], I believe it’s the same formula. 55th string could be very long, but it’s not stored in the array’s memory block. I believe it’s the address of 1st char that’s stored in the array’s memory block, assuming the c-str implementation. Each address probably takes 4 bytes in a 32-bit machine.

More generally, any array of objects is probably implemented the same way. Note an array is also an object. If the elements in the outer array are array objects, then we get a 2D array. Outer array’s memory block holds 55 pointers to 55 inner arrays.

bond duration – learning notes

I like the official definition in http://en.wikipedia.org/wiki/Bond_duration#Definition. Each payout has a payout-date and therefore a ‘distance’ from valuation-date. (Example: 47 months from now). Weighted average of all these “distances” is the Mac Duration.

* eg: zeros aka STRIPS — one payout-date only. If distance is 4.5 years then Mac Duration is the same. Zeros have the longest duration[1]
* eg: low coupon bond maturing in 4.5 years — Weighted average means Mac duration is dominated by the principal repayment’s distance of 4.5 years. Duration is slightly shorter than that that last distance.
* eg: high coupon bond with that same maturity of 4.5. Duration is much shorter than the last distance.

[1] among bonds of the same maturity date.

“distance” is a more visual word than the “time-to-maturity” or “term-to-maturity” technical jargon. I also like the TTL or time-to-live phrase.

Now, if we receive $50 coupons five times and then $1000, we get total $1250 [2]. Q: what’s a reasonable “average-payout-date” of this $1250? Answer is the Duration.

[2] actual formula uses present value of each payout.

Now let’s see why the zero is most volatile, i.e. “this bond’s current price swings wildly with interest rate”

Key assumption: yield is roughly correlated to benchmark interest rates (such as the overnight FedFund rate), an indication of market sentiment.

For a high-yielder, larger portions (half?) of the total PresentValue come early and suffer minimal discount (discount factor close to 100%) . Remember DF and yield are subject to semi-annual compound. STRIPS have no early payouts, so the final payout must be discounted deeply due to compounding. Impact of yield change is deep.

Remember yield of 7% is always semi-annually compounded to derive DiscountFactor. See posts on DF and yield.

container of (polymorphic) pointers (double-pointer)

If you have a vector of pointers (fairly common in practice), the iterator is nothing but a double pointer.

– If you have a deque of pointers …?
– If you have a multiset of pointers, the iterator is a pseudo-pointer of pointers.

Now shift gear to smart pointers. Container of smart pointer is extremely common in quant and other apps, perhaps more common than container of values.
– If you have a vector of smart pointers, the iterator is a pointer-to-smart-pointer.
– If you have a priority queue (binary heap) of smart pointers, the iterator is a pesudo-pointer-to-smart-pointer

P186 [[c++coding standards]] says to store polymorphic objects, best solution is
– avoid array
– avoid storing the objects directly
+ Use container of smart pointer to base class

Here are the 2nd-choice but acceptable alternatives
* array of raw   pointer to base class
* array of smart pointer to base class
* container of raw pointer to base class