I'm sure some are wondering about the status of Power Trader, so here it is.
Power trader will exit Beta this weekend with an update. The only update this week will be a "re-short" button. I've been quite pleased with the lack of problems with Power Trader, it seems to work quite well and does the job it was designed for.
So. Where's the ticker and monitor?
Here's the thing. I have the ticker complete and I'm just waiting to see if the HSX peep's have any comments on what I placed on the feedback board. So far so good. With that said, here's why it took longer than it would seem other programmers could accomplish the same task.
When starting on the ticker, I had a few goals in mind that, if not met, I would not continue developing the ticker.
#1: It had to cause -less- server load on HSX servers than people using "Radar Ports".
#2: It had to NOT use a database, loading XML data in to a database and then querying the database is an extra step I wasn't going to take and it would have slowed the process.
#3: It had to be light-weight, both in coding effort and final binary size.
#4: It had to be able to provide "Live" price data and not miss anything.
So, how did I accomplish all of those lofty goals? Behold the power of C# with the .net 3.5 framework. .net 3.5 provides LINQ, and more specifically XLINQ. LINQ provided the query language to be able to directly query an XML file with no schema, no database and the query language is similar to SQL, making it very easy to generate complex queries with very little code. And here's the kicker, it's super fast, as it loads the data in to memory space before running the query.
E.G.
XElement Elem = XElement.Load(@"C:\HSXdata\hsx.xml");
XElement Elem2 = XElement.Load(@"C:\HSXdata\hsx_old.xml");
var query = from c in Elem.Descendants("sec")
from d in Elem2.Descendants("sec")
where
(c.Element("tkr").Value == d.Element("tkr").Value)
&& (c.Element("prc").Value != d.Element("prc").Value)
select new { c, d };
OK, so I went all geek on you. This is what that means for you, this query looks through every stock on the exchange in 3 seconds and give all of the price changes. Pretty cool eh? Another cool thing I added to it is that the output is CSV, so you can throw the text into any spreadsheet and chart, filter & sort until you're blue in the face.
So, what about the monitor? Well the code the ticker provides directly translates to the code for the monitor with a few minor changes. So as soon as I'm sure the ticker is stable, I can start in earnest on the monitor.
Thanks, as always, for your interest.
Friday, March 21, 2008
So. What's up with Power Trader?
Labels: Power Trader
Posted by Mark Schneider at 9:10 AM
Subscribe to:
Post Comments (Atom)


0 comments:
Post a Comment