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





2006 Dec 06 - Wed

Finding Local Peaks in Quote/Trade Streams

Just about any book on technical analysis you open will have a number of charts showing the usual peaks and valleys of a instrument's trading range. Many trading strategies are designed around the specific arrangement of peaks and valleys. I thought, up till now, that these peaks and valleys could only be determined through studies through the use of the good old Mark I Eyeball.

However, after reading Bollinger's book entitled Bollinger on Bollinger Bands, in which he discusses computer aided determination of those peaks and valleys, I set out to work on an algorithm to do the same.

The C# PeakMatch Code Segment is my first attempt at peak and valley pattern matching.

It is implemented as a state machine in order to make it easy to determine, during live streams, whether the stream is going up or down. You can use various summary statistics from quotes, trades, or even bars as input values.

The variable dblPatternDelta is the grey zone used for determining when the pattern flips. This variable will need to be adjusted on an instrument by instrument basis. In addition, further tuning is necessary if you wish to capture small nuances or just large swings in the trading value. As such, determining the peak is a problem of lag. Sigh, so much for having a magical realtime signal for determining when the top or bottom of a range. The variable dtPatternPt1 holds the DateTime of the last determined peak. When a change of direction of determined, then that peak/valley attribute is stored in dsPattern.

dsPattern can then be used within a sliding window of pattern analysis. I'll show an implementation of Arthur Merrill's patterns in another article.

Further information on choosing a good value for dblPatternDelta can be found in Bollinger's book.



Blog Content ©2009
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.

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



December
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
Max Dama

2006
Months
Dec




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.