what DEFAULT means for JTable renderers

1) The “default” in getDefaultRenderer() means “class-based”. In each jtable, there’s at most ONE class-based renderer for each class. However, multiple classes (say Price column in double, and Qty column in integer) can share the same class-based renderer.

2) The “default” in DefaultTableCellRenderer.java doesn’t mean “class-based”. It means …. “render for all classes”, kind of render of last resort (Sounds like lender of last resort:)

1b) myjtable.getDefaultRenderer(Object.class) would normally return an instance of DefaultTableCellRenderer.java. This call looks up the class-based renderer for Object.java — the last-resort class-based renderer, which is typically DefaultTableCellRenderer.java.


most basic mkt-data feeds to a real spot/forward FX dealer (ML

Top 3 feed providers — Reuters, Dow Jones, Bloomberg

#1 type of live feed is interest rate in major currencies.

— spot dealer
Live spot prices
Interest rates (probably short term) in each currency.

— forward dealer
Live forward prices
Short term lending rates (money markets) in each currency
Longer term lending rates in each currency

non-trivial FX jargon

? customer order vs non-customer order
bank stream
executable quote
Non-deliverable forwards
repo vs FX swap vs currency swap (x-currency IRS)
rolling forward
T/N, O/N, S/N
run-through (forwards market)
direct quotation, indirect quotation — http://en.wikipedia.org/wiki/Exchange_rate
institutional client vs corporate client
banks vs dealers
volatility smile/skew in FX vs equities
relation between Libor rates and FX forward rates
difference between cross-currency IRS and regular IRS

liquidity providers — dealer banks and some hedge funds. Liquidity consumers include small banks and corporations.

relationship-based vs anonymous dealing platforms — Reuters conversational dealing — 2 counter-parties know the identity of other. Note EBS is anonymous. FXAll started as purely relationship-based, later added anonymous platform.

FX pricer #1 short-term driver — 2 IR of the currency pair

(See also blog on forward FX rate formula.)

For both spot dealer and forward dealer (see separate blog post), interest rates (both short and long term IR, both spot IR and forward IR) are the most important input. Unlike a buy-side (HF…) trader, a dealer typically gets a lot of RFQ during the day and must watch the live interest rates.

Beside IR, All the other inputs to FX pricing engines are probably for different purposes.

A veteran once told me “FX involve 2 interest rates; equity involves dividends. Roughly equal in complexity” but I believe eq options are more complex, involving volatility, repo (supposed to compensate for PCP imperfections?) in additional to IR + dividend.


http://www.investopedia.com/articles/basics/04/050704.asp gave 6 factors affecting FX rates. I feel interest rate is the only short term live market data.

online FX brokers

FXAll and Currenex are examples of “Internet based electronic trading platforms” between banks and large clients.

They are different from interbank brokers (EBS and Reuters primarily)

Q: are thesey market-makers or match-makers?
%A: match makers.

y does yield follow libor rates?

Q: When interest rates (libor or T or others) rises, why does yield rise?

I used to think yield reflects credit quality. I think that’s still correct, but that’s a static “snapshot” view — explaining different yields of 2 bonds at a point in time.

For now, focus on one particular bond. When interests rise, yield does rise but why? Remember yield is a discounting device, so why do traders discount the future payouts more deeply? Here’s my answer.

First, ignore credit risk and look at a $1000 T zero maturing in 12 months. Say we used to discount the payout by 201bp but now interest rate is higher for similar maturities in Libor and Treasury markets. Sellers of this zero would each discount the payout at 222bp. If you stick to 201bp, then you create arbitrage opportuniuty within this particular market alone. Therefore all sellers of this zero all advertize at very similar prices.

Q: What if there are only 3 big sellers in the market and we collude to keep our price high at 201bp? Crucially, to avoid arbitrage, bid yield has to be slightly higher at 202bp.

%%A: arbitrager can BUY 12-month libor (==a zero bond) at a higher yield of 300bp, and hit our bids at 202bp. There’s an arbitrage linkd between them.

%%A: arbitrager can BUY a mix of Treasuries of 6-month and 2-year, both of which have higher yields above 250bp and hit out bids at 202bp. There’s a arbitrage link across the maturities.

Effectively inflation is rising meaning future payouts getting “cheaper”. If you don’t discount future payouts, then people will see you are pricing your cash flow unfairly.

In the end, it’s a matter of valuation. If you still discount your coupon payouts at the old 201bp then you over-value your bond. Consequence is arbitrage. If competing sellers undersell, then you can’t sell. If you monopolize this market and also bid around that 201bp, then your bid will get hit due to arbitrage using similar instruments.

non-trivial layout – swing ^ dotnet

In Swing, The lazy way to achieve precise layout is subpanels, but memory-heavy. If you use multiple frames, the number of subpanels can multiply.

The memory-wise solution is layout manager wizardry. GridBag is the most complex, impractical according to some. Microsoft has many more layout features, including xaml. Winforms uses anchorage.

I feel the wpf layout panel is like a panel with a specific layout manager … I feel it works better than swing. “Your chosen container determines the layout”, said one wpf book.

Netbeans offers layout assistance, but is still way behind Microsoft solutions.

3 basic value-add in the ECN business model

An FX dealer bank’s system usually interfaces with EBS, Reuters, Bloomberg, FXAll, Currenex, Hotspot … Between any 2 of these, there’re often competing features.

Feature 1: execution. order forwarding to dealers. Actual execution is at the dealer bank after the Last-Look.
 Remember TMS and FXAll.

I feel execution is the #1 (but not the only[3]) value-add of ECN. A slow ECN can also aggregate a lot of quotes. If no client find the quotes competitive then no trade.

[3] Execution isn’t the only value-add. In this huge ecosystem, there are many players selling nothing but data — evaluation prices, recommendations, research, news feed

Feature 2: quote aggregation. depth of market. This service can be “sold” by itself. Quotes have to be fast to be useful.

2b: enable 2-sided market makers to size up a market and then make a market. If the ECN doesn’t offer execution, then clients can contact the market maker directly, just like how I use kayak.com
2c: price discovery

Feature 3: RFQ, RFS(stream)

Fw: milestoning vs log table

Thanks for sharing your implementation. I agree some apps may need a log of user activity. A log table.

Milestone is probably designed for change-history. By the way I’m not a big fan of milestone. It has many drawbacks – unenforceable data rules, manual updates, foreign key, hibernate, data corrections …

y JMS session is Single-Threaded

1 session – 1 transaction.

How about database connection. 1 connection – 1 private memory space in the server to hold transaction data, so no multiple concurrent transaction. Even a select is part of a transaction, if you recall the isolation levels (repeatable read…) Usually, the same connection is not used in multiple concurrent threads, but no system enforcement.

How does any JMS system enforce the single-threaded rule? I doubt there’s any. If you break the rule, then result is perhaps similar to the c++ “undefined behavior”.

Note a Connection can be shared by threads, but a Session can’t. The java tutorial says “You use a connection to create one or more sessions.” Additionally, in the flow diagram anything upstream is thread-safe; anything downstream is single-threaded.

connFactory -> Conn -> Session -> producer/consumers