Making the Greek Engine More Interactive

High-Tech Greek Engine

The next big thing I wanted to put in my greek service is the ability for users to not only request certain calculations, but actually provide values that are to be used in those calculations. This is taking the form of sending in a map-of-maps of the values to use, and then simply running through the maps, pulling out the values as needed.

Thankfully, I had a good part of these "maps of values" already worked out for the IRC interface. There, I needed to have some way of telling the server that I wanted it to override some values, so I had the basic parsing and handling for each instrument type in the code. I just needed to add in a few values that are traditionally output values, but in some cases, they will be input values for the 'inverse' calculation. Still... not too hard at all.

Next, I'm going to need to add the concept of a frozen state for the instruments. Basically, if I change a value, I need to be sure that it's going to stay that way while I get around to calculating the results based on that value. So I have to "freeze" the instrument, set it's value, and then calculate what I need. I also need to implement unfreeze(), to start accepting updates again. It's pretty easy, and only slightly complicated for an underlying where you might want to freeze() the underlying and all it's options, or a stock, it's options, and all it's futures, etc.

I got all that in this afternoon, and it's ready for the next step - adding the last two special calculations that the client wants. But that's for another day.