Trading Tools – Stock Price Decline Checker

Stock Market Trader Desk
Stock Market Trader Desk

As a trader and investor, I’m constantly trying to make profitable stock trades and invest more wisely. I’m primarily looking for ways to increase returns, decrease risk, and to make smarter decisions.

One of the ways I make better trades and invest more wisely is through the use of various trading and investing tools. There are many great tools and web sites out there to help trading and investing research, such as R, Yahoo! Finance, Google Finance, and Wolfram Alpha, to name a few. Sometimes I’ll even create my own tools to use.

One of the tools I’ve created is the Stock Price Decline Checker which you can find on my GitHub.

The stock price decline checker tool checks a list of stocks to see if the price has declined a certain percentage from its maximum price over a specified number of days.

The goal is to identify primarily index ETFs that have declined substantially in price from their maximum values over the past few weeks or months, which could potentially signal a buying opportunity.

One way I use the stock price decline checker is to see if index ETFs such as QQQ, SPY, or DIA have declined significantly from their max prices over the past 2 months. To be more specific, I’ll run the stock price decliner checker to check if the index ETFs have fallen over 7.5% over the past 50 days. This kind of fall would indicate a substantial drop in the overall market price, such as a market correction, and to me this could signal a good buying opportunity.

Here are some links to my other trading and investing related web sites and tools:

Pelican, a static site generator written in Python

What is Pelican?

Pelican is a static site generator, written in Python. Pelican is open source and you can find Pelican on GitHub.

Pelican also supports themes and plugins. You can write your own themes and plugins, or you can download many different themes and plugins already made and ready to go.

Pelican is similar to Jekyll in that both are static site generators and easy to use. The big difference is Pelican is written in Python while Jekyll is written in Ruby. If you prefer Python syntax, like I do, Pelican may be perfect for you.

Pelican Features

Pelican has many different features and tools to help you generate your static web site. Here is a list of the most popular Pelican features:

  • Write your content directly with your editor of choice, such as vim or Sublime Text, in reStructuredText, Markdown, or AsciiDoc formats.
  • Includes a simple CLI tool to run a development/testing web server and (re)generate your site.
  • Easy to interface with version control systems and web hooks such as GitHub.
  • Completely static output is easy to host anywhere. I use Rackspace Cloud Files CDN.
  • Built in support for Articles (such as blog posts) and Pages (such as “About”, “Projects” and “Contact” pages).
  • Theming support using Jinja2 templates.
  • Code syntax highlighting.
  • Atom and RSS feeds
  • PDF generation of the articles/pages (optional).
  • Comments, via an external service such as Disqus.
  • Publication of articles in multiple languages.
  • Import your existing site from WordPress, Dotclear, or RSS feeds.
  • Integration with external tools: Twitter, Google Analytics, etc. (optional).

Read More about Pelican

For more information about Pelican, take a look at the Pelican Blog, the Pelican code on GitHub, and the Pelican Documentation.

Jekyll with Clean URLs Hosted at Rackspace Cloud Files

I’ve been using Jekyll to generate static web sites and then hosting them on the Rackspace Cloud Files CDN which uses Akamai’s content delivery network (CDN).

With Rackspace Cloud Files I have a CDN-enabled container and I have enabled my container to serve static web site files. This means I can use Rackspace Cloud Files with Akamai CDN to serve all my static web sites and I do not need to run or manage my own servers for web hosting. I simply use Cloud Files to store and serve my site. Some bonuses to using Cloud Files with CDN are my site is served to visitors very fast and my site can easily handle a very large number of visitors. Basically, my static site can handle web scale traffic.

What are Clean URLs?

I’m an advocate of using clean URLs, or human-readable URLs, in my sites. Clean URLs have many benefits:

  • Search engine optimization
  • Improved usability
  • Improved accessibility
  • Simplifies URLs
  • Easier to remember URLs
  • Do not contain implementation details of your site (Example: no php / html / asp / etc extensions on the URL)

Here’s an example of an un-clean URL:

And here’s an example of a clean URL:

Notice there is no .html and the URL looks better. Cleaner.

What is Jekyll?

Jekyll is a simple, blog aware, static site generator written in Ruby. It lets you create text-based posts and pages and a default layout that will be used across all of your posts. So you can easily change the look and feel of your site by modifying your default template and then re-generate your site, and the changes will be applied to all of your blog posts. Jekyll also generates static files that you can use on your CDN or host them yourself on your own server.

Jekyll does not create clean URLs by default, however. It will append .html to the file name and reference URLs with the .html suffix. Not ideal for a clean URL.

How To Get Clean URLs with Jekyll

I’m using a jekyll plugin which rewrites the file name and URL reference so that the html suffix is not included. It turns your blog-post.html file name in to “blog-post” without the .html extension.

To use Clean URLs with jekyll, you’ll need to set your permalink format in your jekyll _config.yml and use a jekyll plugin to generate your web site files without the .html extension.

Here is the _config.yml permalink structure I use for my site:

permalink: /:categories/:title

This will create a friendly URL in the form of:

If you don’t want to display the category in the URL, you can change the permalink to:

permalink: /:title

And this will create a URL in the format of:

Check out the jekyll plugin I’m using on my github here: jekyll-rackspace-cloudfiles-clean-urls

Rackspace Cloud Files with Jekyll and Clean URLs

I came across another problem: Rackspace Cloud Files does not know what type of file “blog-post” is as there is no file extension on it. When you browse to my CDN-hosted site to a clean URL, your browser would try to download the file instead of rendering it as html. The reason is that Cloud Files can’t peer inside the file and see that it’s all HTML code and apply the correct content type. I needed to manually set the content type myself and tell Rackspace Cloud Files that “blog-post” is type “text/html” so that a web browser can properly display it.

In order to solve this problem I have written a python helper script to apply the “text/html” content type automatically for my jekyll generated sites. My python helper script will upload my site to Rackspace Cloud Files for me and check the files it has uploaded to see if they are HTML files or not. If an HTML file is found, the python helper script will tell Cloud Files it is type “text/html”, allowing Cloud Files to properly display the html to a browser.

Download my Cloud Files / jekyll helper script from my github: jekyll-rackspace-cloudfiles-clean-urls

What’s In Your Drinking Water?

Glass of water
What’s in your drinking water?

I was curious to see what chemicals, pollutants, toxins, and other materials were in my tap water. After a little research I came across the Environmental Working Group reports on contaminants in water for cities and states around the US. The EWG contains detailed reports and analysis of chemicals and other pollutants in common tap water for your city and state.

You can locate your state on the page Water Quality by State. Once you pull up your state you can then browse by city to see your local city’s pollutants and contaminants in your local water.

Which big cities have the best and worst water? Check out this list: Big City Water Ratings.

Some quick links for those interested: