<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Chicken Coop &#187; options</title>
	<atom:link href="http://www.fastchicken.co.nz/category/options/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fastchicken.co.nz</link>
	<description>Development, with chickens. Because chickens are cool. (aka Nic Wise&#039;s blog)</description>
	<lastBuildDate>Thu, 09 Sep 2010 17:38:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Google App Engine &#8211; used in anger (finally)</title>
		<link>http://www.fastchicken.co.nz/2009/03/15/google-app-engine-used-in-anger-finally/</link>
		<comments>http://www.fastchicken.co.nz/2009/03/15/google-app-engine-used-in-anger-finally/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 12:37:55 +0000</pubDate>
		<dc:creator>Nic Wise</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[options]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.fastchicken.co.nz/?p=569</guid>
		<description><![CDATA[I&#8217;ve been keeping an eye on the Google App Engine (GAE) for quite a while now. I love the idea of it &#8211; easy to develop on, all of most of the API is provided for you, and it runs &#8230; <a href="http://www.fastchicken.co.nz/2009/03/15/google-app-engine-used-in-anger-finally/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">I&#8217;ve been keeping an eye on the Google App Engine (GAE) for quite a while now. I love the idea of it &#8211; easy to develop on, all of most of the API is provided for you, and it runs on rather well-proven hardware. They have changed the terms a few times, and as a result, a lot of the initial issues with it &#8211; eg if you load it up too much &#8211; are gone or being delt with.</p>
<p style="text-align: left;">I&#8217;ve finally had a reason to use it in anger &#8211; well, mostly in happiness, but hey, I didn&#8217;t invent the term.</p>
<p style="text-align: left;"><a href="http://stocks.fastchicken.co.nz/">My application</a> is a small one. A very small one, it turned out. I&#8217;ve been doing some options trading over the past 3 months, and even tho I shouldn&#8217;t, I like to keep an eye on both the stock indexes (S&amp;P 500, NASDAQ, DOW) and any stocks I have options on. Ok, I admit it, I&#8217;m a data whore :). But getting that information while I&#8217;m out and about it tricky.</p>
<p style="text-align: left;">Most of the iPhone apps use delayed stock information &#8211; Bloomberg is a good example, as is the built in Stocks app, which feeds from Yahoo!. All of them are delayed at least 10 minutes, usually 20, which isn&#8217;t a lot of use to me.</p>
<p style="text-align: left;">Google is one of the few companies out there which provide real-time (or close to it) stock data to the public for free, but up until recently, they didn&#8217;t have an API to allow anyone to consume this information &#8211; it was only for use on <a href="http://www.google.com/finance">Google Finance</a>. I used <a href="http://www.google.com/finance">Google Finance</a> for a while, but the load time on the iPhone, over GRPS usually, was just too slow.</p>
<p style="text-align: center;"><img class="size-full wp-image-571 aligncenter" title="android_ss_portfolios" src="http://www.fastchicken.co.nz/wp-content/uploads/2009/03/android_ss_portfolios.png" alt="android_ss_portfolios" width="267" height="400" /></p>
<p style="text-align: center;">No, this is NOT my app. Did I mention I can&#8217;t do layout as good as this?</p>
<p style="text-align: left;">With the launch of the <a href="http://googlemobile.blogspot.com/2009/03/finance-for-android-app.html">Google Finance Android app</a>, Google have released (tho I&#8217;m guessing not officially) some of the API. You can now (officially) get to your portfolio and other information from Google Finance, and with a <a href="http://stackoverflow.com/questions/527703/google-financial-api-how-get-stock-quotes">little searching around</a>, there is a nice end point to get the actual stock price in JSON format (unofficially I guess).</p>
<blockquote style="text-align: left;"><p>http://finance.google.com/finance/info?q=GOOG</p>
<p>[ {<br />
"id": "694653" ,<br />
"t" : "GOOG" ,<br />
"e" : "NASDAQ" ,<br />
"l" : "324.42" ,<br />
"l_cur" : "324.42" ,<br />
"ltt":"4:00PM EDT" ,<br />
"lt" : "Mar 13, 4:00PM EDT" ,<br />
"c" : "+0.89" ,<br />
"cp" : "0.28" ,<br />
"ccol" : "chg" ,<br />
"el": "325.50" ,<br />
"el_cur": "325.50" ,<br />
"elt" : "Mar 13, 7:32PM EDT" ,<br />
"ec" : "+1.08" ,<br />
"ecp" : "0.33" ,<br />
"eccol" : "chg"<br />
} ]</p></blockquote>
<p style="text-align: left;">This is more than enough data for what I need &#8211; I can get the stock ticker (GOOG), the last price (323.42), when it happened, the change and change as a percentage and any after hours trading info (ec, ecp, el etc). Perfect.</p>
<p style="text-align: left;">So <a href="http://stocks.fastchicken.co.nz/">here&#8217;s the little app I made using this</a>. It doesn&#8217;t do a lot, but I don&#8217;t need it to, and due to me screwing up the initial setup, some of the features are only available if you have a @fastchicken.co.nz address (ie, Leonie and I), but it:</p>
<ul style="text-align: left;">
<li>Shows a list of stocks and their prices based on what you have configured it to show. If you dont have anything setup, or dont have an account, it just shows the three indexes.</li>
<li>Allows you to add and remove stocks from your list, and put them into Call, Put and Index categories. You have to be logged in to do this.</li>
<li>Displays on the iPhone, over a lousy GPRS connection, in less time than it takes me to go up the escalator at Canary Wharf.<strong> This was actually the main criteria</strong>.</li>
</ul>
<p style="text-align: left;">If you are not logged in, you just get the DOW, S&amp;P and NASDAQ.</p>
<p style="text-align: left;">The code is pretty simple. I have three &#8220;controllers&#8221; &#8211; one for the index, and one each for adding and removing a set of stocks. All the user management is handled by Google App Engine, so I dont need to do any of the usual stuff like:</p>
<p style="text-align: left;">Getting the url to do the whole login workflow:</p>
<blockquote style="text-align: left;"><p>login_url = users.create_login_url(self.request.uri)<br />
login_url_text = &#8216;Login&#8217;</p></blockquote>
<p>Working out if a user is logged in, and getting the user&#8217;s object:</p>
<blockquote style="text-align: left;"><p>if users.get_current_user():<br />
stocks_list = db.GqlQuery(&#8220;SELECT * FROM StockList WHERE owner = :1 order by category, ticker&#8221;, users.get_current_user())</p></blockquote>
<p style="text-align: left;">All very simple. The add and remove ones are not much code. There is a small external class &#8211; StockModel &#8211; which when given a ticker, name and category, goes off and calls the Google Finance endpoint and populates it&#8217;s fields with the (real time) data it gets. All the calls are done with the built in urlfetch api and a python JSON library. Aside from the portfolio &#8211; which ones to show &#8211; there is no data kept, and even that is just a reference to the user, the ticker (MSFT etc) and and category (Call, Put, Index).</p>
<p style="text-align: left;">All up, while this is a very (very, very&#8230;.) simple application, it does show some of the power of GAE if you play inside their sandbox, which I&#8217;m more than happy to do. Once they add some more things to it &#8211; <a href="http://googleappengine.blogspot.com/2009/02/roadmap-update.html">scheduled background tasks come to mind</a> &#8211; it&#8217;s definitely going to be a very viable platform for quick-to-develop, short-term applications. The integration into google accounts &#8211; especially into google apps for domains &#8211; is very nice. Not being able to change the security model from &#8220;my domain only&#8221; to &#8220;anyone with a google account&#8221; after I create the app is frustrating, but it&#8217;s easy to work around &#8211; I could just create a new app on GAE, but it&#8217;d be nice to just switch it, even if the database was trashed in the process.</p>
<p style="text-align: left;">The biggest issue I&#8217;ve had it finding the basic functions of the Python language. I have a copy of Learning Python (the Rat book), which is good, but not organised in a way I&#8217;d want &#8211; it has very little OO focus, and a lot on how the language works, and I&#8217;m just far enough beyond that for it to be a pain in the arse. Of course, there is good and the python docs, but a lot of the terms are different to other languages I&#8217;ve used lately &#8211; PHP and C# &#8211; so it gets a little confusing. Oh, well. It&#8217;ll come with time. Either that, or they will support Java (or C#, but I&#8217;d suspect Java comes first, as it&#8217;s an official Google language, along with C++)</p>
<p style="text-align: left;">The other issue is my total lack of CSS skills. I can do HTML and Javascript with a problem, but the nuances of CSS kick me, and I usually end up frustrated. Oh, well &#8211; that&#8217;ll come with time and some help from <a href="http://latower.com/">Gilles</a> and the other <a href="http://www.alecrust.com/">CSS</a> <a href="http://www.flog.co.nz/">ninjas</a> at work. It&#8217;s not something I&#8217;ve needed to learn, so I haven&#8217;t. It may be about time to start. Now&#8217;s good.</p>
<p style="text-align: left;">Next GAE project is in the works. I need to do something for Leonie to manage any properties which she is looking at, and the whole workflow and external links which go with that. Not sure when I&#8217;m going to get time &#8211; the app itself is trivial from a backend point of view, but as usual, the front end bits are painful&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fastchicken.co.nz/2009/03/15/google-app-engine-used-in-anger-finally/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>thats quite a bit of money</title>
		<link>http://www.fastchicken.co.nz/2009/02/24/thats-quite-a-bit-of-money/</link>
		<comments>http://www.fastchicken.co.nz/2009/02/24/thats-quite-a-bit-of-money/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 22:43:41 +0000</pubDate>
		<dc:creator>Nic Wise</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[options]]></category>

		<guid isPermaLink="false">http://www.fastchicken.co.nz/?p=553</guid>
		<description><![CDATA[From the One Option blog. Yesterday afternoon we learned that AIG would post the largest quarterly loss by a corporation – ever. In the last quarter they lost $60 billion. That is in addition to the $100 billion they lost &#8230; <a href="http://www.fastchicken.co.nz/2009/02/24/thats-quite-a-bit-of-money/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>From the <a href="http://www.1option.com/index.php/global/comments/dont_read_too_much_into_todays_bounce_from_deeply_a_oversold_contition/#When:17:59">One Option blog</a>.</p>
<blockquote><p>Yesterday afternoon we learned that AIG would post the largest quarterly loss by a corporation – ever. In the last quarter they lost $60 billion. That is in addition to the $100 billion they lost last year. When this all started, I remember them needing an $80 billion “bridge loan” until they could sell some assets. The government has already sunk $180 billion into this company and now it needs more to survive.</p></blockquote>
<p>$60 billion in a quarter, on top of $100 billion last year.</p>
<p><strong>B</strong>illion. Not <strong>M</strong>illion.</p>
<p>Bloody hell.</p>
<p>On the upside, the general population is getting used to another 4 zeros on the end of everything. Billion is now common. Trillion is semi-common. Million is old hat. Time people woke up to just how much money there is, and how much of it moves on a daily basis.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fastchicken.co.nz/2009/02/24/thats-quite-a-bit-of-money/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
