Archive for the ‘Coding’ Category

Getting Going on Time and Sales Service

Monday, April 25th, 2011

Today I did a lot of work helping people get focused on what we should be doing. For my part, we needed a Time and Sales Service where each option trade sent to us by the exchanges needs to be captured, a few implied volatilities calculated, and then shot out to the waiting clients. This is really orthogonal to the rest of the greek engine, so I wanted to tackle that so it doesn't slow down other people, or divert them from the primary goals.

The design is going to be very simple: a service that takes an Option and a Print message and queues it up to be calculated and sent out. Very simple. The design is pretty simple: have a struct (object) that will hold all I need from the two incoming arguments, fill it on entry, queue that, and return. All this should be very fast as it's all just ivar calls to the base objects.

Then the queue has a processing thread, and will take these off one by one, calculate the values, and then generate the messages in the legacy and new formats so that we can feed both the old and new systems. Pretty simple.

Slightly New Focus for Greek Engine

Monday, April 25th, 2011

This morning I had an interesting talk with my manager about the greek engine and what we might want to focus on in this first release. Rather than think about the general case of handling the entire market, which certainly needs to be done, let's focus first in the idea that the largest percentage of clients of the engine will be looking at a single family, and wanting to manipulate that one family to see different what if scenarios. In the end, we'll need to make an uber environment with all the instruments ticking, but that's a limit case, and will be able to be extended from this initial one-family case.

In addition to the what if work, the engine needs to handle the explicit requesting of options so that the client can say "show me everything between the Dec 150 and Dec 250 expirations". This "windowing" is done all the time to minimize the data traffic, and building it into the server means that it doesn't have to be built into all the clients. They just have to be able to pass the request to me, and then update the window with me as the scrollable region changes. Pretty neat.

In the end, I think this is a much more useful direction to go, as this is going to really change how we move data around the organization. No longer will clients have to take "the market" to get a few things. Now, they'll be able to ask for just what they want. Nice.

Message to Self: Reality Check – Is it Me, or Them?

Monday, April 25th, 2011

This morning I'm really having a hard time with a lot of things. Questioning a lot about who I am, how I approach things, how I react to things and people... and it's not at all fun. Not in the least. I'm wondering if my passion about things is really nothing more than my little rationalization for my actions. Does anyone really care?

Which reminds me of the great line in 1776 when Abigail is talking to John Addams and says:

Have you forgotten what you used to say to me, I haven't. Commitment, Abby, commitment. There are only two creatures of value on the face of this earth - those with a commitment and those who require the commitment of others. Do you remember John?

When I think of that I realize he's right, and so am I. OK... maybe neither of us are right, but I'd rather be wrong - like that, than sit around thinking there's nothing that can be done, or nothing that matters. Life matters, if only to me.

I don't expect a lot of people to agree with me, but then again, as Cher said, This life isn't practice for anything.

Google Chrome dev 12.0.742.5 is Out

Monday, April 25th, 2011

This morning I saw that Google Chrome dev 12.0.742.5 is out and the release notes say that this fixes a regression bug with sync and a few other bugs. OK, seems they rushed the last release, and this guy makes up for it. Sounds like a plan.

Adding Exchange Quotes to the Option and Volume to the Instrument

Thursday, April 21st, 2011

Today among the many little things I had to do for my greek engine project, I added the ideas that for each tradable instrument, there really was a traded volume per exchange, and for the Option, there is a quote per exchange. These are going to come in very handy when we have to look at the volume sliced and diced across different exchange sets, and when the consumers of this data need to see the latest quotes for an option across every exchange.

I was pretty happy that these both went into the design very well, and I spent probably a little too much time adding nice features to the basic data, but I think in the end, it'll be a better way to present the data, and it'll certainly make a solid example for the rest of the team as to how to do it well.

Besides this, it was a lot of helping others along with problems, and I realize that it's something I should be doing - even though it's not my favorite thing to do.

Google Chrome dev 12.0.742.0 is Out

Thursday, April 21st, 2011

This morning I saw that Google Chrome dev 12.0.742.0 was out with "stability and performance fixes". Sounds like polish to me - nothing wrong with that. Keep making it better, and while you're at it - throw back in the H.264 will ya?

Writing Custom Iterators for Thread-Safe List

Wednesday, April 20th, 2011

Today I got around to writing the iterators on my thread-safe Instrument list - hadn't done that before, and it was actually fun. Geeky, yes. But fun nonetheless. I just needed to get the style of the header right, and a first cut at the basic iterator and they were coming pretty quickly.

I wrote a simple test program as well to make sure that they were working, and it was pretty impressive (to me) that they worked right away. No problems. Sure, they weren't all that hard, but still - for not having done any in the past, it was a treat to get them done so quickly and done well.

There's a ton more testing that these guys need in order to be sure they are going to perform under load, but I can pass that off to a junior developer that's got a decent eye for details and he'll expand the test app to be a testing monster.

Sweet!

NX Server Problem – File Permissions Solved It!

Wednesday, April 20th, 2011

Yesterday afternoon I had a hiccup on the networks and the NXMachine session I had from my desktop to one of the servers in the data center was disconnected. Unfortunately, attempting to get it back proved fruitless. No matter what I did, it was saying that there was an authentication problem. Yet just 10 mins ago I was connected and doing fine.

Reboot didn't help. I could SSH into the box, but I couldn't get the NXMachine session going. The UnixEng guy tried, but he wasn't all that good at debugging this software, so I had to work on another box for the rest of the day.

This morning I came in ready to try and solve this guy on my own. What I did was recheck everything. Make sure the box where it was working and the non-working box were set up right. I checked the scripts, the files - all seemed like it should work. Then I noticed the file owner in the /usr/NX/home/nx directory. It was owned by userID 999 and not the user nx. Oh... this couldn't have been it...

So I went through the entire /usr/NX directory comparing a working machine to a non-working machine. Every place I saw the userID 999 I did the chown nx and after I cleaned up those ownerships it worked! Sweet!

Lesson learned: check the file ownership and permissions.

Creating a Thread-Safe List with Iterators

Tuesday, April 19th, 2011

This afternoon I started work on the next component of the greek engine project - a list of pointers (instruments) that is thread-safe, and has iterators that are never invalidated. It's the combination there that's really tricky... how to make a list that has many iterators on it - none of which will be invalidated on an isert or removal operation on the list.

Yeah, that took some thinking.

My initial idea is to have a fixed-length list of nodes. Each node has a value, a 'valid' flag, and a spinlock. In order to add to the list, you need to scan the list looking for the first node that is not valid, but who's try_lock() is successful. You can then place the value into the table. Pretty simple, really. The locks don't effect anyone else, and things are pretty smooth.

The iterators are going to be something where I can step through all the valid values and optionally lock on that node to make sure it gets "stepped over" by the other iterators. It should make for just what I'm looking for.

Lots of coding to do, but I think it's all planned out and should work. I just need to actually do it.

Working Up InstrumentFactory and InstrumentMap

Tuesday, April 19th, 2011

This morning I wrote the skeletal InstrumentFactory and InstrumentMap for the Greek Engine to get some of the other guys in the team helping out. These two classes work together to construct and then hold the universe of Instruments that we'll be working with. It's a model I've used in the past, and it really seems to work pretty well. I just need to get working and figure out how to make a thread-safe, lockless, list with iterators so I can run through the stocks in this map for calculation purposes.

No rest for the weary...