<?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>股票 &#8211; 天地一沙鸥</title>
	<atom:link href="https://haoluobo.com/tag/%E8%82%A1%E7%A5%A8/feed/" rel="self" type="application/rss+xml" />
	<link>https://haoluobo.com</link>
	<description>to be continue....</description>
	<lastBuildDate>Fri, 16 Jun 2023 01:55:43 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
	<item>
		<title>Magpie 股价价格提醒工具</title>
		<link>https://haoluobo.com/2023/06/magpie/</link>
		
		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Wed, 14 Jun 2023 12:35:00 +0000</pubDate>
				<category><![CDATA[vicalloy的庄家]]></category>
		<category><![CDATA[编程]]></category>
		<category><![CDATA[股票]]></category>
		<guid isPermaLink="false">https://haoluobo.com/?p=12419</guid>

					<description><![CDATA[项目地址：https://github.com/vicalloy/magpie/ 股票工具。设置股票的止损点和 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>项目地址：<a href="https://github.com/vicalloy/magpie/">https://github.com/vicalloy/magpie/</a></p>



<p>股票工具。设置股票的止损点和营收点，在到达止损点或营收点时发起消息推送。提供一个简易点web服务器用于查看相关股票的当前价格。</p>



<p>注：</p>



<ul class="wp-block-list">
<li>支持的推送平台有&nbsp;<a href="https://telegram.org/">Telegram</a>&nbsp;/&nbsp;<a href="https://github.com/Finb/Bark/blob/master/README.en.md">Bark</a>&nbsp;。</li>
</ul>



<h2 class="wp-block-heading"><a href="https://github.com/vicalloy/magpie/blob/main/README.cn.md#%E7%94%A8%E6%B3%95"></a>用法</h2>



<h3 class="wp-block-heading"><a href="https://github.com/vicalloy/magpie/blob/main/README.cn.md#%E7%BC%96%E8%BE%91%E8%A7%84%E5%88%99%E6%96%87%E4%BB%B6"></a>编辑规则文件</h3>



<p>提醒规则使用&nbsp;<code>Json</code>&nbsp;格式进行描述。编辑规则并保存为文件&nbsp;<code>rule.json</code>&nbsp;。</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
&#x5B;
  {
    &quot;stock_code&quot;: &quot;sh000001&quot;,
    &quot;stock_name&quot;: &quot;上证指数&quot;,
    &quot;base_price&quot;: 3200,  # 基准价格，用于计算涨幅
    &quot;alarm_price_min&quot;: 3100,  # 止损点
    &quot;alarm_price_max&quot;: 3400  # 营收点
  },
  {
    &quot;stock_code&quot;: &quot;sz000333&quot;,
    &quot;stock_name&quot;: &quot;美的&quot;,
    &quot;base_price&quot;: 54,
    &quot;alarm_percentage_min&quot;: 0.15,  # 止损点 base_price * (1 - alarm_percentage_min)
    &quot;alarm_percentage_max&quot;: 0.15  # 营收点 base_price * (1 + alarm_percentage_max)
  },
]

</pre></div>


<h3 class="wp-block-heading"><a href="https://github.com/vicalloy/magpie/blob/main/README.cn.md#%E5%90%AF%E5%8A%A8-web-%E6%9C%8D%E5%8A%A1%E5%99%A8"></a>启动 Web 服务器</h3>



<pre class="wp-block-preformatted">docker run --rm \
    -v `pwd`/rules.json:/app/rules.json \
    -p 8000:8000 vicalloy/magpie:latest \
    python -m magpie server -r ./rules.json</pre>



<p>在浏览器中访问网址&nbsp;<code>http://localhost:8000/</code>&nbsp;。</p>



<h3 class="wp-block-heading"><a href="https://github.com/vicalloy/magpie/blob/main/README.cn.md#%E6%A3%80%E6%9F%A5%E8%82%A1%E4%BB%B7"></a>检查股价</h3>



<pre class="wp-block-preformatted">docker run --rm \
    -v `pwd`/rules.json:/app/rules.json \
    magpie:latest \
    python -m magpie check -r ./rules.json \
    --datasource qq \
    --bark-token $(bark-token) \
    --tg-token $(tg-token) \
    --tg-chat-id $(tg-chat-id)</pre>



<p>可以通过设置&nbsp;<code>crontab</code>&nbsp;的方式定时执行股价的检查。</p>



<p><strong>备注</strong></p>



<ul class="wp-block-list">
<li>使用 <a href="https://github.com/Finb/Bark/blob/master/README.en.md">Bark</a>
<ul class="wp-block-list">
<li>请在 iPhone 上安装&nbsp;<code>Bark</code>&nbsp;客户端，并获取对应的&nbsp;<code>Token</code>&nbsp;。</li>
</ul>
</li>



<li>Using <a href="https://telegram.org/">Telegram</a>
<ul class="wp-block-list">
<li><a href="https://core.telegram.org/bots/tutorial#obtain-your-bot-token">创建一个 Bot 并获取对应的 Bot token</a></li>



<li>创建一个 <code>Group</code> ，并将刚创建的 Bot 添加到该Group，然后获取 Group 对应的 <code>chat id</code>.
<ul class="wp-block-list">
<li>例如:&nbsp;<a href="https://web.telegram.org/a/#-1045009696">https://web.telegram.org/a/#-1045009696</a>&nbsp;<code>-1045009696</code>&nbsp;就是&nbsp;<code>chat id</code>.</li>
</ul>
</li>
</ul>
</li>
</ul>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
10 9,10,11,12,13,14 * * * sudo docker run ....
</pre></div>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>股市入市一年回顾</title>
		<link>https://haoluobo.com/2015/07/stock-one-year/</link>
		
		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Wed, 08 Jul 2015 14:33:36 +0000</pubDate>
				<category><![CDATA[vicalloy的YY]]></category>
		<category><![CDATA[股票]]></category>
		<guid isPermaLink="false">/?p=11153</guid>

					<description><![CDATA[从上月中旬开始，股市忽然急转直下，哀鸿遍野。网友们感叹，给不了慢牛至少也得给个慢熊啊。 在经过一段时间的观望后 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>从上月中旬开始，股市忽然急转直下，哀鸿遍野。网友们感叹，给不了慢牛至少也得给个慢熊啊。<br />
在经过一段时间的观望后我已不再相信近期的股市还有机会。昨天将所有股票清仓，这波的行情到此为止，耐心的等待下次机会。在下波行情到来之前股市的涨跌已与我无关。<br />
去年9月2300点入市，股本2w，在3000点前增加到5w。在股市的最高点股票总值差不多有8.5w+。清仓时是7.6w，刚好达成最初的50%收益预期。<br />
我对股市的观点和刚入市差不多，这里再简单的说一下。</p>
<ul>
<li>不被外界的各类因素干扰，做自己认为正确的决定。<br />
在股市下跌一段时间后，我感觉行情不太对，让老妈赶紧将股票清掉。老妈很不开心的说：早些时候不叫她清，现在跌的这么惨才要清，她不干，一定要涨回去才行。<br />
作为一个普通人，我们几乎没有可能在第一时间发现机会和危险，我们能做的只是不要落后太多。一个股票卖与不卖的关键在于“该卖了”，并在在于你赚了多少或亏了多少。如果你觉得行情不对了即使亏的再多也应当果断的出掉及时止损。</li>
<li>在自己能接受的风险范围内投资股票。<br />
买股票很重要的一点就是能客观的判断形势。如果投资在股市里的钱过多，股市的每次涨跌都将直击你的心脏，让你无法客观判断。  </li>
<li>少看K线，股评<br />
资本市场里聚集了世界上最聪明的一票人，妄想在短线操作上胜过庄家也职业操盘手几乎是不可能的任务。更糟的是做短线会让人的心态变差。涨的时候后悔自己卖早了，跌的时候后悔为啥没早卖，不管股市是涨是跌你都开心不起来。你要做的只是把握股市的大行情，跟着行情能赚到一些省心的小钱就已经不错了。</li>
</ul>
<p>PS:<br />
这次股市崩盘的速度远超乎大多人的预期，国家频频出手都未见成效。或许真同网上说的一样再这么跌下去国家得出大问题。所以虽已经逃离股市但也不希望股市跌太惨。跌到3000点国家应当还顶的住，如果跌破2500点就真不好说了。</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
