preferred stock ^ convertible bond

regular preferred-stock trades in the ….. corp bond desk, along with regular corp bonds.

convertible-bond and convertible-preferred-stock trade in the the ….. equity desk, along with common stocks

Deciding factor is interest-rate sensitive. See P187 [[after the trade is made]]. In general, anything that’s IR-sensitive trades in the fixed income side. For example, convertible preferred stock can pay a fixed amount of dividend now, but can be converted to common stock, so it’s not IR-sensitive.

gold standard #1: inflation etc

In reality, few governments follow the gold standard, but it’s instructive to consider what if they do.

Annual gold mining output is steady and presumably quite low.

If there’s an authority controlling the total number of HK dollars in circulation [1] and that authority ensures every dollar “created” is backed by a fixed quantity of gold in its reserve, and if every country adopts a similar gold standard, then any time we would be able to mathematically convert all the dollars to gold and all the yens to gold…. and the total gold reserve is still less than total physical gold ever “dug up”. This would be a truly effective control on inflation.

Central banks could print currency easily (inflation) when there’s no gold standard, but no CB can suddenly get 10 times more gold. To obtain more gold, the country must export and receive payment in foreign currency, which are legal claims on the gold reserve of that country. In the late 19th century, many colonial powers coerced China to pay “compensation” in the form of gold.

[1] But how does that authority control banks lending huge amounts in dollars therefore creating dollars? I think answer lies somewhere around the regulation. An unregulated private lender (e.g. loan shark, venture capital, pure-play investment banks) can lend $10b and charge an exorbitant interest amount of $1t, but how does the debtor get the $1t to repay? It has to sell something then collect real USD, which is controlled by the authority. When inflation rises to 50% a year, that can only be a central bank action, not a market action.

architect – skills needed^skill-tests in IV?

Most items below are relevant for a senior developer too, but this discussion is about software architects. By “Skill” I mean something practical, relevant, value-adding… An architect should bring some of these skills to a team. Think of these as job duties, if you like.

skill – insight on the limitations of a large number of impractical/discredited designs. Everyone can come up with some solutions on-paper, but most of them won’t work.
skill – know a large number of common errors and solutions — usually available on google but way too many. You don’t need insight. Just awareness is valuable enough. This comes from “mileage”.
skill – insight on weakness and limitations of dominant, default solutions (like Oracle, linux, WCF, protobuf…)
skill – insight on project best practices and their limitations
skill – know a large number of FOSS and commercial solutions
skill – write library component for others. The more developers use the component, the more senior this author is
skill – multiple technologies (non-trivial skill with each). Most financial/non-financial apps need more than one of DB, java/c#/c++, javascript, GUI, MOM, so an architect needs proficiency with more than one technology.
skill – practical testing strategy, automated or not. Junior guys may be too busy to worry about these. Testing can be tricky.
skill – tuning, optimization. Often overrated relative to GettingThingsDone.
** memory mgmt
** data structures nitty-gritty
** threading

Those are the skills interviewers like. Here are some evidence interviewers look for —

evidence – ability to clearly describe past systems, their design trad-offs, architecture, challenges, limitations,
evidence – ability to draw simple (but effective!) diagrams to illustrate any technical design
evidence – contribution to FOSS
evidence – know algorithms and their computational complexities. Google? Often overrated.
evidence – can identify and apply comp science constructs to programming problems, independently, without guidance — tough. Often overrated.
evidence(?) – know the “gory” details of popular languages
evidence – brain teaser mastery
evidence – design patterns. This is one of the laziest interview tests — ask the candidate to describe how he employed DP.

flow ^ prop trading – according to a young quant

Consider a typical flow trader Fay and a prop trader Peng in an investment bank.

Fay only trades with the registered clients of the bank, typically institutional clients, but also some ultra-rich individuals. Peng seldom trades against the clients of the bank. Peng has an unfair information advantage over those clients. Peng typically trades against other counterparties.

Peng doesn't have to hedge, whereas Fay needs to hedge every trade. Each trade with a client creates a position with a risk. At COB those will contribute to VaR. If it exceeds the VaR limit for Fay, then manager will require Fay to hedge or liquidate. Sometimes Fay's trade creates no position at all.

upstream, knowledge-intensive, high-margin sectors for S’pore

Upstream/strategic, knowledge-intensive, high-margin, high-barrier sectors for Singapore

Singapore is traditionally not a high-tech economy…. To compete, Singapore must seek greener pastures and keep a steady foothold therein. This is what every advanced economy does.

Role models? Switzerland, Hongkong, Taiwan, Silicon Valley, Boston

Entry barriers due to large capital, specialized know-how, talent shortage… Singapore EDB likes a sector with such barriers.

RnD – upstream, knowledge-intensive and entry barrier.

— Now the sectors —
$ finance — #1 most special (“sacred”) sector. One of the pillars of the economy but finance is first among equals [1]. Unlike other pillars, finance is part of the life support of this nation. Singapore gov needs long term strategies to protect (its currency and) financial health, even survival, of the nation. It grows a deep foreign reserve and invests it long term.

Not sure if finance is the most high-margin sector. Commercial banking is lower margin; AssetMgmt, security trading and investment banking create few jobs.

[1] if you shortlist the pillar industries of { oil, logistics}, where Singapore competes successfully on the global arena.

$ oil — perhaps the #2 sacred sector.
$ medical
($ life science? not sure what this includes)
$ electronics
$$ semiconductor fabrication – at the higher end of electronic sector
$$ IC design, esp. microprocessor design – still higher margin

$ telecom equipment and telecom operator — 2 big sectors by revenue
$ enterprise IT solutions, including software production and distribution
$ consumer IT product creation. Not a big sector, but look at Creative Lab
$ aviation — at the higher end of the logistic sector. Servicing, component design, research, airport ..
$ higher education and training

Now a small sample of the opposite list. Many traditional sectors don’t meet all the criteria in the title but do support a lot of jobs for Singaporeans —
– logistics?? Singapore’s traditional bread-and–butter economic contributor (commerce is another), but margin is deteriorating.
— distribution, warehousing
– commerce
— traditional retail – i.e. consumer shopping
– construction
– tourism and hospitality, casino
– entertainment – online/electronic gaming, music and film
– marketing and advertising, media, publishing, exhibition, conferencing

Many of these above sectors are domestic. They don’t directly contribute to the Singapore Team on the international front — contrast electronics, aviation, medical, tourism… Every advanced economy must show competitiveness and high value-add on a number of major global markets.

troubleshooting bloodshed c++

If you get 
[Linker error] undefined reference to `__dyn_tls_init_callback’
Then maybe 2 mingw versions are in conflict. Try renaming c:\mingw to something else
Here’s a better solution —
Use the /lib and /mingw32 folders in your own mingw to overwrite those originals in the dev-cpp folder.
It may be safe to remove the mingw32 folder.

savings bank making loans


(New thoughts below. We were distracted by “fractional reserve banking” concept, which doesn’t apply to Thomas, OrangeUnion or KS. For a real example, I actually deposited $1600 in Citibank but I know I can’t take out $5000.)

Suppose Thomas is a small venture fund with $2 million of real cash. Thomas likes a start-up called Prism so he invests $2m in Prism. Now Thomas has $0 balance. Thomas likes another start-up CakeHealth, so he invests $1m in CakeHealth.  Both cases, Thomas gives a check from his CapitalOne corporate account. Both start-ups have bank accounts in Chase. When CakeHealth cashes in the $1m check, it bounces.

In theory, CapitalOne may implicitly give Thomas a credit line of $1m when CakeHealth cashes the CapitalOne check drawn against Thomas’s depleted account. Question is how much credit. In fact, since there’s no collateral, I doubt CapitalOne will give the $1m unsecured loan. If CapitalOne were so generous, then many Thomas’s would queue up to take advantage of it — deposit $100k and take out $200k to buy gold. Bank would soon collapse. I know that in reality a commercial bank like CapitalOne looks at each application when handing out loans — not implicitly or automatically approved.

That’s story 1. Now Story 2. Orange bank is a tiny private (unregulated) savings union not registered with Fed or FDIC. It can’t even print checks. OrangeUnion takes deposits from local residents totalling $20m. Depositors mostly use CD’s. Then a McDonald’s franchise shows up to borrow $20m so OrangeUnion lent her. Then KFC wants to borrow $10m and OrangeUnion lent him. Both loans mature in a month and get repaid. Then McDonald’s borrows $22m and KFC $11m, but for 10 years. Now OrangeUnion must be careful because it can’t get the money back quickly. 

But let’s analyze the first OrangeUnion 2 loans. Suppose the $20m deposit is maintained in a Citibank account owned by OrangeUnion. McDonald’s gets the loan amount in a $20m Citibank check. McDonald’s owner deposits that in her corporate account in Citibank (Citi just transfers the $20m from one account into the other.) Then she writes a check of $20m to pay her supplier. No problem. Orange’s Citibank account and McDonald’s bank account both become $0. Now KFC gets the $10m loan from OrangeUnion in a Citibank check and tries to deposit it into KFC’s account with Wachovia. Check Bounce? In that case, this OrangeUnion has absolutely no leverage as a lender. It can only lend out $20m if it has $20m deposit.
I now think OrangeUnion (or Thomas) has no leverage.

Story3 is a regular savings bank — say AppleBank. Somehow AppleBank does have leverage. If it has $20b deposit, it CAN lend out more than that. What’s the real difference between AppleBank and OrangeUnion? I guess answer is the regulation. The central bank gives AppleBank its leverage and central bank has some kind of control over its lending practice.

Story 4 is an investment bank KS. No Fed no FDIC. KS __borrows__ $3b from short term money market, but how can it lend $2b to Shell and then $4b to BP in investment banking deals? Say KS checks are issued from BofA, when both Oil companies take money out of the checks, they will more than deplete the $3b cash KS puts into its account with BofA! The BP check will bounce?

Note KS has to _borrow_ from money market because it can’t freely borrow from central bank — no fractional reserve banking for KS.

every trader has a view on at least one primary "variable"

All traders have an view/forecast on some fluctuating “price”. If someone says “I don’t forecast”, she probably follows the majority’s view. Majority is wrong most of the time — See

$ FX traders (buy/sell side) — forecast forex movement. Corporate treasurers are typically see long term. HF and market makers are often short-term. I believe a typical dealer bank worries about even an “overnight” position in any foreign currency.
$ Government bond and IRS traders — forecast IR movement.
$ Crop bond traders — forecast IR and also credit changes, because (my observation) perceived credit quality of issuers affects market value of bond.
$ Stock traders (b/s side) — forecast stock movements. Most mutual funds (most are in equity) add value by forecasting long term, including W. Buffett.
$ Index traders — forecast an entire stock market’s movements.
$ Volatility traders — forecast volatility movements, in addition to underlier movements. Even though vol traders can delta hedge, they still have a view about underlier movement.
$ Commodity traders — forecast commodity price movement. There are probably other factors, but I feel supply/demand is more important in this domain than other domains, because supply is limited and demand is steady. Both are less subject to manipulation. – linq – EF- random notes

churn alert …

Inside Microsoft camp, I feel the 3 generations of dominant[1] DB access tools are ado, linq2sql and EntityFramework. I feel this is a churning field, so a lot of popular technologies will come and go. ADO/ODBC tends to survive longer. (My experience and focus is WPF/WCF…)

[1] Any time in the dotnet history, there would be “chims” challenging the gorilla. I don’t even know their names, though some may grow quite popular.

A) is like the basic jdbc. ADO works with DataSet and DataTable. Better performance than any ORM (Linq/EF), because it doesn’t do mapping to objects. says There are three separate ADO.NET based LINQ technologies: LINQ to DataSet, LINQ to SQL, and LINQ to Entities. 1) LINQ to DataSet provides richer querying over the DataSet; 2) LINQ to SQL enables you to directly query SQL Server; 3) LINQ to Entities is less popular and probably more ambitious and complicated.

B) L2sql and EF both generate SQL queries, often unoptimized.

B1) The DataSet is a disconnected programming model in ADO.NET. L2DataSet is an  upgrade/enhancement/expansion

B2) LINQ to SQL is for developers who do not require mapping to a customized, conceptual model. LINQ to SQL enables developers to generate entity classes from DB tables. Rather than mapping to a conceptual data model, these generated classes map directly to database tables. You can easily mix LINQ to SQL code with existing ADO.NET applications

C) the competition between the simpler L2SQL vs the bigger EntityFramework.
LINQ to SQL is a simple and easy to use ORM system. It allows for only simple inheritance or association features. There was talk awhile back about Microsoft retiring it, but it is likely to be around for awhile.

EF is more suitable for complex object graphs. It allows for more complex inheritance or association features. EF shares many features with Nhibernate.

tick data feed – market data distributor

  • You have a ticker feed, a queue that the feed can push onto, data workers that consume the queue, and subscribing listeners to the data workers.
  • Explain a non-blocking, scalable algorithm for how the data workers can transfer the data to the listeners.
  • Suppose some listeners consume messages slower than others. Suppose some listeners are only interested in certain tickers.
  • Suppose the ticker feed pushes data on the queue in bursts, how might you ensure the data workers don’t needlessly poll an empty queue?

That’s original question. I feel this is fairly realistic market data system. I covered a a similar requirement in

I feel a data worker deals with 2 “external systems” — big queue + listeners. The queue is a messaging FIFO thing (not necessarily JMS queue) to be polled. When it’s empty, data worker threads should wait in wait(). A socket thread can probably receive new data and notify data workers. When all the workers have processed a given message, it needs to be removed — See the same blog above.

I feel non-blocking kind of comes by-default, but maybe I don’t understand the question.

Message filter should probably be implemented in the data worker. See the same blog above.

To ensure slow listeners don’t block fast listeners, I feel we need multiple threads per data worker. In contrast, the Simple design is that data worker thread is also the thread running the onMessage() methods of all the listeners.  Multi-threaded data worker is probably a common design.