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 19 - Tue

Volume At Price

It is said that, through the course of the day, trading trends will revert to the level of highest volume.

The software at Ensign Software has a feature which will chart a nice bar graph of the volume-at-price distribution for visual traders.

However, for a quick and dirty indicator at a single level only, fit for automated trading, I wrote the following small class:

public class VolumeAtPrice {
	
	SortedList slVolumeAtPrice;
	public int LargestVolume = 0;
	public double PriceAtLargestVolume = 0;
	
	public VolumeAtPrice() {
		slVolumeAtPrice = new SortedList( 400 );
	}
	
	public void Add( Trade trade ) {
		if ( slVolumeAtPrice.ContainsKey( trade.Price ) ) {
			int ix = slVolumeAtPrice.IndexOfKey( trade.Price );
			int volume = (int) slVolumeAtPrice.GetByIndex( ix );
			volume += trade.Size;
			slVolumeAtPrice.SetByIndex( ix, volume );
			if ( volume > LargestVolume ) {
				LargestVolume = volume;
				PriceAtLargestVolume = trade.Price;
			}
		}
		else {
			slVolumeAtPrice.Add( trade.Price, trade.Size );
			if ( trade.Size > LargestVolume ) {
				LargestVolume = trade.Size;
				PriceAtLargestVolume = trade.Price;
			}
		}
	}
}

After updating with the latest Trade, examine PriceAtLargestVolume to see where the current highest volume trading level occurs.



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



December
Su Mo Tu We Th Fr Sa
         
19
           


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

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.