April 2007 Archives

Yahoo quotes

| | Comments (0) | TrackBacks (0)

[Yahoo documentation of quote fields]

[External documentation of fields]

PurposeValue
Symbols
Namen
Last Trade (With Time)l
Last Trade (Price Only)l1
Last Trade Dated1
Last Trade Timet1
Last Trade Sizek3
Change and Percent Changec
Changec1
Change in Percentp2
Ticker Trendt7
Volumev
Average Daily Volumea2
More Infoi
Trade Linkst6
Bidb
Bid Sizeb6
Aska
Ask Sizea5
Previous Closep
Openo
Day's Rangem
52-week Rangew
Change From 52-wk Lowj5
Pct Chg From 52-wk Lowj6
Change From 52-wk Highk4
Pct Chg From 52-wk Highk5
Earnings/Sharee
P/E Ratior
Short Ratios7
Dividend Pay Dater1
Ex-Dividend Dateq
Dividend/Shared
Dividend Yieldy
Float Sharesf6
Market Capitalizationj1
1yr Target Pricet8
EPS Est. Current Yre7
EPS Est. Next Yeare8
EPS Est. Next Quartere9
Price/EPS Est. Current Yrr6
Price/EPS Est. Next Yrr7
PEG Ratior5
Book Valueb4
Price/Bookp6
Price/Salesp5
EBITDAj4
50-day Moving Avgm3
Change From 50-day Moving Avgm7
Pct Chg From 50-day Moving Avgm8
200-day Moving Avgm4
Change From 200-day Moving Avgm5
Pct Chg From 200-day Moving Avgm6
Shares Owneds1
Price Paidp1
Commissionc3
Holdings Valuev1
Day's Value Changew1,
Holdings Gain Percentg1
Holdings Gaing4
Trade Dated2
Annualized Gaing3
High Limitl2
Low Limitl3
Notesn4
Last Trade (Real-time) with Timek1
Bid (Real-time)b3
Ask (Real-time)b2
Change Percent (Real-time)k2
Change (Real-time)c6
Holdings Value (Real-time)v7
Day's Value Change (Real-time)w4
Holdings Gain Pct (Real-time)g5
Holdings Gain (Real-time)g6
Day's Range (Real-time)m2
Market Cap (Real-time)j3
P/E (Real-time)r2
After Hours Change (Real-time)c8
Order Book (Real-time)i5
Stock Exchangex

Photo stamps

| | Comments (0) | TrackBacks (0)

Third party python packages

| | Comments (0) | TrackBacks (0)
*Third party python packages http://cheeseshop.python.org/pypi/

Python analytics

| | Comments (0) | TrackBacks (0)

These use the numpy library, I believe. I adapted them to work in a more vanilla python way as I could not get my head around numpy.

Exponential moving average

def ema(s, n):
    """
    returns an n period exponential moving average for
    the time series s

    s is a list ordered from oldest (index 0) to most recent
    (index -1) n is an integer

    returns a numeric array of the exponential moving average
    """
    s = array(s)
    ema = []
    j = 1
    #get n sma first and calculate the next n period ema
    sma = sum(s[:n]) / n
    multiplier = 2 / float(1 + n)
    ema.append(sma)
    #EMA(current) = ( (Price(current) - EMA(prev) ) xMultiplier) + EMA(prev)
    ema.append(( (s[n] - sma) * multiplier) + sma)
    #now calculate the rest of the values
    for i in s[n+1:]:
        tmp = ( (i - ema[j]) * multiplier) + ema[j]
        j = j + 1
        ema.append(tmp)
    return ema

Simple moving average

def movavg(s, n):
    """
    returns an n period moving average for the time series s
       
    s is a list ordered from oldest (index 0) to most recent (index -1)
    n is an integer

        returns a numeric array of the moving average

    See also ema in this module for the exponential moving average.
    """
    s = array(s)
    c = cumsum(s)
    return (c[n-1:] - c[:-n+1]) / float(n-1)

Excel: Find unique values in column

| | Comments (0) | TrackBacks (0)

Excel: Find unique values in column

Sub FindUniqueValues()
    Call Rows("1:1").Insert(Shift:=xlDown)
    Range("A1").Value = "Email"
    Range("B1").Value = "Unique"
    Call Columns("A:B").Sort(Key1:=Range("A2"), _
        Order1:=xlAscending, Header:=xlYes, _
        OrderCustom:=1, MatchCase:=False, _
        Orientation:=xlTopToBottom, _
        DataOption1:=xlSortNormal)
        
    Dim wks As Worksheet
    Set wks = ThisWorkbook.ActiveSheet
    Dim startCell As Range, endCell As Range:
    Set startCell = Range("B2")
    Set endCell = wks.Cells.SpecialCells(xlCellTypeLastCell)
    startCell.FormulaR1C1 = "=RC[-1]<>R[1]C[-1]"
    Dim r As Range
    Set r = Range(startCell, endCell)
    Call startCell.AutoFill(Destination:=r)
    Call wks.Calculate
    Set r = Columns("A:B")
    Call r.AutoFilter
    Call r.AutoFilter(Field:=2, Criteria1:="TRUE")
End Sub

n Guilty Men

| | Comments (0) | TrackBacks (0)
"Better that ten guilty persons escape than that one innocent suffer," says English jurist William Blackstone.  The ratio 10:1 has become known as the "Blackstone ratio." Lawyers "are indoctrinated" with it "early in law school." "Schoolboys are taught" it. In the fantasies of legal academics, jurors think about Blackstone routinely.

[n Guilty Men]
*Python libraries for scientific and numerical work numpy (numpy.scipy.org) provides the underlying data structures (array and matrices among other things) you require. This will handle all your vector stuff, reading/writing to and from files, "loop macros", etc. scipy (www.scipy.org) provides a set of scientific programming libraries, including stats, fft and many other things. Have a look around and see if it already does what you want. matplotlib (http://matplotlib.sourceforge.net/) takes care of all your plotting needs, and plays nice with numpy and scipy.

Doom as a tool for system administration

| | Comments (0) | TrackBacks (0)
*Doom as a tool for system administration http://www.cs.unm.edu/~dlchao/flake/doom/
*Import Excel Spreadsheet Data into SQL Server Database Table Using SqlBulkCopy http://davidhayden.com/blog/dave/archive/2006/05/31/2976.aspx

Prompting for database connection

| | Comments (0) | TrackBacks (0)

Add a COM reference to:
Microsoft OLE DB Service Component 1.0 Type Library
Microsoft ActiveX Data Objects 2.7 // any 2.5 or higher version is fine

You can then write code like:

//
// Prompt for a totally new connection string
//
private void button1_Click(object sender, EventArgs e)
{
    bool Cancelled = false;
    string ConnectionString = string.Empty;

    MSDASC.DataLinks d = new MSDASC.DataLinks();
    d.hWnd = (int)this.Handle;
    ADODB._Connection c = (ADODB._Connection)d.PromptNew();
    if (c == null)
        Cancelled = true;
    else
    {
        Cancelled = false;
        ConnectionString = c.ConnectionString;
    }
}

//
// Edit a connection string
//
private void button2_Click(object sender, EventArgs e)
{
    bool Saved = false;
    string ConnectionString = "Provider=SQLOLEDB.1;Integrated
Security=SSPI;Persist Security Info=False;User ID=sa;Initial
Catalog=Northwind;Data Source=.";

    MSDASC.DataLinks d = new MSDASC.DataLinks();
    d.hWnd = (int)this.Handle;
    object c = new ADODB.Connection();
    ((ADODB._Connection)c).ConnectionString = ConnectionString;
    Saved = d.PromptEdit(ref c);
    if (Saved)
    {
        ConnectionString = ((ADODB._Connection)c).
          ConnectionString;
    }
}
*Using the Visual Studio Connection String Dialog http://adoguy.com/2007/01/29/Using_the_Visual_Studio_Connection_String_Dialog.aspx http://adoguy.com/downloads/TestDataConnectionUI.zip

*SQL Server 2005 GUID primary keys
CREATE TABLE Employee (EmployeeID uniqueidentifier DEFAULT NEWSEQUENTIALID())

How books work: Gutenberg explains

| | Comments (0) | TrackBacks (0)
*How books work: Gutenberg explains http://www.boreme.com/boreme/funny-2007/introducing-the-book-p1.php
*If you have to ask, you're probably doing something wrong http://blogs.msdn.com/oldnewthing/archive/2007/03/01/1775759.aspx

Screen: overhead volume breakout

| | Comments (0) | TrackBacks (0)
*Screen: overhead volume breakout (1) Search for last down day with a large range and high volume (2x 20-day MA volume) (2) Watch point is that day's open (3) Wait for stock to clear that point

Microsoft communities

| | Comments (0) | TrackBacks (0)
*Microsoft communities http://www.microsoft.com/communities/default.mspx *Custom molds for earphones and headsets http://earplugstore.stores.yahoo.net/cusfitearmol1.html

Dondero High School music

| | Comments (0) | TrackBacks (0)
The annual Pop Concert was a beloved institution at Dondero High School from 1971-2006. It was directed by music instructor Rick Hartsoe for 35 years, assisted by Jan Stewart since 1983. The A Capella Choir and student instrumentalists traditionally presented 20 popular songs per concert: ten full choir pieces chosen for their harmonic and instrumental interest, and ten solos of the students' choosing. The nine soloists were student-selected via an audition process, and the top soloist each year was obliged to perform an encore.

[Dondero High School music]

Trading websites

| | Comments (0) | TrackBacks (0)

Rent or buy?

| | Comments (0) | TrackBacks (0)

Is it better to rent or buy?
Calculator compares renting and buying for a specific rental versus a specific home purchase.

Yahoo Canada

| | Comments (0) | TrackBacks (0)
*Yahoo Canada http://ca.finance.yahoo.com/?u

Python and sqlite package

| | Comments (0) | TrackBacks (0)
*Python and sqlite package http://initd.org/tracker/pysqlite/wiki/pysqlite http://www.sqlite.org/ http://www.pysqlite.org/

Moby Word list

| | Comments (0) | TrackBacks (0)

[HDB 2008-06-04] This seems to have moved to an unidentified location. Or, more likely, it has been removed from the internet. It's really useful. I wish I'd downloaded it when I had the chance.

[Moby Word list]

StockDigg

| | Comments (0) | TrackBacks (0)

Trading links

| | Comments (0) | TrackBacks (0)
tradingmarkets.com - Lots of good info.
hardrightedge.com - good resource
realitytrader.com - scalping techniques
tradethenews.com - It would be nice to have a spare pc to run the news via audio
briefing.com - subscription based news
advfn.com - charts and much more free stuff
investorflix.com- rent trading DVD's
wealth-lab.com - shared trading strategies
invest-store.com/activetradermag/bookstore/ - low cost tapes
activetradermag.com - good magazine
gndt.com - best trading platform around

USB phone recorder

| | Comments (0) | TrackBacks (0)

Python and databases

| | Comments (0) | TrackBacks (0)
*Python and databases http://dmoz.org/Computers/Programming/Languages/Python/Modules/Databases_and_Persistence/ http://adodbapi.sourceforge.net/ http://sourceforge.net/projects/adodbapi

CodingHorror links

| | Comments (0) | TrackBacks (0)

[PowerPoint presentations]

[Code smells]

[The Last Configuration Section Handler.. Revisited]

PathCompactPathEx()

[DllImport("shlwapi.dll", CharSet = CharSet.Auto)]
static extern bool PathCompactPathEx(
    [Out] StringBuilder pszOut, 
    string szPath, int cchMax,
    int dwFlags);

static string PathShortener(string path, int length)
{
    StringBuilder sb = new StringBuilder();
    PathCompactPathEx(sb, path, length, 0);
    return sb.ToString();
}

Benefits of writing unit tests first

  1. Unit tests prove that your code actually works
  2. You get a low-level regression-test suite
  3. You can improve the design without breaking it
  4. It's more fun to code with them than without
  5. They demonstrate concrete progress
  6. Unit tests are a form of sample code
  7. It forces you to plan before you code
  8. It reduces the cost of bugs
  9. It's even better than code inspections
  10. It virtually eliminates coder's block
  11. Unit tests make better designs
  12. It's faster than writing code without tests

Using Fiddler with Firefox

| | Comments (0) | TrackBacks (0)
[Using Fiddler with Firefox]

All you need to do is:

  • Open FireFox options
  • Go to General | Connection Settings
  • Use the Manual proxy configuration option
  • Set t 127.0.0.1 Port 8888

Who Is This Person? [Firefox Add-ons]

| | Comments (0) | TrackBacks (0)

Who Is This Person? [Firefox Add-ons]

With the Who Is This Person? Firefox extension, highlight a name on a web page and with a click look up someone's personal details in LinkedIn, Wikipedia, Technorati, Yahoo Person Search, Google News, TailRank and more. Useful!

Coding Horrors favorites

| | Comments (0) | TrackBacks (0)

S3Fox Organizer for FireFox

| | Comments (0) | TrackBacks (0)

S3Fox Organizer for FireFox

S3Fox Organizer for Amazon(S3Fox) v0.4: (NEW!) This firefox extension(browser plugin) provides an user friendly interface for Amazon's S3 (Simple Storage Service) . Its interface is very much similar to the FTP interface that lists local folders in the left panel and S3 buckets/files/folders in the right panel. Files/folders can be moved from the local computer to Amazon's storage space and vice versa.

S3Fox

FireFox addins

| | Comments (0) | TrackBacks (0)

IPCop

| | Comments (0) | TrackBacks (0)

Firefox addin for stock charts

| | Comments (0) | TrackBacks (0)
Firefox addin for stock charts. Selection symbols from text of web page, right-click, select 'Open Stock Charts', and you get stock charts of the selected symbols.

[Description]
[Download from stocktickr.com]

Speeding up FireFox the right way

| | Comments (0) | TrackBacks (0)

Technical trading strategies

| | Comments (0) | TrackBacks (0)

Stock Charts Firefox Extension

| | Comments (0) | TrackBacks (0)

FireFox secrets

| | Comments (0) | TrackBacks (0)
*FireFox secrets http://windowssecrets.com/041202/#top1

Keyboard equivalents of Remote Desktop

| | Comments (0) | TrackBacks (0)

Speed up FireFox

| | Comments (0) | TrackBacks (0)

Trading blogs

| | Comments (0) | TrackBacks (0)
http://www.thekirkreport.com - lots of news and links, updates everyday, posts his trades http://www.traderxblog.com - posts his trades, shows charts, educates, very good active trader
http://www.tradermike.net - posts some trades, free chart analysis
http://www.slytrader.net - posts his trades and charts, very good active trader http://www.tradediary.net - posts his trades
http://nasdaqtrader.blogspot.com http://stocktradingguy.blogspot.com http://traderjamie.blogspot.com
http://stockcoach.blogspot.com
http://tapeworm.typepad.com
http://slovakchart.typepad.com
http://activetrade.blogspot.com
http://englishmantrader.blogspot.com


FireFox fetch text extension

| | Comments (0) | TrackBacks (0)
*FireFox fetch text extension http://www.cs.utexas.edu/~jchien/code/ftu.html
*Faster fox (performance and network tweaks for Firefox) http://fasterfox.mozdev.org/ - Prefetching - Fasterfox uses idle bandwidth times to pre-fetch and cache the links on your current page. - Network Tweaks - You set how Fasterfox controls simultaneous connections, pipelining, caching and more. - Pop-up Blocker - It blocks Flash plug-in pop-ups now. - Page Load Timer - Shown here, this tests the effectiveness of your settings. After all, it's called Fasterfox, not Moderatelyslowfox.

DownThemAll

| | Comments (0) | TrackBacks (0)
FireFox addin to download files from web page. DownThemAll lets you download all the links or images contained in a webpage.

[LifeHacker description]
[Mozilla download link]

Mozilla addons

| | Comments (0) | TrackBacks (0)

Secrets of Firefox 1.0

| | Comments (0) | TrackBacks (0)
*Secrets of Firefox 1.0 http://windowssecrets.com/041202/#top1

Top 15 Firefox Extensions

| | Comments (0) | TrackBacks (0)
*Top 15 Firefox Extensions http://www.pcmag.com/article2/0,1759,1758849,00.asp

FireFox addin for showing file type of link

| | Comments (0) | TrackBacks (0)
FireFox addin for showing file type of link, such as PDF, RSS feed, XML, mailto link, Word doc, Excel doc,  ZIP file, etc., all cued with an icon inline.

[Description at bolinfest.com]

FireFox addins for passwords

| | Comments (0) | TrackBacks (0)

Websites for definitons and neologisms

| | Comments (0) | TrackBacks (0)

Websites for definitons and neologisms

Python APIs for database

| | Comments (0) | TrackBacks (0)
*Python APIs for database http://dmoz.org/Computers/Programming/Languages/Python/Modules/Databases_and_Persistence/ http://adodbapi.sourceforge.net/ http://sourceforge.net/projects/adodbapi

Alphabetize procedures/subs

| | Comments (0) | TrackBacks (0)
*Alphabetize procedures/subs The only thing I've seen (but haven't tried) is http://www.modelmakertools.com/code-explorer-vs/features.html Also, you might be interested something to sort imports/using's: http://www.visualstudiohacks.com/importsorter