2009-10-12

After 100 posts

I haven't planned to get that that count, but it happened. When I'm checking readership statistics it looks like not a big achievement, but there is always somebody who can find something interesting for itself. The best thing I get through blogging, were contacts with interesting people sharing interest on common subjects.

I'm not actively generating inter-links, track-backs and using other web marketing tools. Most of the readers get here through search engines. After 2 years I'm still treating it as low time consuming experiment. It's not so bad, but always could be a lot of better.

Initially I've made routine to post once a week, giving yourself free days on vacations or during "busy" time. Now I'm bending that rule posting at less frequent rate. I'm looking for more interesting subjects, or I'm just more lazy. It looks like there is a trend to write less but more frequently (Twitter frenzy). Maybe I will have enough willpower and time to develop my blog beyond that.

2009-10-05

Running an automated trading system

Some time ago I tried to get into automated trading systems. I have choose custom software trading platform that I'm co-developing with my friends that like system investing too (and helped me to quickly get into subject - so thanks a lot). It's rather my hobby than real source of income, but who knows.

My target was easy system, trading on index futures. It should be suitable for individual investor, that spends no more time than couple minutes a day on-line "looking at" the market.
After lots of tests (I really mean it) and choosing one candidate model I started using it at real account in "production" mode. Decisions are made by system, then manually validated and executed. The software was tested a lot, so no surprises from that side. Besides of that I still need to manually validate correctness of input data.

It's hard to get good free data source. I have heard that many commercial services that provide stock market data, have glitches in their data too. It's hard to find something usable for low scale individual investing - that kind of services are more oriented towards bigger businesses or "investing houses".

I'm still learning so I'm going to make next trading system after I catch some problems with the first one. My next target is more sophisticated system including machine learning methods, and maybe better procedures for choosing good candidate systems during backtesting.

2009-09-21

How to eat spaghetti (code)

I'm thinking about dinner so the subject has a culinary style.

I have spent some time fighting with spaghetti code that grown from adding more and more conditional strands to initial prototype of application framework.

Before major version release of middle size production system I had to add a new feature to the biggest important process. Not so big change - it looked simple. It just involved doubling of some model objects and making two separate subprocesses. After alternating main flow, many side effects occurred, caused by intertwined logic and persistence. I had to do some clean up, cut off tangled strands, standardize conditional flows and reduce code. The results still weren't valid - at least I have found "single point of failure". Because of time constraints I had to fix it with block of ugly code. The project needs change in the process structure to adapt new features in more seamless way.

When you meet that kind of "spaghetti code" there are two known ways of dealing with it:
- pull one strand at a time - clear one flow path - repeat until structure is simple enough
- eat it all at once - analyze requirements and used implementation and rewrite it from start

Reduce structure, simplify, refactor and do not let the code grow into spaghetti again. It will ruin maintainability and extendability of software project in future.

2009-08-12

Scatter chart library - moving to Flot

After playing with Open Flash Chart 2 trying to make interactive scatter plot, I've found severe glitches that popped up during prototyping. Library worked quite well for standard line and bar charts. But for my specific scatter chart I realized that:
  • I have to use hacks to provide 0,0 origin based XY axes (OK I could just use standard left/bottom axes)
  • there are problems with larger scale values (I didn't checked exactly but values in range to 10000 rendered OK, somewhere above it is some kind of limitation)
  • problem with grid rendering for values in less than zero range
  • OFC can't parse scientific notation values (data number formatting is a must)
  • some minor problems that could be solved by chart tuning and hacking ranges etc.
  • after playing with OFC stable version I've checked last trunk version that worked much better

I summed all problems and thought about potential extendability problems and tried to move to library based on HTML Canvas object. One of the simplest and most mature projects is Flot. It has all required features, including interaction. The only problem I found was rendering under IE using Excanvas emulation object. Standard stable Flot version doesn't work well under IE8. Charts were drawn although without data points. After checking project issues list, I've found that some problems where resolved by using newer JQuery and Excanvas library. I've tried to run Flot from trunk version, and my IE8 problems were solved. As a extra newer Flot version contains more interesting plugins like navigation. BTW maybe it's time to publish next Flot stable version in downloads section. The only disadvantage of that solution is forcing IE users to accept running Excanvas security policy.

2009-08-05

Long break and back to work

It was long time ago from last post. I had real "without thinking about work" vacation. Mostly cycling and resting with family in small house near lake shore. I've been using Internet mostly for communication and weather forecasts. After back to work I had to catch up to meet approaching deadlines. So sorry about not giving any signs of life for a long time.