Tuesday, June 28, 2011

Coding skills are vital for serious traders

Not until I've had to do my coding this year did I realize its importance. As financial markets today move from floor to electronic, the days of "discretionary trading" (with you stuck in a chair staring at the screen) are obsolete. Practically all institutional trading is automated at this point, because computers can be extremely fast, efficient, and immune to human errors.


Off personal experience, there is only so far one can go with excel spreadsheet modeling. Despite that Interactive Brokers offer DDE solutions for Excel users, its Java and C++ APIs are substantially more flexible and powerful. At work, we are currently running an in-house C# API to work through Orc Liquidator, a highly flexible software package for institutional trading.


Once the coding's all done, I basically watch and hope that the program does what it's supposed to do, until it does :)


Here's the good news. Coding isn't all that hard to learn, if you just do the reading and exercises. Plenty of free sources exist online. Here's a few:

1) Teach Yourself C++ in 21 Days, free C++ Compiler (Bloodshed Software)
2) Teach Yourself Java in 21 Days, free Java Compiler (Eclipse)

Wednesday, June 15, 2011

Life = Risk (Persistence is everything)


Tuesday, June 14, 2011

Interest rate arbitrage explained

So ehow has a pretty short and concise guide to interest rate arbitrage.

Basic run down: You get a loan somewhere, then invest it into a higher yielding instrument and make a profit on the difference. If the financing and investments are of different currency origins, then you'd need to hedge the exchange rate risk via derivatives e.g. FX futures and/or options.

So it takes a bit of legwork, but doable in theory. If most of the folks in your area are clueless around this, then your local financial market may still be inefficient enough to have this opportunity available.

Here's the ehow guide for Americans:
 "
    •  First you need to find a bank that either offers an unsecured loan (if your credit is good) or a CD secured loan (if your credit score has some room for improvement). This works even better if you have a friend who is willing to front you some money.
    • 2
      The bank you choose should also have some type of deposit special going on as well. You can search for "high yield savings or checking accounts". Most banks and credit unions have something, but you can also check out "Rewards Checking" because that is a really high interest rate. If you are borrowing from a friend or family member, let them know you will give them a little extra. You can give them a set dollar amount like 3 months interest on a 6 month CD.
    • 3
      Deposit the money into a CD. Typically, you can expect to earn between 1% and 1 ½ % on a 6 month CD, at the time of this article's writing. Next, take out a secured loan on the CD, the rate of which will vary, but will usually be in the neighborhood of one full percentage point above the rate you are earning on the CD. So, if you are making 1.2% on the CD, expect to pay 3% on the loan (one FULL percentage point). Now, either the bank you are at, or another bank or credit union should be running some type of special. The banks that have the Rewards product (see Resources) average between 2% and 5%. From here on the math is simple. You are paying 3% on your loan, your principal investment in the CD is still accruing interest, and you deposit the proceeds of your loan in to the checking account making, say 5%. You win, even if you give some of the interest to the person you borrowed the money from.

      "


Thursday, June 9, 2011

Adaptive Strategies for High Frequency Trading (research review)

Anderson, Merolla, and Pribula looked at the eminiS&P500 orderbook for their paper,  Adaptive Strategies for High Frequency Trading . They explained some fundamental concepts around applying orderbook volumes, with respect to their levels, to have an idea of where prices (bids/asks) will likely go in the extreme near term future. This is somewhat intuitive as it is in line with general ideas of exchange level supply and demand.

Forecast methods discussed applying best bid/ask Prices using orderbook volumes: 
  1. Mean Squared Error Prediction
  2. Support Vector Machines
  3. Independent Component Analysis
  4. Simple Moving Average
 Tested Trading Strategy

All market making. Basically, using the forecast value for directional bias, and spam the market with limit orders; e.g. if forecast says the inside Ask price will be higher, the strategy would start working the current best Bid and the expected Ask; and vice-versa. That's the rough idea.

So yeah, interesting research paper for anyone looking to learn about high frequency trading.

Thursday, June 2, 2011

Excel stream (DDE) data capture

I use DDE streaming with both Interactivebrokers and through ORC, and I wanted to be able to store option inside bid/offer volumes every few seconds in Excel. This is so I can create my own time series for more analysis later on or just to have something to reference in real time.



So here's a cool, simple Excel macro to do just this:

Let's name this macro DDEcapture,

"
Dim I As Integer
Sub DDEcapture()
    If I = 0 Then I = 1
    Sheets("Sheet2").Cells(1, I) = Sheets("Sheet1").Range("A1")
    I = I + 1
    Application.OnTime Now + TimeValue("00:05:00"), "DDEcapture"
End Sub
"

In this example, the streamed data is in Sheet1, cell A1. I'm storing them in Sheet2, starting in cell (1,1). So when I run the macro, every 5 minutes, it records the streamed value into the next row (i.e. I + 1) of column 1. Pretty neat huh!