{"id":1687,"date":"2024-12-04T07:59:00","date_gmt":"2024-12-03T23:59:00","guid":{"rendered":"https:\/\/blog.laoyulaoyu.top\/?p=1687"},"modified":"2024-11-09T12:05:05","modified_gmt":"2024-11-09T04:05:05","slug":"%e5%86%85%e5%b9%95%e6%8f%ad%e7%a7%98%ef%bc%9a%e7%8e%a9%e8%bd%acmacd%e6%8a%80%e6%9c%af%ef%bc%8c%e7%a0%b4%e8%af%91%e8%82%a1%e7%a5%a8%e7%9b%88%e5%88%a9%e5%af%86%e7%a0%81%ef%bc%8c%e6%8f%90%e5%89%8d","status":"publish","type":"post","link":"https:\/\/www.laoyulaoyu.com\/index.php\/2024\/12\/04\/%e5%86%85%e5%b9%95%e6%8f%ad%e7%a7%98%ef%bc%9a%e7%8e%a9%e8%bd%acmacd%e6%8a%80%e6%9c%af%ef%bc%8c%e7%a0%b4%e8%af%91%e8%82%a1%e7%a5%a8%e7%9b%88%e5%88%a9%e5%af%86%e7%a0%81%ef%bc%8c%e6%8f%90%e5%89%8d\/","title":{"rendered":"\u5185\u5e55\u63ed\u79d8\uff1a\u73a9\u8f6cMACD\u6280\u672f\uff0c\u7834\u8bd1\u80a1\u7968\u76c8\u5229\u5bc6\u7801\uff0c\u63d0\u524d\u5e03\u5c40\u7ffb\u500d\u6536\u76ca\uff01"},"content":{"rendered":"\n<p>\u4f5c\u8005\uff1a<a href=\"https:\/\/www.laoyulaoyu.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u8001\u4f59\u635e\u9c7c<\/a><\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-cyan-bluish-gray-color\">\u539f\u521b\u4e0d\u6613\uff0c\u8f6c\u8f7d\u8bf7\u6807\u660e\u51fa\u5904\u53ca\u539f\u4f5c\u8005\u3002<\/mark><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/11\/110902.png\" alt=\"\" class=\"wp-image-2872\"\/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<pre class=\"wp-block-verse\" id=\"block-7511c28c-bc02-493b-b655-abc675febe06\"><strong>\u5199\u5728\u524d\u9762\u7684\u8bdd\uff1a<\/strong>\u6216\u8bb8\u5927\u5bb6\u7ecf\u5e38\u4f1a\u542c\u5230 MACD\uff08\u79fb\u52a8\u5e73\u5747\u6536\u655b\u53d1\u6563\u6307\u6807\uff09\u8fd9\u4e2a\u6307\u6807\uff0c\u4f46\u5177\u4f53\u8be5\u600e\u4e48\u7528\u5b83\u6765\u5206\u6790\u9884\u6d4b\u80a1\u4ef7\u8d70\u52bf\u5462\uff1f\u672c\u6587\u5c06<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">\u901a\u8fc7\u8be6\u7ec6\u89e3\u6790 Google \u80a1\u7968\u76c8\u5229\u6f5c\u529b\u7684\u4f8b\u5b50\uff0c\u624b\u628a\u624b\u6559\u60a8\u638c\u63e1\u8fd9\u4e00\u5206\u6790\u6280\u672f\u3002<\/mark>\u6b64\u5916\uff0c\u6211\u8fd8\u4f1a\u63d0\u4f9b\u4e00\u4e2a\u5b9e\u7528\u7684 Google Colab \u7b14\u8bb0\u672c\u5de5\u5177\uff0c\u8ba9\u4f60\u80fd\u591f\u8f7b\u677e\u5730\u5206\u6790\u4efb\u4f55\u4f60\u611f\u5174\u8da3\u7684\u91d1\u878d\u4ea7\u54c1\uff0c\u638c\u63e1\u5e02\u573a\u52a8\u6001\u3002<\/pre>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u4e00\u3001MACD \u7a76\u7adf\u662f\u4ec0\u4e48\uff1f<\/strong><\/h3>\n\n\n\n<p>MACD\uff0c\u5168\u79f0\u4e3a\u79fb\u52a8\u5e73\u5747\u6536\u655b\u53d1\u6563\u6307\u6807\uff08Moving Average Convergence Divergence\uff09\uff0c\u662f\u6295\u8d44\u8005\u5728\u80a1\u5e02\u5206\u6790\u4e2d\u5e7f\u6cdb\u91c7\u7528\u7684\u4e00\u79cd\u6280\u672f\u5206\u6790\u5de5\u5177\u3002<strong>\u7b80\u5355\u6765\u8bf4\uff0c\u5b83\u4f7f\u7528\u4e24\u6761\u79fb\u52a8\u5e73\u5747\u7ebf\u6765\u5e2e\u52a9\u9884\u6d4b\u4f55\u65f6\u4e70\u5165\u6216\u5356\u51fa\u3002<\/strong><\/p>\n\n\n\n<p>&nbsp;MACD\u7531\u7ebd\u7ea6\u5206\u6790\u5e08\u5409\u62c9\u5fb7\u00b7\u57c3\u6ce2\u5c14\uff08\u4e5f\u6709\u8bf4\u6cd5\u4e3a\u6770\u62c9\u5fb7\u00b7\u963f\u4f69\u5c14\u548c\u798f\u96f7\u5fb7\u00b7\u6d77\u671f\u5c14\uff09\u8bbe\u8ba1\u53d1\u660e\uff0c\u8be5\u6307\u6807\u4e3b\u8981\u57fa\u4e8e\u77ed\u671f\u548c\u957f\u671f\u7684\u6307\u6570\u79fb\u52a8\u5e73\u5747\u7ebf\uff08EMA\uff09\u4e4b\u95f4\u7684\u5dee\u5f02\u6765\u6355\u6349\u80a1\u4ef7\u53d8\u52a8\u7684\u8d8b\u52bf\u548c\u52a8\u80fd\uff0c\u4ece\u800c\u8f85\u52a9\u6295\u8d44\u8005\u8fdb\u884c\u4e70\u5356\u51b3\u7b56\u3002<\/p>\n\n\n\n<p id=\"bh-bNhHyEe4rAX5j9_gDgOQ0\"><strong>MACD\u4e3b\u8981\u7531\u4e09\u4e2a\u90e8\u5206\u7ec4\u6210\uff1a<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/11\/image-45.png\" alt=\"\" class=\"wp-image-2874\"\/><\/figure>\n<\/div>\n\n\n<ol id=\"bh-aA23eGba2Njh-18Shk--8\" class=\"wp-block-list\">\n<li><strong>MACD\u7ebf<\/strong>\uff1a\u8fd9\u662f\u77ed\u671f\uff08\u901a\u5e38\u4e3a12\u5929\uff09\u548c\u957f\u671f\uff08\u901a\u5e38\u4e3a26\u5929\uff09\u6307\u6570\u79fb\u52a8\u5e73\u5747\u7ebf\uff08EMA\uff09\u4e4b\u95f4\u7684\u5dee\u503c\u3002<\/li>\n\n\n\n<li><strong>\u4fe1\u53f7\u7ebf<\/strong>\uff1a\u8fd9\u662fMACD\u7ebf\u76849\u5929EMA\uff0c\u7528\u4e8e\u751f\u6210\u4e70\u5165\u548c\u5356\u51fa\u4fe1\u53f7\u3002<\/li>\n\n\n\n<li><strong>\u67f1\u72b6\u56fe<\/strong>\uff1a\u663e\u793aMACD\u7ebf\u4e0e\u4fe1\u53f7\u7ebf\u4e4b\u95f4\u7684\u5dee\u8ddd\uff0c\u5e2e\u52a9\u4ea4\u6613\u8005\u76f4\u89c2\u5730\u5224\u65ad\u8d8b\u52bf\u7684\u5f3a\u5ea6\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u4e8c\u3001\u5982\u4f55\u4f7f\u7528 MACD \uff1f<\/strong><br><\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/11\/image-44.png\" alt=\"\" class=\"wp-image-2873\"\/><\/figure>\n\n\n\n<p id=\"bh-XUmb3Bf-k5yCftnJXem7c\"><strong>\u5728\u5b9e\u9645\u4ea4\u6613\u4e2d\uff0c\u53ef\u4ee5\u6839\u636eMACD\u6307\u6807\u505a\u51fa\u6295\u8d44\u51b3\u7b56\uff1a<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/11\/image-48.png\" alt=\"\" class=\"wp-image-2877\"\/><\/figure>\n\n\n\n<p><strong>1. \u4ea4\u53c9\u4fe1\u53f7\uff1a<\/strong>\u5f53MACD\u7ebf\u7a7f\u8fc7\u4fe1\u53f7\u7ebf\u65f6\uff0c\u53ef\u80fd\u8868\u793a\u4e70\u5165\u6216\u5356\u51fa\u4fe1\u53f7\u3002MACD\u7ebf\u4ece\u4e0b\u5411\u4e0a\u7a7f\u8fc7\u4fe1\u53f7\u7ebf\u901a\u5e38\u88ab\u89c6\u4e3a\u4e70\u5165\u4fe1\u53f7\uff08\u91d1\u53c9\uff09\uff0c\u800c\u4ece\u4e0a\u5411\u4e0b\u7a7f\u8fc7\u5219\u88ab\u89c6\u4e3a\u5356\u51fa\u4fe1\u53f7\uff08\u6b7b\u53c9\uff09\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u91d1\u53c9\uff1a<\/strong>DIFF\u7ebf\u81ea\u4e0b\u800c\u4e0a\u4e0eDEA\u7ebf\u4ea4\u53c9,\u901a\u5e38\u88ab\u8ba4\u4e3a\u662f\u80a1\u4ef7\u4e0a\u6da8\u7684\u4fe1\u53f7\u3002\u91d1\u53c9\u57280\u8f74\u4e0a\u65b9\u662f\u5f3a\u70c8\u7684\u4e70\u5165\u4fe1\u53f7,0\u8f74\u9644\u8fd1\u8868\u793a\u4e0a\u6da8\u8d8b\u52bf\u521a\u5f00\u59cb,0\u8f74\u4e0b\u65b9\u5219\u4f34\u968f\u7740\u8f83\u9ad8\u7684\u98ce\u9669\u4f46\u4e5f\u53ef\u80fd\u6709\u8f83\u9ad8\u7684\u56de\u62a5\u6f5c\u529b\u3002<\/li>\n\n\n\n<li><strong>\u6b7b\u53c9\uff1a<\/strong>DIFF\u7ebf\u4ece\u4e0a\u65b9\u5411\u4e0b\u7a7f\u8d8aDEA\u7ebf,\u662f\u80a1\u4ef7\u4e0b\u8dcc\u7684\u5178\u578b\u5f62\u6001\u3002\u9ad8\u4f4d\u6b7b\u53c9\u901a\u5e38\u51fa\u73b0\u5728\u5927\u5e45\u4e0a\u6da8\u884c\u60c5\u672b\u671f,\u4f4e\u4f4d\u6b7b\u53c9\u5219\u53ef\u80fd\u9884\u793a\u7740\u4e0b\u8dcc\u884c\u60c5\u7684\u53cd\u5f39\u5373\u5c06\u7ed3\u675f\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>2.\u80cc\u79bb\uff1a<\/strong>\u5f53\u4ef7\u683c\u521b\u51fa\u65b0\u9ad8\u6216\u65b0\u4f4e\uff0c\u800cMACD\u672a\u80fd\u8ddf\u968f\u65f6\uff0c\u53ef\u80fd\u9884\u793a\u7740\u8d8b\u52bf\u7684\u53cd\u8f6c\u3002<\/p>\n\n\n\n<ul id=\"bh-Q67kLDOSyKYyh53HGhdTE\" class=\"wp-block-list\">\n<li><strong>\u9876\u80cc\u79bb<\/strong>\uff1a\u5f53\u80a1\u4ef7\u89e6\u53ca\u65b0\u9ad8,\u800cMACD\u6307\u6807\u7684DIFF\u7ebf\u548cDEA\u7ebf\u6ca1\u6709\u540c\u65f6\u8fbe\u5230\u65b0\u9ad8\u65f6,\u8868\u660e\u80a1\u4ef7\u4e0a\u6da8\u7684\u52bf\u5934\u53ef\u80fd\u65e0\u6cd5\u6301\u7eed,\u662f\u6f5c\u5728\u7684\u5356\u51fa\u4fe1\u53f7\u3002<\/li>\n\n\n\n<li><strong>\u5e95\u80cc\u79bb<\/strong>\uff1a\u5f53\u80a1\u4ef7\u521b\u51fa\u65b0\u4f4e,\u800cMACD\u6307\u6807\u7684DIFF\u7ebf\u548cDEA\u7ebf\u6ca1\u6709\u540c\u65f6\u521b\u51fa\u65b0\u4f4e\u65f6,\u8868\u660e\u5c3d\u7ba1\u80a1\u4ef7\u5448\u73b0\u4e0b\u964d\u8d8b\u52bf,\u4f46\u4e0b\u8dcc\u52bf\u5934\u53ef\u80fd\u96be\u4ee5\u6301\u7eed,\u662f\u6f5c\u5728\u7684\u4e70\u5165\u4fe1\u53f7\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>3. \u8d8b\u52bf\u5f3a\u5ea6<\/strong>\uff1a\u67f1\u72b6\u56fe\u7684\u9ad8\u5ea6\u53ef\u4ee5\u53cd\u6620\u8d8b\u52bf\u7684\u5f3a\u5ea6,\u67f1\u72b6\u56fe\u8d8a\u9ad8,\u8d8b\u52bf\u8d8a\u5f3a\u3002<\/p>\n\n\n\n<p><strong>MACD\u7684\u8ba1\u7b97\u65b9\u6cd5\u4e0e\u6b65\u9aa4\u5982\u4e0b\uff1a<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/11\/image-47.png\" alt=\"\" class=\"wp-image-2876\"\/><\/figure>\n\n\n\n<ol id=\"bh-R_yxK-LJluHDYBOC2fKig\" class=\"wp-block-list\">\n<li>\u8ba1\u7b97\u77ed\u671fEMA\uff08\u4f8b\u598212\u5929\uff09\u548c\u957f\u671fEMA\uff08\u4f8b\u598226\u5929\uff09\u3002<\/li>\n\n\n\n<li>\u8ba1\u7b97MACD\u7ebf\uff1aMACD\u7ebf = \u77ed\u671fEMA &#8211; \u957f\u671fEMA\u3002<\/li>\n\n\n\n<li>\u8ba1\u7b97\u4fe1\u53f7\u7ebf\uff1a\u4fe1\u53f7\u7ebf = MACD\u7ebf\u76849\u5929EMA\u3002<\/li>\n\n\n\n<li>\u8ba1\u7b97\u67f1\u72b6\u56fe\uff1a\u67f1\u72b6\u56fe = MACD\u7ebf &#8211; \u4fe1\u53f7\u7ebf\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u4e09\u3001\u5206\u6b65\u5b9e\u73b0\u6307\u5357<\/strong><\/h3>\n\n\n\n<p><strong>\u6b65\u9aa4 1\uff1a\u5bfc\u5165\u5e93\u5e76\u83b7\u53d6\u5e93\u5b58\u6570\u636e<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import yfinance as yf\nimport pandas as pd\nimport plotly.graph_objects as go\n\ndef get_stock_data(ticker, period=\"1y\"):\n    stock = yf.Ticker(ticker)\n    df = stock.history(period=period)\n    return df<\/code><\/pre>\n\n\n\n<p>\u8fd9\u90e8\u5206\u5c31\u50cf\u662f\u8bbe\u7f6e\u6211\u4eec\u7684\u5de5\u5177\u7bb1\u3002\u6211\u4eec\u5c06\u5f15\u5165<code>yfinance<\/code>&nbsp;\u6765\u83b7\u53d6\u80a1\u7968\u6570\u636e\uff0c\u5f15\u5165&nbsp;<code>pandas<\/code>&nbsp;\u6765\u8fdb\u884c\u6570\u636e\u5904\u7406\uff0c\u5f15\u5165&nbsp;<code>plotly<\/code>&nbsp;\u6765\u521b\u5efa\u4ea4\u4e92\u5f0f\u56fe\u8868\u3002<code>get_stock_data<\/code>&nbsp;\u51fd\u6570\u662f\u6211\u4eec\u5411\u96c5\u864e\u8d22\u7ecf\u7d22\u53d6\u80a1\u7968\u5386\u53f2\u6570\u636e\u7684\u65b9\u6cd5\u3002<\/p>\n\n\n\n<p><strong>\u6b65\u9aa4 2\uff1a\u8ba1\u7b97 MACD<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def calculate_macd(df, short_period, long_period, signal_period):\n    short_ema = df&#91;'Close'].ewm(span=short_period, adjust=False).mean()\n    long_ema = df&#91;'Close'].ewm(span=long_period, adjust=False).mean()\n    macd = short_ema - long_ema\n    signal_line = macd.ewm(span=signal_period, adjust=False).mean()\n    return macd, signal_line<\/code><\/pre>\n\n\n\n<p>\u8fd9\u5c31\u662f MACD \u7684\u795e\u5947\u4e4b\u5904\uff01\u6211\u4eec\u8ba1\u7b97\u4e24\u6761\u6307\u6570\u79fb\u52a8\u5e73\u5747\u7ebf (EMA)\uff0c\u5c06\u957f\u5468\u671f EMA \u51cf\u53bb\u77ed\u5468\u671f EMA\uff0c\u5f97\u5230 MACD \u7ebf\uff0c\u7136\u540e\u6839\u636e MACD \u8ba1\u7b97\u4fe1\u53f7\u7ebf\u3002<\/p>\n\n\n\n<p><strong>\u6b65\u9aa4 3\uff1a\u751f\u6210\u4e70\u5165\/\u5356\u51fa\u4fe1\u53f7<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def generate_signals_and_transactions(df, macd, signal_line):\n    signals = pd.DataFrame(index=df.index)\n    signals&#91;'Buy'] = (macd &gt; signal_line) &amp; (macd.shift(1) &lt;= signal_line.shift(1))\n    signals&#91;'Sell'] = (macd &lt; signal_line) &amp; (macd.shift(1) &gt;= signal_line.shift(1))\n    # ... (transaction logic)\n    return signals, transactions<\/code><\/pre>\n\n\n\n<p>\u8be5\u529f\u80fd\u5c31\u50cf\u6211\u4eec\u7684\u4ea4\u6613\u673a\u5668\u4eba\u3002\u5b83\u4f1a\u5bfb\u627e MACD \u7ebf\u5728\u4fe1\u53f7\u7ebf\u4e0a\u65b9\u4ea4\u53c9\u7684\u65f6\u523b\uff08\u4e70\u5165\uff01\uff09\u6216\u5728\u4fe1\u53f7\u7ebf\u4e0b\u65b9\u4ea4\u53c9\u7684\u65f6\u523b\uff08\u5356\u51fa\uff01\uff09\u3002\u7136\u540e\u6839\u636e\u8fd9\u4e9b\u4fe1\u53f7\u6a21\u62df\u4e70\u5165\u548c\u5356\u51fa\u3002<\/p>\n\n\n\n<p><strong>\u6b65\u9aa4 4\uff1a\u627e\u5230\u6700\u6709\u5229\u7684\u914d\u7f6e<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Find the most profitable configuration\n    for short_period in short_periods:\n        for long_period in long_periods:\n            if short_period &gt;= long_period:\n                continue\n            for signal_period in signal_periods:\n                macd, signal_line = calculate_macd(df, short_period, long_period, signal_period)\n                signals, transactions = generate_signals_and_transactions(df, macd, signal_line)\n                all_transactions&#91;f'{short_period}_{long_period}_{signal_period}'] = transactions\n\n                if transactions:\n                    df_transactions = pd.DataFrame(transactions)\n                    total_pnl = df_transactions&#91;'P&amp;L'].sum().round(2)\n                    total_pnls&#91;f'{short_period}_{long_period}_{signal_period}'] = total_pnl\n                else:\n                    total_pnls&#91;f'{short_period}_{long_period}_{signal_period}'] = 0\n\n    most_profitable = max(total_pnls, key=total_pnls.get)\n    max_pnl = total_pnls&#91;most_profitable]\n    best_short, best_long, best_signal = map(int, most_profitable.split('_')))<\/code><\/pre>\n\n\n\n<p>\u6d4b\u8bd5\u5404\u79cd\u4e0d\u540c\u7684 MACD \u914d\u7f6e\uff0c\u770b\u770b\u54ea\u79cd\u914d\u7f6e\u5728\u8fc7\u53bb\u4e00\u5e74\u4e2d\u83b7\u5229\u6700\u591a\u3002<\/p>\n\n\n\n<p><strong>\u6b65\u9aa4 5\uff1a\u7ed3\u679c\u53ef\u89c6\u5316&nbsp;<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>fig = go.Figure()\n    fig.add_trace(go.Candlestick(\n        x=df.index, open=df&#91;'Open'], high=df&#91;'High'],\n        low=df&#91;'Low'], close=df&#91;'Close'], name='Candlestick'\n    ))\n    # ... (add MACD and signal lines, buy\/sell markers)\n    fig.show()<\/code><\/pre>\n\n\n\n<p>\u6700\u7ec8\uff0c\u6211\u4eec\u5c06\u5171\u540c\u6253\u9020\u4e00\u5f20\u7cbe\u7f8e\u7684\u4ea4\u4e92\u5f0f\u56fe\u8868\uff0c\u5b83\u4e0d\u4ec5\u5c55\u793a\u4e86\u80a1\u7968\u4ef7\u683c\uff0c\u8fd8\u5305\u62ec\u4e86\u6700\u4f18\u5316\u7684MACD\u53c2\u6570\u8bbe\u7f6e\uff0c\u4ee5\u53ca\u6240\u6709\u7684\u4e70\u5165\u548c\u5356\u51fa\u4fe1\u53f7\u3002\u8fd9\u5c06\u662f\u4f60\u4e2a\u4eba\u4e13\u5c5e\u7684\u4ea4\u6613\u6307\u6325\u4e2d\u5fc3\uff0c\u4e00\u5207\u4fe1\u606f\u4e00\u76ee\u4e86\u7136\uff0c\u5c3d\u5728\u4f60\u7684\u638c\u63a7\u4e4b\u4e2d\uff01<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/www.laoyulaoyu.com\/wp-content\/uploads\/2024\/11\/1731123764400-1024x481.png\" alt=\"\" class=\"wp-image-2881\"\/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u56db\u3001Google Colab \u7b14\u8bb0\u672c\u5de5\u5177<\/strong><\/h3>\n\n\n\n<p>\u6211\u5df2\u7ecf\u4e3a\u60a8\u51c6\u5907\u597d\u4e86\u4e00\u4efd Google Colab \u7b14\u8bb0\u672c\uff0c\u5176\u4e2d\u5305\u542b\u4e86\u672c\u6587\u7684\u6e90\u4ee3\u7801\u3002\u60a8\u53ef\u4ee5\u76f4\u63a5\u5728\u7ebf\u8bbf\u95ee\u5e76\u5229\u7528\u6211\u4eec\u7cbe\u5fc3\u8bbe\u8ba1\u7684MACD\u5206\u6790\u516c\u5f0f\uff0c\u5bf9Google\u80a1\u7968\uff08\u6216\u8005\u662f\u60a8\u611f\u5174\u8da3\u7684\u4efb\u4f55\u5176\u4ed6\u80a1\u7968\uff09\u8fdb\u884c\u6df1\u5165\u5206\u6790\uff01\u7acb\u5373\u4f53\u9a8c\uff0c\u8ba9\u6570\u636e\u4e3a\u60a8\u63ed\u793a\u6f5c\u5728\u7684\u6295\u8d44\u673a\u4f1a\u3002<\/p>\n\n\n\n<p id=\"6460\"><strong>\u6709\u4e86\u8fd9\u4e2a\u5f00\u6e90\u5de5\u5177\u7684\u5e2e\u52a9\uff0c\u60a8\u5c31\u53ef\u4ee5\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5b9e\u73b0\u80a1\u7968\u4ef7\u683c\u548c MACD \u6307\u6807\u7684\u53ef\u89c6\u5316\uff1b<\/li>\n\n\n\n<li>\u786e\u5b9a\u6700\u6709\u5229\u53ef\u56fe\u7684 MACD \u914d\u7f6e\uff1b<\/li>\n\n\n\n<li>\u67e5\u770b\u6f5c\u5728\u7684\u4e70\u5165\u548c\u5356\u51fa\u4fe1\u53f7 \uff1b<\/li>\n\n\n\n<li>\u8ba1\u7b97\u6f5c\u5728\u5229\u6da6\u3002<\/li>\n<\/ul>\n\n\n\n<p>Google Colab \u7b14\u8bb0\u672c\u5730\u5740\uff1a<a href=\"https:\/\/colab.research.google.com\/drive\/1moUCj8Jkj7B7hOffFOrErpnsIo0xww1S?usp=sharing\">https:\/\/colab.research.google.com\/drive\/1moUCj8Jkj7B7hOffFOrErpnsIo0xww1S?usp=sharing<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u4e94\u3001\u89c2\u70b9\u603b\u7ed3<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>MACD\u6280\u672f\u5206\u6790\u662f\u89e3\u7801\u80a1\u5e02\u52a8\u6001\u7684\u5173\u952e\u5de5\u5177<\/strong>\uff0c\u5b83\u80fd\u591f\u5e2e\u52a9\u6295\u8d44\u8005\u9884\u6d4b\u80a1\u4ef7\u8d70\u52bf\uff0c\u5e76\u53d1\u73b0\u6700\u4f73\u7684\u4e70\u5356\u65f6\u673a\u3002\u800c\u4e14MACD\u6307\u6807\u5bf9\u4e2d\u957f\u671f\u8d8b\u52bf\u7684\u5224\u65ad\u8f83\u4e3a\u51c6\u786e\uff0c\u4f46\u5728\u77ed\u671f\u66b4\u6da8\u66b4\u8dcc\u7684\u5e02\u573a\u4e2d\u53ef\u80fd\u8868\u73b0\u8fdf\u7f13\u3002<\/li>\n\n\n\n<li><strong>\u901a\u8fc7\u4e00\u4e2a\u7279\u5b9a\u7684MACD\u914d\u7f6e<\/strong>\uff0c\u672c\u6587\u4e3e\u4f8b\u6210\u529f\u63ed\u793a\u4e86Google\u80a1\u7968\u7684\u76c8\u5229\u6f5c\u529b\uff0c\u8fd9\u8868\u660e\u9002\u5f53\u7684\u6280\u672f\u5206\u6790\u914d\u7f6e\u5bf9\u4e8e\u6295\u8d44\u6210\u529f\u81f3\u5173\u91cd\u8981\u3002<\/li>\n\n\n\n<li><strong>\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5b9e\u7528\u7684Google Colab\u7b14\u8bb0\u672c\u5de5\u5177<\/strong>\uff0c\u4f7f\u8bfb\u8005\u80fd\u591f\u81ea\u4e3b\u5730\u5bf9Google\u80a1\u7968\u6216\u5176\u4ed6\u80a1\u7968\u8fdb\u884cMACD\u5206\u6790\uff0c\u8fd9\u6709\u52a9\u4e8e\u8bfb\u8005\u5b9e\u8df5\u6240\u5b66\u77e5\u8bc6\u3002<\/li>\n\n\n\n<li>&nbsp;<strong>\u5176\u4ed6\u6ce8\u610f\u4e8b\u9879\u5305\u62ec<\/strong>\uff0cMACD\u6307\u6807\u7684\u80cc\u79bb\u5f62\u6001\u5728\u5f3a\u52bf\u884c\u60c5\u4e2d\u8f83\u4e3a\u53ef\u9760\uff0c\u4f46\u9700\u6ce8\u610f\u9876\u80cc\u79bb\u7814\u5224\u7684\u51c6\u786e\u6027\u901a\u5e38\u9ad8\u4e8e\u5e95\u80cc\u79bb\u3002<\/li>\n\n\n\n<li><strong>\u4e2a\u4eba\u7814\u7a76\u548c\u4e13\u4e1a\u5efa\u8bae\u7684\u91cd\u8981\u6027<\/strong>\uff0c\u5373\u4f7f\u6709\u4e86\u5f3a\u5927\u7684\u5206\u6790\u5de5\u5177\uff0c\u6295\u8d44\u8005\u4e5f\u5e94\u8be5\u8c28\u614e\u5730\u505a\u51fa\u6295\u8d44\u51b3\u7b56\uff0c\u5e76\u8003\u8651\u5230\u5e02\u573a\u7684\u4e0d\u786e\u5b9a\u6027\u3002\u5728\u4f7f\u7528MACD\u6307\u6807\u65f6\uff0c\u8fd8\u53ef\u4ee5\u7ed3\u5408\u5176\u4ed6\u6280\u672f\u6307\u6807\u5982\u5747\u7ebf\u3001\u538b\u529b\u4f4d\u3001\u652f\u6491\u4f4d\u7b49\u8fdb\u884c\u7efc\u5408\u5206\u6790\u3002<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>\u611f\u8c22\u60a8\u9605\u8bfb\u5230\u6700\u540e\uff0c\u5e0c\u671b\u672c\u6587\u80fd\u7ed9\u60a8\u5e26\u6765\u65b0\u7684\u6536\u83b7\u3002\u795d\u60a8\u6295\u8d44\u987a\u5229\uff01\u5982\u679c\u5bf9\u6587\u4e2d\u7684\u5185\u5bb9\u6709\u4efb\u4f55\u7591\u95ee\uff0c\u8bf7\u7ed9\u6211\u7559\u8a00\uff0c\u5fc5\u590d\u3002<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong><mark style=\"background-color:#ffffff\" class=\"has-inline-color has-cyan-bluish-gray-color\">\u672c\u6587\u5185\u5bb9\u4ec5\u4ec5\u662f\u6280\u672f\u63a2\u8ba8\u548c\u5b66\u4e60\uff0c\u5e76\u4e0d\u6784\u6210\u4efb\u4f55\u6295\u8d44\u5efa\u8bae\u3002<\/mark><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f5c\u8005\uff1a\u8001\u4f59\u635e\u9c7c \u539f\u521b\u4e0d\u6613\uff0c\u8f6c\u8f7d\u8bf7\u6807\u660e\u51fa\u5904\u53ca\u539f\u4f5c\u8005\u3002&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/www.laoyulaoyu.com\/index.php\/2024\/12\/04\/%e5%86%85%e5%b9%95%e6%8f%ad%e7%a7%98%ef%bc%9a%e7%8e%a9%e8%bd%acmacd%e6%8a%80%e6%9c%af%ef%bc%8c%e7%a0%b4%e8%af%91%e8%82%a1%e7%a5%a8%e7%9b%88%e5%88%a9%e5%af%86%e7%a0%81%ef%bc%8c%e6%8f%90%e5%89%8d\/\">Continue reading<span class=\"screen-reader-text\">\u5185\u5e55\u63ed\u79d8\uff1a\u73a9\u8f6cMACD\u6280\u672f\uff0c\u7834\u8bd1\u80a1\u7968\u76c8\u5229\u5bc6\u7801\uff0c\u63d0\u524d\u5e03\u5c40\u7ffb\u500d\u6536\u76ca\uff01<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,6],"class_list":["post-1687","post","type-post","status-publish","format-standard","hentry","category-aiinvest","tag-ai","tag-6","entry"],"_links":{"self":[{"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts\/1687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/comments?post=1687"}],"version-history":[{"count":1,"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts\/1687\/revisions"}],"predecessor-version":[{"id":1688,"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts\/1687\/revisions\/1688"}],"wp:attachment":[{"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/media?parent=1687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/categories?post=1687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/tags?post=1687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}