Chris Donnan : Programming – Brooklyn Style
software, trading, family, fun
Posted Derivatives, options, programming, trading on Sunday, August 26th, 2007.
(I had this stupid post 75% typed, and my IE crashed… Microsoft, Vista and friends have been GETTING ON MY NERVES!)Â
So… I had a recent post about variance swaps. I have been thinking a fair bit about the ideas of volatility – it is after all what options are all about. It is just interesting to me how darn versitile options are. It is possible to put together really novel views of risk depending on your options strategy. Strategies focused on volatility are what I am currently working through mentally.Â
How to profit from volatility
Here is a good post on volatility strategies using vanilla options. Essentially – you can put together combinations of options that allow you to “focus in on” and profit based on the volatility characteristics/ changes. They mention the concept of volatility of volatility which reminds me of some work I did in the past with a guy named Lester Ingber – really, really bright guy.Â
Volatility of Volatility
Lester’s article on Volatility of Volatility. This is interesting inasmuch as it is another layer of derivation on top of volatility. The idea that volatility itself has volatility is just another example of the complex mechanics that make up the financial world we are part of. We did work in this space looking at ways to achieve “adaptation” of trading system parameters based on volatility – and on volatility of volatility. Lester’s work is excellent – I also suggest reading his CMI work here and his work on Adaptive Simulated Annealing (the work I originally found him for) is also excellent.Â
Dispersion TradingÂ
I have also been working over dispersion trading ideas – here is a good article from IVolatility.com (Good site, I used to get IV info from these guys for implementing an ETF trading strategy based on options and opening range breakout).Â
Volatility Arbitrage
Daily options report has a good set of posts on volatility arb’ing. The most recent post is pointing to potential arb opportunities between the VIX and VXN – or the S&P market and NASDAQ market. The article mentions “mean reversion of volatility” – which brings me back to a few years ago…Â
Toby Crabel and Mean Reversion
Toby Crabel is a relatively famous trader that popularized (to the best of my understanding) a particular trade patter for stocks and futures based on HV ratios. Essentially - you take a short range return/ longer range return and you get a ratio. This basically says things to you like; “today the volatility is relatively low” or “yesterday the volatility was relatively high”. The idea is based on the concept that “volatility is mean reverting“. This means that when volatility is relatively high, it is more likely it will be relatively low next. Often volatility arbing strategies depend on this concept. I worked through most of the “crabel-isms” a few years back while working on automated trading strategies based on some of Crabel’s ideas.Â
All of this volatility stuff does bring me back to past experiences. The difference is that in the past we were looking at this information for different reasons. Currently, I am trying to understand all the more the detailed bits and pieces that would allow you to make trades that allow you to trade a view on volatility… interesting stuff!!!Â
-ChrisÂ
Â
You can leave a response, or trackback from your own site.
Posted erlang, programming on Tuesday, August 21st, 2007.
I have been reading the prag progammers Programming Erlang – Software for a Concurrent World. I have been looking casually @ Erlang for a few months. The thing that initially interested me about Erlang was the “concurrency thing”. Erlang is beyond concurrency friendly – it is built into the language core. Erlang is all about concurrent programming on 1-N CPUs/ machines.
I have been a casual to semi-serious ruby lover for some time. I have not been able to use it 9-5 (except for the odd task I need to script – like aggregating unit test statistics across an enterprise, etc.). I have more recently gotten to giving python (yeah – the iron variety) a go. These languages are great – they are also inherently “object oriented”.
Erlang is not object oriented. This both repulsed and attracts me at once to it. It repulses me because I have baked in the OO-isms to my core.
Erlang is a general-purpose concurrent programming language and runtime system. The sequential subset of Erlang is a functional language, with strict evaluation, single assignment, and dynamic typing.
(wikipedia)
The fact that you have no classes, variables are declared in upper case and you deal primarily in functions is amazing and radically different than OO. Variables are “single assignment” (once you set X – you cannot change it). Again – I say – there are no classes!! I am really interested in working from a totally different perspective. The functional sequential portion of erlang is very interesting. I will have to post another time about pattern matching and how method lookup works – it is interesting.
Erlang is all about concurrency.
Erlang’s main strength is support for concurrency. It has a small but powerful set of primitives to create processes and communicate between them. Processes are the primary means to structure an Erlang application. Erlang processes are neither OS processes nor OS threads, but lightweight threads somewhat similar to Java’s “green threads“. Their estimated minimal overhead for each is 300 bytes, so many of them can be created without degrading performance. (a benchmark with 20 million processes was tried)
(wikipedia – again)
I wll have to make another post about how you send/ receive/ spawn in erlang to communicate between processes – but it is very interesting.
In short – erlang is really a cool language that is pushing my brain to consider real – different alternatives to “the way I have been working for years more or less”.
Consider this post - Ralph Johnson thinks Erlang could even be “the next java” (something that apparently everyone is looking for – many in ruby, some in erlang, haskel, etc).
Keep watch – there is interesting stuff out there!
-Chris
You can leave a response, or trackback from your own site.
Posted .net, programming on Friday, August 17th, 2007.
Appdomain isolated WPF Plugins!!
Having been working on plugin based winforms based apps – and desiring appdomain plugin isolation for some time… just the possibility makes me shed a tear of joy!
Â
You can leave a response, or trackback from your own site.
Posted Family on Sunday, August 12th, 2007.
Some pictures here. (Picasa has a cool “export album and upload to ftp” feature - useful.)
You can get a good idea of where we were based on google maps here. The map is subtley wrong if you zoom in. Basically we were on the inside of a mini-harbor - maybe 150 meters in from the atlantic – lovely as can be. Excerpts . . .
![]()
![]()
![]()
![]()
You can leave a response, or trackback from your own site.
Posted programming on Friday, August 10th, 2007.
Continuing thoughts from yesterdays Thoughts from Maine – user experience, ruby, python and more . . .
Another bit from Coopers writing is that idioms are more powerful than metaphors when it comes to user experience. Metaphors usually go too far – and wind up being too much a stretch. They are also inflexible inasmuch as you can never add something totally novel to that metaphor in software if the real thing does not behave that way.
A big part of rails, and I would even say the rubyist community feel is the idiom theme – (ala rails convention over configuration). Just look at what Google has to say on Ruby Idioms.
My insight here is simply that ruby is good user experience for programmers. Based on several “Cooper-isms” – idioms over metaphors, little excise to get in your way, things like metaprogramming seem to be goal oriented inasmuch as they are about doing what a programmer needs to do – and taking away the grunt work…
But what about my real projects!!!
I will say that I do not seem to be the primary persona they developed ruby for… I LOVE the language and think it is empowering. I am aslo a tester – I believe in and practice TDD – so the dynamic language thing works for me. That being said – there is literally no way for me to build trader desktop applications with ruby, real time messaging, true multi-threading, GUI polish – high speed grid views etc… Perhaps someday…
JRubyÂ
I am thinking about a few JRuby things I could do that would be valueable – replacing spring configs with ruby – it will be shorter. Replacing other XML based stuff with ruby seems the easiest win and place to start. When people see that programming in ruby is better than XML – it will be easy to convert them…
Dependency Injection in Ruby (and other dynamic languages)
… This is totally not related – except inasmuch as I care about ruby and DI….
There is an interesting meme going around the web… Jim Weirich issued a challenge to describe dependency injection in once sentence. Here are some good ones:
How about: “Dependency Injection” seemed an amazing insight to people who had finally learned what constructor arguments were for. JimWeirich Â
Dependency Injection enables a vitally important but nevertheless weak, limited, syntactically confounding, and dauntingly complex form of one of the kinds of meta-programming that should exist in the language. (from here)
Dependency injection is a palliative for environments that unnecessarily couple creation, lookup, and interaction between collaborators. (from here)
[DI isn't needed] primarily because the entire Ruby object space is one big DI container, and you inject dependencies by taking advantage of it. from here
Read this when you can - Dependency Injection: Vitally Important or Totally Irrelevant? - I will sum it up – great topic and thoughts here. The gist is that in ruby – you usually do not need DI -but in a statically typed language (java, C#) – you must use it. It goes on to conclude that most ruby projects are still small – and that the larger your projects get – the more they would benefit from DI – yes -even ruby needs DI when the projects get bigger and bigger. In ruby – you can really replace dependencies, mock out methods, etc much easier – and this is much of why you need DI in java/ C#. Also – since ruby is duck typed – you do not need to bind to any concretion – if the class passed in has the methods you need – then it is good enough. In a statically typed language - you need lotsa extra code for the separate interfaces/ implementations, etc.
More good reading here. The basic idea is that in ruby – you usually do not need DI – but in statically typed languages – you do. So – until I can use ruby to build an enterprise class trading application – I will be in DI land. I will STILL be trying to find places I can use ruby because I think it can add business value since I will be able to work with less code…
You can leave a response, or trackback from your own site.
Posted programming, python, ruby, user experience on Thursday, August 9th, 2007.
I have been spending all my time relaxing, playing with the kids, sitting on the porch reading and looking at the Atlantic. It has been a bit rainy – but still just about perfect relaxation and family bonding.
The reading time has been great. I have also been doing some programming play while my younger naps a few days this week. A good 3 hour nap makes for some good programming play. I have been trying to come up with ways to slay XML – replace with DSL or a real languaga – since we are implicitly programming in XML too often – since it is just text. They used to call this “scripting”….
My thoughts on python are pretty simple:
- __init__ is the ugliest constructor
?? Double underscores before and after?? Why ?? I know they did great things with python – why did Guido and the other smart folks leave us with that one?? - Passing of self everywhere seems to be … excise … more on that later. For those who have not played with python – if you have a class – your “constructor” (initializer) is that __init__ business, the pass of self to the constructor is needed to reference class variables. It is implicitly passed in as the 1st argument. The same goes for methods – if you want class variables - you need the self method argument.

- The whitespace handling is not an issue - I expected to be irritated by it more – but the fact that whitespace is “part of the language” is actually OK.
- Ruby is just much nicer to me. The could be in part because I have done more with it – but it is likely ruby is just more friendly to the programmer…
User experience … for programmers
Since I have been reading Alan Coopers newer book: About Face 3: The Essentials of Interaction Design and Bill Buxton’s Sketching User Experiences: Getting the Design Right and the Right Design I have been thinking again – a lot – about real user experience. While I am really into programming – and finance – I am also really into giving a great user experience. I had the opportunity to work with a really good bunch of people at one of the other financial firms that were really into actual user experience. My current effort involves making yet another end user set of applications – and I am dead set on providing a fantistic user experience.
I went through the normal Alan Cooper-isms (from his former writings) on formulating personas for the user types, understanding the users real goals, and breaking down their task flow. I have also been thinking about another Cooper-ism – “trimming the excise”.
Alan Cooper on Excise:
Each bit of interface involves a little bit of added overhead, what I call “excise,” or extra work that the user must perform merely to manage the idiom, with no benefit to the user or the business. This includes things like moving windows around or pressing OK buttons. Lots of interface elements means lots of added excise. After a while, the user spends as much time flipping between views, scrolling down lists and summoning dialogs as she does useful and productive work.
This is along the lines of “value stream analysis” from business process modeling. Your job as an experience designer is to trim the tasks between the think the user actually wants and what they have to do to get there. If they need to horizontally scroll, do 6 clicks and a few drag and drops to get to the actual thing they want – there are many steps which are “excise” and should be trimmed.
So – I am serious about putting the right info in front of my users – at the right time – so they can make the fewest clicks possible to do what they are actualy wanting to do.
Python could take away a few lessons I think…
So how does this relate to ruby and python?
Well - if you read musings on ruby – you will see that much of the original spirit of ruby (see Matts – ruby author) is simply joy, happiness and simplicity in programming. The efforts to trim the excise from ruby have been strong. Ruby’s author has made sure to give programmers a great user experience with ruby – and this sentiment is profoundly embedded in the rubyist community.
Python by contrast does not really have this feel to me. The need to __ here or there, to pass self around, the way lambda expressions are, they all feel – sub-par. They feel to some degree like there needs to be some syntactic excise trimmed away…
That said – Python is OK. I like it enough that I would use it. It is a real scripting language that has value. I would simply PREFER ruby. Too bad you STILL cannot make a trading system, or a real desktop application (yes I know – Ruby QT bindings are there)… Sometime soon I hope
-Chris
You can leave a response, or trackback from your own site.
Posted programming on Tuesday, August 7th, 2007.
You can leave a response, or trackback from your own site.
