<?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>阿平的程序收藏集 &#187; 股票基金</title>
	<atom:link href="http://www.ppzhao.net/index.php/archives/category/fund/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ppzhao.net</link>
	<description>FLASH FLEX AS3 WEB UI ...</description>
	<lastBuildDate>Thu, 08 Apr 2010 08:14:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>正式成为股民</title>
		<link>http://www.ppzhao.net/index.php/archives/351</link>
		<comments>http://www.ppzhao.net/index.php/archives/351#comments</comments>
		<pubDate>Fri, 15 Jan 2010 03:00:32 +0000</pubDate>
		<dc:creator>阿平</dc:creator>
				<category><![CDATA[股票基金]]></category>

		<guid isPermaLink="false">http://www.ppzhao.net/?p=351</guid>
		<description><![CDATA[历史会记住这一天啊。
开户了，从此加入股民行列！虽然现在什么东西都不懂，慢慢研究。
]]></description>
			<content:encoded><![CDATA[<p>历史会记住这一天啊。</p>
<p>开户了，从此加入股民行列！虽然现在什么东西都不懂，慢慢研究。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ppzhao.net/index.php/archives/351/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FLEX做的基金定投预期收益计算程序</title>
		<link>http://www.ppzhao.net/index.php/archives/236</link>
		<comments>http://www.ppzhao.net/index.php/archives/236#comments</comments>
		<pubDate>Mon, 20 Jul 2009 13:31:04 +0000</pubDate>
		<dc:creator>阿平</dc:creator>
				<category><![CDATA[FLASH/FLEX开发]]></category>
		<category><![CDATA[股票基金]]></category>
		<category><![CDATA[资源下载]]></category>

		<guid isPermaLink="false">http://www.flashcs4.com.cn/?p=236</guid>
		<description><![CDATA[最近突然对基金感兴趣了，在周围人大肆炒股炒基金很多年后，我终于觉悟过来钱的重要性，也开始研究在没钱的状况下如何理财了。
由于刚刚才开始对这方面进行了解，玩不起来股票，就从基金开始入手。
随手用flex写了个简单的计算基金定投程序，实际上就是一个简单的递归，刚刚学C语言时就练习过的简单算法。

下面就是这个简单程序的源码，很简单的一个mxml,刚对flex入门的朋友可以稍微看看。

&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
&#60;mx:Application xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;absolute&#34;&#62;
	&#60;mx:Panel layout=&#34;absolute&#34; left=&#34;10&#34; right=&#34;10&#34; top=&#34;10&#34; bottom=&#34;10&#34; title=&#34;基金定投计算&#34; fontSize=&#34;12&#34;&#62;
		&#60;mx:Label x=&#34;10&#34; y=&#34;13&#34; text=&#34;定投金额&#34;/&#62;
		&#60;mx:Label x=&#34;10&#34; y=&#34;40&#34; text=&#34;月均收益&#34;/&#62;
		&#60;mx:Label x=&#34;10&#34; y=&#34;69&#34; text=&#34;定投月数&#34;/&#62;
		&#60;mx:Label x=&#34;10&#34; y=&#34;129&#34; text=&#34;资金总数&#34;/&#62;
		&#60;mx:TextInput y=&#34;10&#34; left=&#34;71&#34; right=&#34;10&#34; id=&#34;txt1&#34; text=&#34;500&#34;/&#62;
		&#60;mx:TextInput y=&#34;38&#34; left=&#34;71&#34; right=&#34;10&#34; text=&#34;0.01&#34; id=&#34;txt2&#34;/&#62;
		&#60;mx:TextInput y=&#34;66&#34; left=&#34;71&#34; right=&#34;10&#34; id=&#34;txt3&#34; text=&#34;12&#34;/&#62;
		&#60;mx:Text x=&#34;71&#34; y=&#34;130&#34; text=&#34;0.00&#34; color=&#34;#FF0000&#34; id=&#34;txt4&#34;/&#62;
		&#60;mx:Button x=&#34;71&#34; y=&#34;98&#34; label=&#34;计算&#34; id=&#34;bn&#34; click=&#34;onCount()&#34;/&#62;
		&#60;mx:TextArea top=&#34;158&#34; bottom=&#34;10&#34; left=&#34;71&#34; right=&#34;10&#34; id=&#34;txt5&#34;/&#62;
	&#60;/mx:Panel&#62;
	&#60;mx:Script&#62;
		&#60;![CDATA[
			private var [...]]]></description>
			<content:encoded><![CDATA[<p>最近突然对基金感兴趣了，在周围人大肆炒股炒基金很多年后，我终于觉悟过来钱的重要性，也开始研究在没钱的状况下如何理财了。<br />
由于刚刚才开始对这方面进行了解，玩不起来股票，就从基金开始入手。<br />
随手用flex写了个简单的计算基金定投程序，实际上就是一个简单的递归，刚刚学C语言时就练习过的简单算法。</p>
<p><object width="550" height="400" data="http://www.flashcs4.com.cn/wp-content/uploads/2009/07/dtcount.swf" type="application/x-shockwave-flash"><param name="src" value="http://www.flashcs4.com.cn/wp-content/uploads/2009/07/dtcount.swf" /></object><br />
下面就是这个简单程序的源码，很简单的一个mxml,刚对flex入门的朋友可以稍微看看。</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> layout=<span style="color: #ff0000;">&quot;absolute&quot;</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Panel</span> layout=<span style="color: #ff0000;">&quot;absolute&quot;</span> left=<span style="color: #ff0000;">&quot;10&quot;</span> right=<span style="color: #ff0000;">&quot;10&quot;</span> top=<span style="color: #ff0000;">&quot;10&quot;</span> bottom=<span style="color: #ff0000;">&quot;10&quot;</span> title=<span style="color: #ff0000;">&quot;基金定投计算&quot;</span> fontSize=<span style="color: #ff0000;">&quot;12&quot;</span><span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> x=<span style="color: #ff0000;">&quot;10&quot;</span> y=<span style="color: #ff0000;">&quot;13&quot;</span> text=<span style="color: #ff0000;">&quot;定投金额&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> x=<span style="color: #ff0000;">&quot;10&quot;</span> y=<span style="color: #ff0000;">&quot;40&quot;</span> text=<span style="color: #ff0000;">&quot;月均收益&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> x=<span style="color: #ff0000;">&quot;10&quot;</span> y=<span style="color: #ff0000;">&quot;69&quot;</span> text=<span style="color: #ff0000;">&quot;定投月数&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Label</span> x=<span style="color: #ff0000;">&quot;10&quot;</span> y=<span style="color: #ff0000;">&quot;129&quot;</span> text=<span style="color: #ff0000;">&quot;资金总数&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:TextInput</span> y=<span style="color: #ff0000;">&quot;10&quot;</span> left=<span style="color: #ff0000;">&quot;71&quot;</span> right=<span style="color: #ff0000;">&quot;10&quot;</span> id=<span style="color: #ff0000;">&quot;txt1&quot;</span> text=<span style="color: #ff0000;">&quot;500&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:TextInput</span> y=<span style="color: #ff0000;">&quot;38&quot;</span> left=<span style="color: #ff0000;">&quot;71&quot;</span> right=<span style="color: #ff0000;">&quot;10&quot;</span> text=<span style="color: #ff0000;">&quot;0.01&quot;</span> id=<span style="color: #ff0000;">&quot;txt2&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:TextInput</span> y=<span style="color: #ff0000;">&quot;66&quot;</span> left=<span style="color: #ff0000;">&quot;71&quot;</span> right=<span style="color: #ff0000;">&quot;10&quot;</span> id=<span style="color: #ff0000;">&quot;txt3&quot;</span> text=<span style="color: #ff0000;">&quot;12&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Text</span> x=<span style="color: #ff0000;">&quot;71&quot;</span> y=<span style="color: #ff0000;">&quot;130&quot;</span> text=<span style="color: #ff0000;">&quot;0.00&quot;</span> color=<span style="color: #ff0000;">&quot;#FF0000&quot;</span> id=<span style="color: #ff0000;">&quot;txt4&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> x=<span style="color: #ff0000;">&quot;71&quot;</span> y=<span style="color: #ff0000;">&quot;98&quot;</span> label=<span style="color: #ff0000;">&quot;计算&quot;</span> id=<span style="color: #ff0000;">&quot;bn&quot;</span> click=<span style="color: #ff0000;">&quot;onCount()&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:TextArea</span> top=<span style="color: #ff0000;">&quot;158&quot;</span> bottom=<span style="color: #ff0000;">&quot;10&quot;</span> left=<span style="color: #ff0000;">&quot;71&quot;</span> right=<span style="color: #ff0000;">&quot;10&quot;</span> id=<span style="color: #ff0000;">&quot;txt5&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
	<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Panel</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #339933;">&lt;mx:Script&gt;</span>
<span style="color: #339933;">		&lt;![CDATA[</span>
<span style="color: #339933;">			private var outStr:String;</span>
<span style="color: #339933;">			private function onCount():void{</span>
<span style="color: #339933;">				outStr=&quot;&quot;;</span>
<span style="color: #339933;">				txt4.text=count(Number(txt1.text),Number(txt2.text),int(txt3.text)).toFixed(2);</span>
<span style="color: #339933;">				txt5.text=outStr;</span>
<span style="color: #339933;">			}</span>
<span style="color: #339933;">			//金额，收益，期数</span>
<span style="color: #339933;">			private function count(x:Number,t:Number,n:int):Number{</span>
<span style="color: #339933;">				var num:Number;</span>
<span style="color: #339933;">				if(n&lt;=0){</span>
<span style="color: #339933;">					num=x;</span>
<span style="color: #339933;">				}else{</span>
<span style="color: #339933;">					num=count(x,t,n-1)*(1+t)+x;</span>
<span style="color: #339933;">				}</span>
<span style="color: #339933;">				outStr+=&quot;第&quot;+n+&quot;月)\t\t总资产：&quot;+num.toFixed(2)+&quot;\t\t本金：&quot;+(n*x+x)+&quot;\t\t收益：&quot;+(num-n*x-x).toFixed(2)+&quot;\t\t收益率：&quot;+(100*(num-n*x-x)/(n*x+x)).toFixed(2)+&quot;%\n&quot;;</span>
<span style="color: #339933;">				return num;</span>
<span style="color: #339933;">			}</span>
<span style="color: #339933;">		]]&gt;</span>
<span style="color: #339933;">	&lt;/mx:Script&gt;</span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.ppzhao.net/index.php/archives/236/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
