One Unified Global Perspective
Communications with a Global Perspective
Home
Intro
Contact Us
Voice over IP
PBX Solutions
Services
Support
Glossary
Open Source
Blog
Forum

WebMail





2007 Jun 05 - Tue

Sliding Window Statistics

Processing bars can lag data somewhat. Bars can also introduce sharp changes in statistics. Instead, I prefer to work with Trades and Quotes directly. But I still need the ability to work with summary statistics.

I've created an O(1) running time mechanism for processing trades and quotes in real time. The resulting code is provided in Accumulation.cs. The basic class I use is SimpleAccumulationStatsOnQuotes. The class is instantiated as an object by defining the window width in seconds. The class will maintain a list of quotes. As quotes are added, they are added to the summary statistics. As quotes fall outside the window, the quotes are removed from the summary statistics.

The summary statistics provide the basics for maintaining Bollinger Bands for the selected moving window time frame.

The class AccumulateQuotes is a brute force approach to calculating slope change velocities and acceleration. I think, with suitable modification of the basic statistics, this class would not be needed.

Running statistics are maintained through a reference to the RunningStats class.

If you wish to know the Minimum/Maximum levels over an interval, a RunningMinMax class helps. It is more of a manual process, with the AddPoint and RemovePoint methods.

[/Trading/SmartQuant/Articles] permanent link



Blog Content ©2008
Ray Burkholder
All Rights Reserved
ray@oneunified.net
(441) 505 7293
Available for Contract Work
Resume

RSS: Click to see the XML version of this web page.

View Ray 
Burkholder's profile on LinkedIn
technorati
Add to Technorati Favorites



June
Su Mo Tu We Th Fr Sa
         
5


Main Links:
Monitoring Server
SSH Tools
QuantDeveloper Code

Special Links:
Frink

Blog Links:
Sergey Solyanik
Marc Andreessen
HotGigs
Micro Persuasion
... Reasonable ...
Chris Donnan
BeyondVC
lifehacker
Trader Mike
Ticker Sense
HeadRush
TraderFeed
Stock Bandit
The Daily WTF
Guy Kawaski
J. Brant Arseneau
Steve Pavlina
Matt Cutts
Kevin Scaldeferri
Joel On Software
Quant Recruiter
Blosxom User Group
Wesner Moise
Julian Dunn
Steve Yegge

2007
Months
Jun




Mason HQ

Disclaimer: This site may include market analysis. All ideas, opinions, and/or forecasts, expressed or implied herein, are for informational purposes only and should not be construed as a recommendation to invest, trade, and/or speculate in the markets. Any investments, trades, and/or speculations made in light of the ideas, opinions, and/or forecasts, expressed or implied herein, are committed at your own risk, financial or otherwise.