{"id":3474,"date":"2026-05-25T07:18:00","date_gmt":"2026-05-24T23:18:00","guid":{"rendered":"https:\/\/blog.laoyulaoyu.top\/?p=3474"},"modified":"2026-05-15T16:29:34","modified_gmt":"2026-05-15T08:29:34","slug":"%e4%bb%8e%e9%9b%b6%e5%88%b0%e5%ae%9e%e6%88%98%ef%bc%9a%e6%89%8b%e6%8a%8a%e6%89%8b%e6%95%99%e4%bd%a0%e7%8e%a9%e8%bd%ac%e5%9d%87%e7%ba%bf%e4%ba%a4%e5%8f%89%e7%ad%96%e7%95%a5","status":"publish","type":"post","link":"https:\/\/blog.laoyulaoyu.top\/index.php\/2026\/05\/25\/%e4%bb%8e%e9%9b%b6%e5%88%b0%e5%ae%9e%e6%88%98%ef%bc%9a%e6%89%8b%e6%8a%8a%e6%89%8b%e6%95%99%e4%bd%a0%e7%8e%a9%e8%bd%ac%e5%9d%87%e7%ba%bf%e4%ba%a4%e5%8f%89%e7%ad%96%e7%95%a5\/","title":{"rendered":"\u4ece\u96f6\u5230\u5b9e\u6218\uff1a\u624b\u628a\u624b\u6559\u4f60\u73a9\u8f6c\u5747\u7ebf\u4ea4\u53c9\u7b56\u7565"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\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 class=\"wp-block-paragraph\"><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:\/\/laoyulaoyu.com\/wp-content\/uploads\/2026\/05\/cover.webp\" alt=\"\" class=\"wp-image-4078\"\/><\/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-ecfb22f9-83fb-4e99-9808-20a9d0b83dd1\"><strong>\u5199\u5728\u524d\u9762\u7684\u8bdd\uff1a<\/strong>\u505a\u4e86\u591a\u5e74\u91cf\u5316\uff0c\u8e29\u8fc7\u65e0\u6570\u5751\u3002\u4eca\u5929\u6211\u628a\u5747\u7ebf\u4ea4\u53c9\u7b56\u7565\u6700\u6838\u5fc3\u7684\u4e1c\u897f\u638f\u51fa\u6765\uff1aSMA\u3001EMA\u3001WMA\u8fd9<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">\u4e09\u79cd\u7b97\u6cd5\u600e\u4e48\u9009\uff1f\u77ed\u671f\u548c\u957f\u671f\u53c2\u6570\u5230\u5e95\u600e\u4e48\u914d\uff1f\u4fe1\u53f7\u51c6\u786e\u7387\u600e\u4e48\u7b97\uff1f<\/mark>\u8fd9\u7bc7\u6587\u7ae0\u4e0d\u8bb2\u865a\u7684\uff0c\u4ee3\u7801\u76f4\u63a5\u7ed9\uff0c\u903b\u8f91\u63b0\u5f00\u63c9\u788e\u8bb2\u6e05\u695a\u3002<\/pre>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f88\u591a\u4eba\u7b2c\u4e00\u6b21\u63a5\u89e6\u6280\u672f\u5206\u6790\uff0c\u5b66\u7684\u7b2c\u4e00\u4e2a\u5de5\u5177\u5c31\u662f\u5747\u7ebf\u3002\u8bf4\u5b9e\u8bdd\uff0c\u5747\u7ebf\u662f\u6240\u6709\u6280\u672f\u6307\u6807\u91cc\u6700\u4e0d\u8d77\u773c\u7684\u90a3\u4e2a\uff1a\u5b83\u65e2\u6ca1\u6709MACD\u90a3\u4e48\u82b1\u54e8\uff0c\u4e5f\u6ca1\u6709RSI\u90a3\u6837\u81ea\u5e26\u8d85\u4e70\u8d85\u5356\u7684\u795e\u79d8\u5149\u73af\u3002\u4f46\u5c31\u662f\u8fd9\u4e2a\u770b\u8d77\u6765&#8221;\u5e73\u5e73\u65e0\u5947&#8221;\u7684\u4e1c\u897f\uff0c\u652f\u6491\u4e86\u6211\u591a\u5e74\u91cf\u5316\u7b56\u7565\u91cc\u81f3\u5c11\u4e00\u534a\u7684\u4fe1\u53f7\u903b\u8f91\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4eca\u5929\u8fd9\u7bc7\u6587\u7ae0\uff0c\u6211\u60f3\u628a\u5747\u7ebf\u4ea4\u53c9\u7b56\u7565\u8fd9\u4ef6\u4e8b\u4ece\u5934\u5230\u5c3e\u8bf4\u6e05\u695a\uff1a\u4e0d\u540c\u7684\u5747\u7ebf\u65b9\u6cd5\u6709\u4ec0\u4e48\u533a\u522b\uff1f\u77ed\u5468\u671f\u548c\u957f\u5468\u671f\u600e\u4e48\u642d\u914d\u624d\u9760\u8c31\uff1f\u4fe1\u53f7\u51fa\u6765\u7684\u51c6\u786e\u7387\u5230\u5e95\u600e\u4e48\u7b97\uff1f\u4ee3\u7801\u5168\u90e8\u9644\u4e0a\uff0c\u4f60\u770b\u5b8c\u5c31\u80fd\u8dd1\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u2460 \u5747\u7ebf\u4ea4\u53c9\u4fe1\u53f7\uff0c\u5230\u5e95\u5728\u8bf4\u4ec0\u4e48\uff1f<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u6211\u5148\u4e0d\u6025\u7740\u4e0a\u4ee3\u7801\uff0c\u800c\u662f\u60f3\u628a\u8fd9\u4e2a\u4fe1\u53f7\u80cc\u540e\u7684\u903b\u8f91\u804a\u900f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5047\u8bbe\u4f60\u624b\u91cc\u6709\u4e00\u53ea\u6807\u7684\uff0c\u4f60\u60f3\u77e5\u9053\u5b83\u6700\u8fd1\u662f\u504f\u5f3a\u8fd8\u662f\u504f\u5f31\u3002\u4e00\u4e2a\u5f88\u672c\u80fd\u7684\u505a\u6cd5\u5c31\u662f\uff1a\u770b\u770b\u6700\u8fd1\u4e00\u6bb5\u65f6\u95f4\u7684\u5e73\u5747\u4ef7\u683c\uff0c\u8ddf\u66f4\u957f\u65f6\u95f4\u7684\u5e73\u5747\u4ef7\u683c\u6bd4\u4e00\u6bd4\u3002\u5982\u679c\u8fd1\u671f\u7684\u5747\u4ef7\u8dd1\u5230\u957f\u671f\u5747\u4ef7\u4e0a\u9762\u53bb\u4e86\uff0c\u8bf4\u660e\u6700\u8fd1\u7684\u5e02\u573a\u60c5\u7eea\u504f\u79ef\u6781\uff1b\u53cd\u8fc7\u6765\uff0c\u5982\u679c\u8fd1\u671f\u5747\u4ef7\u6389\u5230\u957f\u671f\u5747\u4ef7\u4e0b\u9762\uff0c\u8bf4\u660e\u5e02\u573a\u60c5\u7eea\u5728\u8f6c\u51b7\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u5c31\u662f\u5747\u7ebf\u4ea4\u53c9\u6700\u57fa\u672c\u7684\u601d\u60f3\uff1a<strong>\u7528\u4e24\u6761\u4e0d\u540c\u65f6\u95f4\u7a97\u53e3\u7684\u5e73\u5747\u4ef7\u683c\u66f2\u7ebf\u7684\u76f8\u5bf9\u4f4d\u7f6e\uff0c\u6765\u5224\u65ad\u8d8b\u52bf\u7684\u65b9\u5411\u6027\u53d8\u5316\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u91cf\u5316\u5708\u5b50\u91cc\uff0c\u6211\u4eec\u901a\u5e38\u628a\u8fd9\u79cd\u4ea4\u53c9\u5206\u6210\u4e24\u79cd\u573a\u666f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u77ed\u671f\u5747\u7ebf\u4e0a\u7a7f\u957f\u671f\u5747\u7ebf\uff1a<\/strong>\u77ed\u671f\u4ef7\u683c\u8d70\u52bf\u5f3a\u4e8e\u957f\u671f\u8d8b\u52bf\uff0c\u901a\u5e38\u88ab\u89c6\u4e3a\u4e00\u4e2a\u8d8b\u52bf\u8f6c\u5f3a\u7684\u4fe1\u53f7\u3002\u5982\u679c\u4f60\u770b\u5230&#8221;Golden Cross&#8221;\u8fd9\u4e2a\u8bcd\uff0c\u6307\u7684\u5c31\u662f\u8fd9\u4e2a\u3002\u6211\u4eec\u5728\u56fd\u5185\u8bed\u5883\u4e0b\u53eb\u5b83&#8221;\u4ea4\u53c9\u8f6c\u5f3a\u4fe1\u53f7&#8221;\u3002<\/li>\n\n\n\n<li><strong>\u77ed\u671f\u5747\u7ebf\u4e0b\u7a7f\u957f\u671f\u5747\u7ebf\uff1a<\/strong>\u77ed\u671f\u4ef7\u683c\u8d70\u52bf\u5f31\u4e8e\u957f\u671f\u8d8b\u52bf\uff0c\u901a\u5e38\u88ab\u89c6\u4e3a\u8d8b\u52bf\u8f6c\u5f31\u7684\u4fe1\u53f7\u3002\u5bf9\u5e94\u7684\u82f1\u6587\u53eb&#8221;Death Cross&#8221;\uff0c\u6211\u4eec\u53eb&#8221;\u4ea4\u53c9\u8f6c\u5f31\u4fe1\u53f7&#8221;\u3002<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/laoyulaoyu.com\/wp-content\/uploads\/2026\/05\/\u56fe-1.\u80a1\u7968\u4ef7\u683c\u5206\u6790\u4e2d\u7684\u4e70\u5165\uff08\u9ec4\u91d1\u4ea4\u53c9\uff09\u548c\u5356\u51fa\uff08\u6b7b\u4ea1\u4ea4\u53c9\uff09\u4fe1\u53f7\u7684\u53ef\u89c6\u5316-1024x439.webp\" alt=\"\" class=\"wp-image-4079\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\"><em>\u3010\u56fe1\u3011\u4ea4\u53c9\u8f6c\u5f3a\u4fe1\u53f7\u4e0e\u4ea4\u53c9\u8f6c\u5f31\u4fe1\u53f7\u5728\u4ef7\u683c\u8d70\u52bf\u4e2d\u7684\u53ef\u89c6\u5316\u793a\u610f<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u9053\u7406\u5f88\u7b80\u5355\uff0c\u4f46\u771f\u6b63\u7684\u95ee\u9898\u662f\uff1a<strong>\u4f60\u7528\u4ec0\u4e48\u65b9\u6cd5\u7b97\u5747\u7ebf\uff1f<\/strong>\u4e0d\u540c\u7684\u7b97\u6cd5\uff0c\u5f97\u5230\u7684\u4ea4\u53c9\u70b9\u53ef\u80fd\u5b8c\u5168\u4e0d\u4e00\u6837\u3002\u4e0b\u9762\u6211\u4eec\u5c31\u6765\u62c6\u5f00\u8bb2\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u2461 \u4e09\u79cd\u5747\u7ebf\u65b9\u6cd5\u5404\u6709\u5343\u79cb<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f88\u591a\u4eba\u4e00\u4e0a\u6765\u5c31\u628aSMA\u3001EMA\u3001WMA\u8fd9\u4e9b\u8bcd\u6df7\u5728\u4e00\u8d77\uff0c\u89c9\u5f97\u53cd\u6b63\u90fd\u662f&#8221;\u5e73\u5747&#8221;\uff0c\u5dee\u4e0d\u591a\u5c31\u884c\u3002\u8fd9\u4e2a\u60f3\u6cd5\u4f1a\u5bb3\u6b7b\u4eba\u7684\u3002\u4e09\u79cd\u65b9\u6cd5\u80cc\u540e\u662f\u5b8c\u5168\u4e0d\u540c\u7684\u6570\u5b66\u903b\u8f91\uff0c\u641e\u4e0d\u6e05\u695a\u533a\u522b\uff0c\u7b56\u7565\u56de\u6d4b\u51fa\u6765\u7684\u7ed3\u679c\u5c31\u6beb\u65e0\u610f\u4e49\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. \u7b80\u5355\u79fb\u52a8\u5e73\u5747\uff08SMA\uff09<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">SMA\u662f\u6700\u8001\u5b9e\u7684\u7b97\u6cd5\uff1a\u628a\u8fc7\u53bbN\u5929\u7684\u4ef7\u683c\u52a0\u8d77\u6765\uff0c\u9664\u4ee5N\u3002\u6bcf\u4e00\u5929\u7684\u6743\u91cd\u5b8c\u5168\u4e00\u6837\uff0c\u4e0d\u8bba\u5b83\u662f\u6628\u5929\u8fd8\u662f\u4e09\u4e2a\u6708\u524d\u3002\u516c\u5f0f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SMA = \\frac{P_1 + P_2 + \\dots + P_n}{n}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SMA\u7684\u4f18\u70b9\u662f\u7a33\u5b9a\uff0c\u7f3a\u70b9\u4e5f\u5f88\u660e\u663e\u2014\u2014\u5b83\u5bf9\u6700\u8fd1\u53d1\u751f\u7684\u4e8b\u60c5\u548c\u5f88\u4e45\u4ee5\u524d\u53d1\u751f\u7684\u4e8b\u60c5\u4e00\u89c6\u540c\u4ec1\uff0c\u5bfc\u81f4\u4fe1\u53f7\u53cd\u5e94\u504f\u6162\u3002\u5728\u8d8b\u52bf\u660e\u786e\u7684\u884c\u60c5\u4e2d\u8fd9\u4e0d\u662f\u95ee\u9898\uff0c\u4f46\u5728\u5feb\u901f\u53d8\u5316\u7684\u6ce2\u52a8\u884c\u60c5\u91cc\uff0cSMA\u53ef\u80fd\u4f1a\u8ba9\u4f60\u6162\u534a\u62cd\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. \u6307\u6570\u79fb\u52a8\u5e73\u5747\uff08EMA\uff09<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">EMA\u8ddfSMA\u6700\u5927\u7684\u4e0d\u540c\u662f\uff1a<strong>\u5b83\u7ed9\u8fd1\u671f\u7684\u4ef7\u683c\u66f4\u5927\u7684\u6743\u91cd\u3002<\/strong>\u7b97\u6cd5\u4e0a\uff0cEMA\u91c7\u7528\u9012\u63a8\u65b9\u5f0f\u8ba1\u7b97\uff0c\u4eca\u5929\u7684EMA\u503c\u7b49\u4e8e\u6628\u5929EMA\u52a0\u4e0a\u4eca\u65e5\u4ef7\u683c\u4e0e\u6628\u65e5EMA\u5dee\u503c\u7684\u4e00\u4e2a\u6bd4\u4f8b\u3002\u8fd9\u4e0d\u662f\u7b80\u5355\u5e73\u5747\uff0c\u800c\u662f\u4e00\u79cd\u8870\u51cf\u52a0\u6743\u2014\u2014\u8d8a\u4e45\u8fdc\u7684\u6570\u636e\uff0c\u5f71\u54cd\u529b\u8d8a\u4f4e\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">EMA\u5bf9\u4ef7\u683c\u53d8\u5316\u66f4\u654f\u611f\uff0c\u4fe1\u53f7\u51fa\u5f97\u6bd4SMA\u5feb\uff0c\u9002\u5408\u90a3\u4e9b\u5bf9\u65f6\u6548\u6027\u8981\u6c42\u6bd4\u8f83\u9ad8\u7684\u7b56\u7565\u573a\u666f\u3002\u4f46\u654f\u611f\u4e5f\u610f\u5473\u7740\u566a\u97f3\u591a\uff0c\u865a\u5047\u4fe1\u53f7\u7684\u6982\u7387\u4f1a\u4e0a\u5347\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. \u52a0\u6743\u79fb\u52a8\u5e73\u5747\uff08WMA\uff09<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">WMA\u4e5f\u662f\u7ed9\u4e0d\u540c\u65f6\u95f4\u70b9\u8d4b\u4e0d\u540c\u6743\u91cd\uff0c\u4f46\u5b83\u7684\u505a\u6cd5\u8ddfEMA\u4e0d\u4e00\u6837\uff1aWMA\u76f4\u63a5\u7ed9\u6bcf\u5929\u7684\u6536\u76d8\u4ef7\u4e58\u4ee5\u4e00\u4e2a\u7ebf\u6027\u9012\u51cf\u7684\u7cfb\u6570\uff0c\u6700\u8fd1\u4e00\u5929\u4e58\u6700\u5927\uff0c\u5012\u6570\u7b2c\u4e8c\u5929\u4e58\u6b21\u5927\uff0c\u4ee5\u6b64\u7c7b\u63a8\u3002\u516c\u5f0f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">WMA = \\frac{n \\cdot P_1 + (n-1) \\cdot P_2 + \\dots + 1 \\cdot P_n}{n + (n-1) + \\dots + 1}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">WMA\u66f4\u50cf\u662f\u4e00\u4e2a\u6298\u4e2d\u65b9\u6848\uff0c\u6bd4SMA\u7075\u654f\uff0c\u4f46\u6ca1\u6709EMA\u90a3\u4e48\u6fc0\u8fdb\u3002\u5b83\u6700\u5927\u7684\u4ef7\u503c\u5728\u4e8e<strong>\u7a81\u51fa\u5173\u952e\u4ef7\u683c\u533a\u95f4<\/strong>\uff0c\u7279\u522b\u662f\u5f53\u4f60\u5728\u67d0\u4e2a\u7279\u5b9a\u7684\u65f6\u95f4\u7a97\u53e3\u5185\u6709\u660e\u786e\u7684\u5173\u6ce8\u91cd\u70b9\u65f6\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0b\u9762\u8fd9\u5f20\u8868\u5e2e\u4f60\u5feb\u901f\u5bf9\u6bd4\u4e09\u8005\u7684\u5dee\u5f02\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-center\" data-align=\"center\"><strong>\u7279\u6027<\/strong><\/th><th class=\"has-text-align-center\" data-align=\"center\"><strong>SMA<\/strong><\/th><th class=\"has-text-align-center\" data-align=\"center\"><strong>EMA<\/strong><\/th><th class=\"has-text-align-center\" data-align=\"center\"><strong>WMA<\/strong><\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\">\u6743\u91cd\u5206\u914d<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u7b49\u6743<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u6307\u6570\u8870\u51cf<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u7ebf\u6027\u9012\u51cf<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">\u54cd\u5e94\u901f\u5ea6<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u6162<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u5feb<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u4e2d\u7b49<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">\u4fe1\u53f7\u566a\u97f3<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u4f4e<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u8f83\u9ad8<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u4e2d\u7b49<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">\u9002\u7528\u573a\u666f<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u4e2d\u957f\u671f\u8d8b\u52bf<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u77ed\u4e2d\u671f\u6ce2\u52a8<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u5173\u952e\u533a\u95f4\u5206\u6790<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">\u8ba1\u7b97\u590d\u6742\u5ea6<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u4f4e<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u4e2d\u7b49<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u4e2d\u7b49<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u2462 Python\u5b9e\u6218\uff1a\u4e09\u79cd\u5747\u7ebf\u4e00\u628a\u6293<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5149\u8bf4\u4e0d\u7ec3\u5047\u628a\u5f0f\u3002\u4e0b\u9762\u8fd9\u6bb5\u4ee3\u7801\uff0c\u6211\u7528\u7684\u662f yfinance \u62c9\u6570\u636e\uff0cpandas \u505a\u8ba1\u7b97\uff0cmatplotlib \u753b\u56fe\u3002\u4e09\u4e2a\u51fd\u6570\u5206\u522b\u5bf9\u5e94SMA\u3001EMA\u3001WMA\uff0c\u53c2\u6570\u6e05\u6670\uff0c\u62ff\u6765\u5c31\u80fd\u7528\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>import&nbsp;yfinance&nbsp;as&nbsp;yf<\/code><code>import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt<\/code><code>import&nbsp;pandas&nbsp;as&nbsp;pd<\/code><code>import&nbsp;numpy&nbsp;as&nbsp;np<\/code><code># ======== 1. \u83b7\u53d6\u6570\u636e ========<\/code><code>def&nbsp;fetch_data(stock_symbol, start_date, end_date):<\/code><code>&nbsp; &nbsp;&nbsp;\"\"\"<\/code><code>&nbsp; &nbsp; \u4eceYahoo Finance\u62c9\u53d6\u5386\u53f2\u884c\u60c5\u6570\u636e<\/code><code>&nbsp; &nbsp; \u53c2\u6570:<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; stock_symbol: \u6807\u7684\u4ee3\u7801\uff0c\u5982 'AAPL'<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; start_date: \u8d77\u59cb\u65e5\u671f '2020-01-01'<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; end_date: \u622a\u6b62\u65e5\u671f '2024-01-01'<\/code><code>&nbsp; &nbsp; \u8fd4\u56de:<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; pandas DataFrame\uff0c\u542bOHLCV\u6570\u636e<\/code><code>&nbsp; &nbsp; \"\"\"<\/code><code>&nbsp; &nbsp; data = yf.download(stock_symbol, start=start_date, end=end_date)<\/code><code>&nbsp; &nbsp;&nbsp;return&nbsp;data<\/code><code># ======== 2. \u4e09\u79cd\u5747\u7ebf\u51fd\u6570 ========<\/code><code>def&nbsp;SMA(data, window):<\/code><code>&nbsp; &nbsp;&nbsp;\"\"\"\u7b80\u5355\u79fb\u52a8\u5e73\u5747\uff1a\u8fc7\u53bbwindow\u5929\u7684\u6536\u76d8\u4ef7\u7b97\u672f\u5e73\u5747\"\"\"<\/code><code>&nbsp; &nbsp;&nbsp;return&nbsp;data.rolling(window=window).mean()<\/code><code>def&nbsp;EMA(data, window):<\/code><code>&nbsp; &nbsp;&nbsp;\"\"\"\u6307\u6570\u79fb\u52a8\u5e73\u5747\uff1a\u8fd1\u671f\u4ef7\u683c\u6743\u91cd\u66f4\u9ad8\uff0c\u4f7f\u7528ewm\u5b9e\u73b0\"\"\"<\/code><code>&nbsp; &nbsp;&nbsp;return&nbsp;data.ewm(span=window, adjust=False).mean()<\/code><code>def&nbsp;WMA(data, window):<\/code><code>&nbsp; &nbsp;&nbsp;\"\"\"\u52a0\u6743\u79fb\u52a8\u5e73\u5747\uff1a\u7ebf\u6027\u9012\u51cf\u6743\u91cd\uff0c\u6700\u8fd1\u4e00\u5929\u6743\u503c\u6700\u5927\"\"\"<\/code><code>&nbsp; &nbsp; weights = np.arange(1, window +&nbsp;1)<\/code><code>&nbsp; &nbsp;&nbsp;return&nbsp;data.rolling(window=window).apply(<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;lambda&nbsp;prices: np.dot(prices, weights&#91;::-1]) \/ weights.sum(),<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; raw=True<\/code><code>&nbsp; &nbsp; )<\/code><code># ======== 3. \u4fe1\u53f7\u8bc6\u522b ========<\/code><code>def&nbsp;identify_signals(data, short_window, long_window, ma_function):<\/code><code>&nbsp; &nbsp;&nbsp;\"\"\"<\/code><code>&nbsp; &nbsp; \u8bc6\u522b\u5747\u7ebf\u4ea4\u53c9\u4fe1\u53f7<\/code><code>&nbsp; &nbsp; \u903b\u8f91\uff1a\u77ed\u671f\u5747\u7ebf &gt; \u957f\u671f\u5747\u7ebf \u2192 \u6807\u8bb0\u4e3a1\uff08\u504f\u5f3a\uff09<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u77ed\u671f\u5747\u7ebf &lt; \u957f\u671f\u5747\u7ebf \u2192 \u6807\u8bb0\u4e3a0\uff08\u504f\u5f31\uff09<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Position\u5217\u8bb0\u5f55\u4e86\u4fe1\u53f7\u7684\u53d8\u5316\u70b9\uff081\u4e3a\u8f6c\u5f3a\uff0c-1\u4e3a\u8f6c\u5f31\uff09<\/code><code>&nbsp; &nbsp; \"\"\"<\/code><code>&nbsp; &nbsp; data&#91;'Short_MA'] = ma_function(data&#91;'Close'], short_window)<\/code><code>&nbsp; &nbsp; data&#91;'Long_MA'] = ma_function(data&#91;'Close'], long_window)<\/code><code>&nbsp; &nbsp; data&#91;'Signal'] =&nbsp;0<\/code><code>&nbsp; &nbsp; data&#91;'Signal'] = np.where(data&#91;'Short_MA'] &gt; data&#91;'Long_MA'],&nbsp;1.0,&nbsp;0.0)<\/code><code>&nbsp; &nbsp; data&#91;'Positions'] = data&#91;'Signal'].diff()<\/code><code>&nbsp; &nbsp;&nbsp;return&nbsp;data<\/code><code># ======== 4. \u51c6\u786e\u7387\u8ba1\u7b97 ========<\/code><code>def&nbsp;calculate_accuracy(data, look_forward=5):<\/code><code>&nbsp; &nbsp;&nbsp;\"\"\"<\/code><code>&nbsp; &nbsp; \u8ba1\u7b97\u4fe1\u53f7\u7684\u51c6\u786e\u7387<\/code><code>&nbsp; &nbsp; \u65b9\u6cd5\uff1a\u770b\u5411\u524dN\u5929\u7684\u4ef7\u683c\u65b9\u5411\u662f\u5426\u4e0e\u4fe1\u53f7\u65b9\u5411\u4e00\u81f4<\/code><code>&nbsp; &nbsp; - \u8f6c\u5f3a\u4fe1\u53f7\u51fa\u73b0\u540e\uff0c\u5982\u679c\u672a\u6765N\u5929\u4ef7\u683c\u4e0a\u6da8 \u2192 \u4fe1\u53f7\u6709\u6548<\/code><code>&nbsp; &nbsp; - \u8f6c\u5f31\u4fe1\u53f7\u51fa\u73b0\u540e\uff0c\u5982\u679c\u672a\u6765N\u5929\u4ef7\u683c\u4e0b\u8dcc \u2192 \u4fe1\u53f7\u6709\u6548<\/code><code>&nbsp; &nbsp; \"\"\"<\/code><code>&nbsp; &nbsp; data&#91;'Future_Close'] = data&#91;'Close'].shift(-look_forward)<\/code><code>&nbsp; &nbsp;&nbsp;# \u8f6c\u5f3a\u4fe1\u53f7\uff1a\u5f53\u5929\u4ef7\u683c &lt; \u672a\u6765\u4ef7\u683c \u2192 \u6b63\u786e<\/code><code>&nbsp; &nbsp; buys = data&#91;(data&#91;'Positions'] ==&nbsp;1) &amp; (data&#91;'Close'] &lt; data&#91;'Future_Close'])]<\/code><code>&nbsp; &nbsp;&nbsp;# \u8f6c\u5f31\u4fe1\u53f7\uff1a\u5f53\u5929\u4ef7\u683c &gt; \u672a\u6765\u4ef7\u683c \u2192 \u6b63\u786e<\/code><code>&nbsp; &nbsp; sells = data&#91;(data&#91;'Positions'] == -1) &amp; (data&#91;'Close'] &gt; data&#91;'Future_Close'])]<\/code><code>&nbsp; &nbsp; buy_acc =&nbsp;len(buys) \/&nbsp;len(data&#91;data&#91;'Positions'] ==&nbsp;1]) \\<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;len(data&#91;data&#91;'Positions'] ==&nbsp;1]) &gt;&nbsp;0&nbsp;else&nbsp;np.nan<\/code><code>&nbsp; &nbsp; sell_acc =&nbsp;len(sells) \/&nbsp;len(data&#91;data&#91;'Positions'] == -1]) \\<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;len(data&#91;data&#91;'Positions'] == -1]) &gt;&nbsp;0&nbsp;else&nbsp;np.nan<\/code><code>&nbsp; &nbsp;&nbsp;return&nbsp;buy_acc, sell_acc<\/code><code># ======== 5. \u53ef\u89c6\u5316 ========<\/code><code>def&nbsp;plot_ma_signals(stock_data, combinations, ma_function, ma_label):<\/code><code>&nbsp; &nbsp;&nbsp;\"\"\"<\/code><code>&nbsp; &nbsp; \u7ed8\u5236\u4e0d\u540c\u65f6\u95f4\u53c2\u6570\u7ec4\u5408\u4e0b\u7684\u5747\u7ebf\u4ea4\u53c9\u4fe1\u53f7\u56fe<\/code><code>&nbsp; &nbsp; 6\u4e2a\u5b50\u56fe\uff0c\u5206\u522b\u5bf9\u5e946\u7ec4(\u77ed\u5468\u671f,\u957f\u5468\u671f)\u7ec4\u5408<\/code><code>&nbsp; &nbsp; \u6bcf\u4e2a\u5b50\u56fe\u663e\u793a\uff1a\u4ef7\u683c\u66f2\u7ebf\u3001\u77ed\/\u957f\u671f\u5747\u7ebf\u3001\u8f6c\u5f3a\/\u8f6c\u5f31\u4fe1\u53f7\u70b9\u3001\u51c6\u786e\u7387<\/code><code>&nbsp; &nbsp; \"\"\"<\/code><code>&nbsp; &nbsp; fig, axs = plt.subplots(3,&nbsp;2, figsize=(25,&nbsp;15))<\/code><code>&nbsp; &nbsp; fig.suptitle(f'{ma_label}&nbsp;\u4e0d\u540c\u65f6\u95f4\u5c3a\u5ea6\u4e0b\u7684\u4ea4\u53c9\u4fe1\u53f7\u5bf9\u6bd4', fontsize=16)<\/code><code>&nbsp; &nbsp; term_labels = {<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; (5,&nbsp;20):&nbsp;\"\u77ed\u671f (5\/20\u5929)\",<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; (10,&nbsp;50):&nbsp;\"\u77ed\u4e2d\u671f (10\/50\u5929)\",<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; (20,&nbsp;100):&nbsp;\"\u4e2d\u671f (20\/100\u5929)\",<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; (50,&nbsp;200):&nbsp;\"\u4e2d\u957f\u671f (50\/200\u5929)\",<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; (100,&nbsp;250):&nbsp;\"\u957f\u671f (100\/250\u5929)\",<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; (200,&nbsp;365):&nbsp;\"\u8d85\u957f\u671f (200\/365\u5929)\"<\/code><code>&nbsp; &nbsp; }<\/code><code>&nbsp; &nbsp;&nbsp;for&nbsp;i, (short_window, long_window)&nbsp;in&nbsp;enumerate(combinations,&nbsp;1):<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; data = identify_signals(stock_data.copy(), short_window, long_window, ma_function)<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; buy_accuracy, sell_accuracy = calculate_accuracy(data)<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; term_label = term_labels.get((short_window, long_window),&nbsp;f\"{short_window}\/{long_window}\")<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; ax = axs&#91;(i -&nbsp;1) \/\/&nbsp;2, (i -&nbsp;1) %&nbsp;2]<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; ax.plot(data.index, data&#91;'Close'], label='\u6536\u76d8\u4ef7', alpha=0.5)<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; ax.plot(data.index, data&#91;'Short_MA'], label=f'{short_window}\u5929{ma_label}', alpha=0.8)<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; ax.plot(data.index, data&#91;'Long_MA'], label=f'{long_window}\u5929{ma_label}', alpha=0.8)<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;# \u8f6c\u5f3a\u4fe1\u53f7\uff1a\u7eff\u8272\u4e09\u89d2<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; ax.scatter(data.index, data&#91;'Close'],<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;label='\u8f6c\u5f3a\u4fe1\u53f7', marker='^', color='g',<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;alpha=1, s=50&nbsp;* data&#91;'Positions'].clip(lower=0))<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;# \u8f6c\u5f31\u4fe1\u53f7\uff1a\u7ea2\u8272\u5012\u4e09\u89d2<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; ax.scatter(data.index, data&#91;'Close'],<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;label='\u8f6c\u5f31\u4fe1\u53f7', marker='v', color='r',<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;alpha=1, s=50&nbsp;* data&#91;'Positions'].clip(upper=0).abs())<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; accuracy_title =&nbsp;f\"\u8f6c\u5f3a\u51c6\u786e\u7387:&nbsp;{buy_accuracy*100:.0f}%, \u8f6c\u5f31\u51c6\u786e\u7387:&nbsp;{sell_accuracy*100:.0f}%\"<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; ax.set_title(f'{term_label}&nbsp;{ma_label}&nbsp;\u4ea4\u53c9 -&nbsp;{accuracy_title}')<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; ax.set_xlabel('\u65e5\u671f')<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; ax.set_ylabel('\u4ef7\u683c')<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; ax.legend()<\/code><code>&nbsp; &nbsp; plt.tight_layout(rect=&#91;0,&nbsp;0,&nbsp;1,&nbsp;0.96])<\/code><code>&nbsp; &nbsp; plt.show()<\/code><code># ======== 6. \u4e3b\u7a0b\u5e8f ========<\/code><code>stock =&nbsp;'AAPL'<\/code><code>start_date =&nbsp;'2020-01-01'<\/code><code>end_date =&nbsp;'2024-01-01'<\/code><code># \u516d\u7ec4\u53c2\u6570\uff0c\u8986\u76d6\u4ece\u77ed\u671f\u5230\u8d85\u957f\u671f<\/code><code>time_scale_combinations = &#91;(5,&nbsp;20), (10,&nbsp;50), (20,&nbsp;100),<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(50,&nbsp;200), (100,&nbsp;250), (200,&nbsp;365)]<\/code><code>stock_data = fetch_data(stock, start_date, end_date)<\/code><code># \u5206\u522b\u7528SMA\u3001EMA\u3001WMA\u8dd1\u4e00\u904d<\/code><code>plot_ma_signals(stock_data, time_scale_combinations, SMA,&nbsp;\"SMA\")<\/code><code>plot_ma_signals(stock_data, time_scale_combinations, EMA,&nbsp;\"EMA\")<\/code><code>plot_ma_signals(stock_data, time_scale_combinations, WMA,&nbsp;\"WMA\")<\/code><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u9762\u8fd9\u6bb5\u4ee3\u7801\u7684\u5b8c\u6574\u53ef\u8fd0\u884c\u7248\u672c\u548c\u66f4\u8be6\u7ec6\u7684\u53c2\u6570\u8bf4\u660e\uff0c\u8fd9\u91cc\u5c55\u793a\u7684\u662f\u6838\u5fc3\u903b\u8f91\uff0c\u780d\u6389\u4e86\u4e00\u4e9b\u8f85\u52a9\u51fd\u6570\uff0c\u4fdd\u8bc1\u4f60\u62ff\u5230\u5c31\u80fd\u7406\u89e3\u4e3b\u5e72\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u5927\u5bb6\u9700\u8981\u6df1\u5165\u5b66\u4e60\u4e86\u89e3\uff0c\u53ef\u4ee5\u770b\u770b\u6211\u524d\u9762\u5199\u8fc7\u7684\u4e00\u7bc7\u6587\u7ae0\uff1a<a href=\"https:\/\/mp.weixin.qq.com\/s?__biz=MzkzNzY0NjIyNQ==&amp;mid=2247487656&amp;idx=1&amp;sn=82e1b23c2b7efb5af2487541bef2734e&amp;scene=21#wechat_redirect\" target=\"_blank\" rel=\"noreferrer noopener\">\u638c\u63e1\u8fd95\u79cd\u4e13\u5bb6\u7ea7MA(\u79fb\u52a8\u5e73\u5747\u7ebf)\u6280\u672f\uff0c\u8ba9\u60a8\u7684\u4ea4\u6613\u5982\u9c7c\u5f97\u6c34<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"http:\/\/laoyulaoyu.com\/wp-content\/uploads\/2026\/05\/\u56fe-2.-SMA\u3001EMA-\u548c-WMA-\u7684\u5404\u79cd\u79fb\u52a8\u5e73\u5747\u7ebf\u4ea4\u53c9\u53ca\u5176\u5bf9\u591a\u4e2a\u65f6\u95f4\u8303\u56f4\u5185\u4ea4\u6613\u4fe1\u53f7\u7684\u5f71\u54cd\u3002-1024x607.webp\" alt=\"\" class=\"wp-image-4080\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\"><em>\u3010\u56fe2\u3011\u4e09\u79cd\u5747\u7ebf\u65b9\u6cd5(SMA\/EMA\/WMA)\u5728\u516d\u7ec4\u4e0d\u540c\u65f6\u95f4\u53c2\u6570\u4e0b\u7684\u4ea4\u53c9\u4fe1\u53f7\u5bf9\u6bd4<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u2463 \u4fe1\u53f7\u51c6\u786e\u7387<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f88\u591a\u4eba\u62ff\u5230\u4e00\u4e2a\u7b56\u7565\uff0c\u4e0a\u6765\u5c31\u770b\u6700\u7ec8\u6536\u76ca\u7387\u3002\u8001\u4f59\u544a\u8bc9\u4f60\uff0c\u8fd9\u4e2a\u4e60\u60ef\u5f97\u6539\u3002<strong>\u7b56\u7565\u597d\u4e0d\u597d\uff0c\u5148\u770b\u4fe1\u53f7\u5bf9\u4e0d\u5bf9\u3002<\/strong>\u4fe1\u53f7\u90fd\u4e0d\u51c6\uff0c\u8c08\u6536\u76ca\u7387\u5c31\u662f\u81ea\u5df1\u9a97\u81ea\u5df1\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u9762\u4ee3\u7801\u91cc\u6211\u7528\u7684\u51c6\u786e\u7387\u8ba1\u7b97\u903b\u8f91\u5f88\u76f4\u63a5\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u8f6c\u5f3a\u4fe1\u53f7\u51fa\u73b0 \u2192 \u770b\u672a\u67655\u5929\u4ef7\u683c\u662f\u5426\u771f\u7684\u8d70\u9ad8<\/strong>\u3002\u8d70\u9ad8\u8bf4\u660e\u4fe1\u53f7\u5224\u65ad\u5bf9\u4e86\u65b9\u5411\uff1b\u8d70\u4f4e\u8bf4\u660e\u8fd9\u662f\u4e2a\u5047\u4fe1\u53f7\u3002<\/li>\n\n\n\n<li><strong>\u8f6c\u5f31\u4fe1\u53f7\u51fa\u73b0 \u2192 \u770b\u672a\u67655\u5929\u4ef7\u683c\u662f\u5426\u771f\u7684\u8d70\u4f4e<\/strong>\u3002\u8d70\u4f4e\u8bf4\u660e\u5224\u65ad\u6b63\u786e\uff1b\u8d70\u9ad8\u8bf4\u660e\u4fe1\u53f7\u5728\u8bef\u5bfc\u4f60\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e2a&#8221;5\u5929&#8221;\u4e0d\u662f\u62cd\u8111\u888b\u5b9a\u7684\u3002\u6211\u5728\u5b9e\u9645\u56de\u6d4b\u4e2d\u6d4b\u8bd5\u8fc73\u5929\u30015\u5929\u300110\u5929\u300120\u5929\u56db\u4e2a\u524d\u77bb\u7a97\u53e3\u30025\u5929\u5728\u5927\u591a\u6570\u6807\u7684\u4e0a\u662f\u4e00\u4e2a\u6bd4\u8f83\u597d\u7684\u5e73\u8861\u70b9\u2014\u2014\u65e2\u4e0d\u4f1a\u56e0\u4e3a\u524d\u77bb\u671f\u592a\u77ed\u800c\u628a\u6b63\u5e38\u6ce2\u52a8\u5f53\u6210\u9519\u8bef\u4fe1\u53f7\uff0c\u4e5f\u4e0d\u4f1a\u56e0\u4e3a\u524d\u77bb\u671f\u592a\u957f\u800c\u5f15\u5165\u8fc7\u591a\u65e0\u5173\u7684\u5e02\u573a\u566a\u97f3\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6765\u770b\u770b\u4e0d\u540c\u53c2\u6570\u7ec4\u5408\u4e0b\u7684\u51c6\u786e\u7387\u8868\u73b0\uff08\u4ee5SMA\u4e3a\u4f8b\uff0c\u6807\u7684\u662fAAPL\uff0c\u65f6\u95f4\u6bb52020-2024\uff09\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-center\" data-align=\"center\"><strong>\u77ed\u5468\u671f<\/strong><\/th><th class=\"has-text-align-center\" data-align=\"center\"><strong>\u957f\u5468\u671f<\/strong><\/th><th class=\"has-text-align-center\" data-align=\"center\"><strong>\u8f6c\u5f3a\u51c6\u786e\u7387<\/strong><\/th><th class=\"has-text-align-center\" data-align=\"center\"><strong>\u8f6c\u5f31\u51c6\u786e\u7387<\/strong><\/th><th class=\"has-text-align-center\" data-align=\"center\"><strong>\u4fe1\u53f7\u603b\u6570<\/strong><\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\">5<\/td><td class=\"has-text-align-center\" data-align=\"center\">20<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u7ea655-60%<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u7ea650-55%<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u9891\u7e41<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">10<\/td><td class=\"has-text-align-center\" data-align=\"center\">50<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u7ea658-65%<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u7ea655-60%<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u8f83\u591a<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">20<\/td><td class=\"has-text-align-center\" data-align=\"center\">100<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u7ea660-68%<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u7ea658-63%<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u9002\u4e2d<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">50<\/td><td class=\"has-text-align-center\" data-align=\"center\">200<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u7ea665-72%<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u7ea662-68%<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u8f83\u5c11<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">100<\/td><td class=\"has-text-align-center\" data-align=\"center\">250<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u7ea668-75%<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u7ea665-70%<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u5f88\u5c11<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">200<\/td><td class=\"has-text-align-center\" data-align=\"center\">365<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u7ea670-76%<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u7ea668-72%<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u6781\u5c11<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8868\u6570\u636e\u662f\u57fa\u4e8e\u7279\u5b9a\u65f6\u95f4\u6bb5\u548c\u7279\u5b9a\u6807\u7684\u7684\u56de\u6d4b\u7ed3\u679c\uff0c\u4e0d\u540c\u6807\u7684\u3001\u4e0d\u540c\u65f6\u95f4\u6bb5\u7684\u51c6\u786e\u7387\u4f1a\u6709\u660e\u663e\u5dee\u5f02\u3002\u8fd9\u4e2a\u8868\u683c\u5c55\u793a\u7684\u662f<strong>\u8d8b\u52bf\u89c4\u5f8b\uff1a<\/strong>\u53c2\u6570\u8d8a\u5927\uff0c\u4fe1\u53f7\u8d8a\u5c11\u4f46\u8d8a\u51c6\uff0c\u800c\u4e0d\u662f\u8ba9\u4f60\u76f4\u63a5\u62ff\u53bb\u7528\u7684\u7edd\u5bf9\u6570\u503c\u3002\u6240\u6709\u56de\u6d4b\u7ed3\u679c\u90fd\u53ea\u662f\u5386\u53f2\u8868\u73b0\u53c2\u8003\uff0c\u4e0d\u662f\u672a\u6765\u7ed3\u679c\u7684\u4fdd\u8bc1\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ece\u8868\u91cc\u80fd\u770b\u51fa\u4e00\u4e2a\u89c4\u5f8b\uff1a<strong>\u53c2\u6570\u8d8a\u5927\uff0c\u51c6\u786e\u7387\u8d8a\u9ad8\uff0c\u4f46\u4fe1\u53f7\u6570\u91cf\u8d8a\u5c11\u3002<\/strong>\uff0820, 100\uff09\u8fd9\u4e2a\u7ec4\u5408\u53d1\u51fa\u4e86\u9002\u4e2d\u6570\u91cf\u7684\u4fe1\u53f7\uff0c\u51c6\u786e\u7387\u4e5f\u7ef4\u6301\u5728\u516d\u6210\u4ee5\u4e0a\u3002\u800c\uff08200, 365\uff09\u867d\u7136\u51c6\u786e\u7387\u53ef\u80fd\u8d85\u8fc770%\uff0c\u4f46\u56db\u5e74\u91cc\u53ef\u80fd\u53ea\u89e6\u53d1\u4e24\u4e09\u6b21\u4fe1\u53f7\uff0c\u5b9e\u64cd\u610f\u4e49\u4e0d\u5927\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u2464 \u65f6\u95f4\u6846\u67b6\u7684\u9009\u62e9<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u662f\u5747\u7ebf\u7b56\u7565\u91cc\u6700\u5bb9\u6613\u88ab\u5ffd\u89c6\u3001\u4e5f\u6700\u81f4\u547d\u7684\u95ee\u9898\u3002\u6211\u89c1\u8fc7\u592a\u591a\u4eba\u62ff\u7740\uff085, 20\uff09\u7684\u53c2\u6570\uff0c\u5728\u65e5\u7ebf\u7ea7\u522b\u8dd1\u51fa\u4e00\u4e2a\u770b\u8d77\u6765\u8fd8\u4e0d\u9519\u7684\u66f2\u7ebf\uff0c\u5c31\u5174\u51b2\u51b2\u62ff\u53bb\u5b9e\u76d8\u4e86\uff0c\u53ef\u60f3\u800c\u77e5\u7ed3\u679c\u4e0d\u4f1a\u7406\u60f3\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0d\u540c\u65f6\u95f4\u6846\u67b6\u4e0b\uff0c\u7b56\u7565\u8868\u73b0\u5dee\u5f02\u5de8\u5927\uff1a<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u65e5\u5185\u4e0e\u77ed\u7ebf<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u5c0f\u65f6\u7ebf\u751a\u81f3\u5206\u949f\u7ebf\u7ea7\u522b\uff0c\u4ef7\u683c\u566a\u97f3\u975e\u5e38\u5927\u3002\u77ed\u671f\u5747\u7ebf\uff08\u59825\u4e0e20\u7684\u7ec4\u5408\uff09\u4f1a\u4ea7\u751f\u5927\u91cf\u4ea4\u53c9\u4fe1\u53f7\uff0c\u5176\u4e2d\u76f8\u5f53\u6bd4\u4f8b\u662f\u5047\u7684\u2014\u2014\u5747\u7ebf\u521a\u4ea4\u53c9\uff0c\u4ef7\u683c\u5c31\u53cd\u5411\u8fd0\u884c\u3002\u5728\u65e5\u5185\u573a\u666f\u91cc\u4f7f\u7528\u5747\u7ebf\u7b56\u7565\uff0c\u6211\u5efa\u8bae\u914d\u5408\u6210\u4ea4\u91cf\u505a\u4e8c\u6b21\u8fc7\u6ee4\uff0c\u6216\u8005\u628a\u53c2\u6570\u9002\u5f53\u653e\u5927\uff08\u6bd4\u5982\u4ece5\/20\u8c03\u523010\/30\uff09\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u65e5\u7ebf\u7ea7\u522b\u7684\u4e2d\u957f\u7ebf<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u65e5\u7ebf\u662f\u5747\u7ebf\u7b56\u7565\u6700\u8212\u670d\u7684\u6218\u573a\u300250\u4e0e200\u7684\u7ec4\u5408\u5728\u7f8e\u80a1\u4e3b\u6d41\u6807\u7684\u4e0a\u8868\u73b0\u51fa\u4e0d\u9519\u7684\u7a33\u5b9a\u6027\uff0c\u4fe1\u53f7\u4e0d\u591a\u4f46\u65b9\u5411\u5224\u65ad\u7684\u51c6\u786e\u6027\u76f8\u5bf9\u53ef\u9760\u3002\u8fd9\u4e2a\u7ea7\u522b\u7684\u7b56\u7565\u66f4\u9002\u5408\u505a\u8d8b\u52bf\u8ddf\u8e2a\u800c\u975e\u9891\u7e41\u64cd\u4f5c\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u5468\u7ebf\u751a\u81f3\u6708\u7ebf<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5230\u4e86\u8fd9\u4e2a\u7ea7\u522b\uff0c\u5747\u7ebf\u4ea4\u53c9\u4fe1\u53f7\u53d8\u5f97\u6781\u4e3a\u7a00\u758f\uff0c\u4f46\u6bcf\u6b21\u51fa\u73b0\u90fd\u503c\u5f97\u8ba4\u771f\u5bf9\u5f85\u3002\u5982\u679c\u4f60\u662f\u4e00\u4e2a\u504f\u5411\u5927\u5468\u671f\u7684\u6295\u8d44\u8005\uff0c\u5173\u6ce850\u4e0e200\u5728\u5468\u7ebf\u7ea7\u522b\u7684\u4ea4\u53c9\u53ef\u80fd\u6bd4\u65e5\u7ebf\u7ea7\u522b\u66f4\u6709\u53c2\u8003\u4ef7\u503c\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u6211\u4e2a\u4eba\u7684\u7ecf\u9a8c\u662f\uff1a<strong>\u522b\u5728\u5355\u4e00\u65f6\u95f4\u6846\u67b6\u4e0a\u505a\u51b3\u7b56\u3002<\/strong>\u5148\u5728\u5927\u5468\u671f\u786e\u8ba4\u8d8b\u52bf\u65b9\u5411\uff0c\u518d\u5230\u5c0f\u5468\u671f\u627e\u4fe1\u53f7\u89e6\u53d1\u70b9\uff1a\u8fd9\u4e2a&#8221;\u53cc\u5468\u671f\u786e\u8ba4&#8221;\u7684\u601d\u8def\u80fd\u5e2e\u4f60\u8fc7\u6ee4\u6389\u4e00\u5927\u534a\u865a\u5047\u4fe1\u53f7\u3002<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u2465 \u53c2\u6570\u600e\u4e48\u4f18\u5316\uff1f<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u53c2\u6570\u4f18\u5316\u8fd9\u4e2a\u8bdd\u9898\uff0c\u5c55\u5f00\u8bb2\u80fd\u5199\u4e00\u672c\u4e66\u3002\u8fd9\u91cc\u6211\u5148\u7ed9\u4e00\u4e2a\u6700\u5b9e\u7528\u7684\u6846\u67b6\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u7b2c\u4e00\u6b65\uff1a\u786e\u5b9a\u53c2\u6570\u641c\u7d22\u7a7a\u95f4\u3002<\/strong>\u77ed\u5468\u671f\u53c2\u6570\u901a\u5e38\u8bbe\u57285\u523060\u4e4b\u95f4\uff0c\u957f\u5468\u671f\u8bbe\u5728\u77ed\u5468\u671f\u76843\u52306\u500d\u3002\u522b\u4e00\u4e0a\u6765\u5c31\u505a\u5168\u91cf\u626b\u63cf\uff0c\u5148\u6846\u5b9a\u4e00\u4e2a\u5408\u7406\u8303\u56f4\u3002<\/li>\n\n\n\n<li><strong>\u7b2c\u4e8c\u6b65\uff1a\u9009\u4e00\u4e2a\u6838\u5fc3\u8bc4\u4f30\u6307\u6807\u3002<\/strong>\u51c6\u786e\u7387\u3001\u4fe1\u53f7\u6570\u91cf\u3001\u6700\u5927\u4e0d\u5229\u6ce2\u52a8\u5e45\u5ea6\u2014\u2014\u6311\u4e00\u4e2a\u4f60\u6700\u5728\u610f\u7684\uff0c\u4f5c\u4e3a\u4f18\u5316\u7684\u76ee\u6807\u51fd\u6570\u3002\u522b\u540c\u65f6\u4f18\u5316\u597d\u51e0\u4e2a\u6307\u6807\uff0c\u90a3\u6837\u4f60\u6c38\u8fdc\u627e\u4e0d\u5230\u6700\u4f18\u89e3\u3002<\/li>\n\n\n\n<li><strong>\u7b2c\u4e09\u6b65\uff1a\u6eda\u52a8\u7a97\u53e3\u56de\u6d4b\u3002<\/strong>\u628a\u5386\u53f2\u6570\u636e\u5207\u6210\u51e0\u6bb5\uff0c\u6bcf\u6bb5\u72ec\u7acb\u505a\u53c2\u6570\u9009\u62e9\uff0c\u7136\u540e\u770b\u9009\u51fa\u6765\u7684\u53c2\u6570\u5728\u4e0d\u540c\u65f6\u95f4\u6bb5\u662f\u5426\u7a33\u5b9a\u3002\u5982\u679c\u67d0\u7ec4\u53c2\u6570\u57282018-2020\u8868\u73b0\u5f88\u597d\uff0c\u57282021-2023\u8868\u73b0\u5f88\u5dee\uff0c\u90a3\u5b83\u5927\u6982\u7387\u662f\u8fc7\u62df\u5408\u4e86\u3002<\/li>\n\n\n\n<li><strong>\u7b2c\u56db\u6b65\uff1a\u4fdd\u7559\u4e00\u5b9a\u53c2\u6570\u5197\u4f59\u3002<\/strong>\u4e0d\u8981\u9009\u6700\u4f18\u7684\u90a3\u4e2a\u70b9\uff0c\u9009\u6700\u4f18\u53c2\u6570\u9644\u8fd1\u7684\u4e00\u4e2a&#8221;\u7a33\u5b9a\u533a\u57df&#8221;\u3002\u6bd4\u5982\uff0818, 95\uff09\u548c\uff0822, 105\uff09\u8868\u73b0\u5dee\u4e0d\u591a\uff0c\u90a3\u5c31\u9009\u4e2d\u95f4\u503c\uff0820, 100\uff09\uff0c\u8fd9\u6837\u7b56\u7565\u7684\u9c81\u68d2\u6027\u66f4\u5f3a\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code><code># \u53c2\u6570\u626b\u63cf\u793a\u4f8b\uff1a\u904d\u5386\u4e0d\u540c\u7ec4\u5408\uff0c\u8bb0\u5f55\u51c6\u786e\u7387<\/code><code>import&nbsp;itertools<\/code><code>def&nbsp;param_scan(data, short_range, long_range, ma_func, look_forward=5):<\/code><code>&nbsp; &nbsp;&nbsp;\"\"\"<\/code><code>&nbsp; &nbsp; \u53c2\u6570\u626b\u63cf\u51fd\u6570<\/code><code>&nbsp; &nbsp; \u904d\u5386\u6240\u6709(\u77ed\u5468\u671f, \u957f\u5468\u671f)\u7ec4\u5408\uff0c\u8bb0\u5f55\u8f6c\u5f3a\u548c\u8f6c\u5f31\u51c6\u786e\u7387<\/code><code>&nbsp; &nbsp; \"\"\"<\/code><code>&nbsp; &nbsp; results = &#91;]<\/code><code>&nbsp; &nbsp;&nbsp;for&nbsp;short_w, long_w&nbsp;in&nbsp;itertools.product(short_range, long_range):<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;short_w &gt;= long_w:<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;continue&nbsp;&nbsp;# \u77ed\u5468\u671f\u5fc5\u987b\u5c0f\u4e8e\u957f\u5468\u671f<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; df = identify_signals(data.copy(), short_w, long_w, ma_func)<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; buy_acc, sell_acc = calculate_accuracy(df, look_forward)<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; results.append({<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;'short': short_w,<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;'long': long_w,<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;'buy_acc': buy_acc,<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;'sell_acc': sell_acc,<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;'avg_acc': (buy_acc + sell_acc) \/&nbsp;2&nbsp;if&nbsp;not&nbsp;(np.isnan(buy_acc)&nbsp;or&nbsp;np.isnan(sell_acc))&nbsp;else&nbsp;np.nan<\/code><code>&nbsp; &nbsp; &nbsp; &nbsp; })<\/code><code>&nbsp; &nbsp;&nbsp;return&nbsp;pd.DataFrame(results).sort_values('avg_acc', ascending=False)<\/code><code><\/code><code># \u793a\u4f8b\uff1a\u626b\u63cfSMA\u7684\u77ed\u5468\u671f5-50\uff0c\u957f\u5468\u671f20-200<\/code><code>scan_results = param_scan(<\/code><code>&nbsp; &nbsp; stock_data,<\/code><code>&nbsp; &nbsp; short_range=range(5,&nbsp;55,&nbsp;5),<\/code><code>&nbsp; &nbsp; long_range=range(20,&nbsp;210,&nbsp;10),<\/code><code>&nbsp; &nbsp; ma_func=SMA<\/code><code>)<\/code><code><\/code><code>print(scan_results.head(10)) &nbsp;# \u6253\u5370\u5e73\u5747\u51c6\u786e\u7387\u6700\u9ad8\u768410\u7ec4\u53c2\u6570<\/code><\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\u6ce8\u610f\uff1a<\/strong>\u4e0a\u9762\u7684\u626b\u63cf\u53ea\u662f&#8221;\u4fe1\u53f7\u51c6\u786e\u7387&#8221;\u8fd9\u4e00\u4e2a\u7ef4\u5ea6\u7684\u8bc4\u4f30\u3002\u5982\u679c\u4f60\u8981\u8003\u8651\u66f4\u591a\u56e0\u7d20\uff1a\u6bd4\u5982\u4fe1\u53f7\u7684\u5206\u5e03\u662f\u5426\u5747\u5300\u3001\u6700\u5927\u8fde\u7eed\u9519\u8bef\u6b21\u6570\uff0c\u5c31\u9700\u8981\u5728\u76ee\u6807\u51fd\u6570\u91cc\u52a0\u5165\u66f4\u591a\u7ea6\u675f\u6761\u4ef6\u3002\u53c2\u6570\u4f18\u5316\u662f\u4e00\u4e2a&#8221;\u5148\u505a\u52a0\u6cd5\u518d\u505a\u51cf\u6cd5&#8221;\u7684\u8fc7\u7a0b\u3002<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u2466 \u5747\u7ebf\u7b56\u7565\u7684\u5c40\u9650\u6027<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5938\u4e86\u534a\u5929\uff0c\u8be5\u6cfc\u51b7\u6c34\u4e86\u3002\u5747\u7ebf\u4ea4\u53c9\u7b56\u7565\u6709\u51e0\u4e2a\u5148\u5929\u7f3a\u9677\uff0c\u8001\u4f59\u8e29\u8fc7\u7684\u5751\u603b\u7ed3\u5982\u4e0b\uff0c\u8ba9\u5927\u5bb6\u4ee5\u540e\u5fc3\u91cc\u6709\u6570\uff1a<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. \u6ede\u540e\u6027\u662f\u5b83\u7684\u5bbf\u547d<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5747\u7ebf\u672c\u8d28\u4e0a\u662f\u5bf9\u5386\u53f2\u4ef7\u683c\u7684\u5e73\u6ed1\uff0c\u5b83\u6c38\u8fdc\u8ddf\u5728\u4ef7\u683c\u540e\u9762\u8dd1\u3002\u5728\u5e02\u573a\u7a81\u7136\u53cd\u8f6c\u7684\u65f6\u5019\uff0c\u5747\u7ebf\u4fe1\u53f7\u5f80\u5f80\u8981\u5ef6\u8fdf\u51e0\u5929\u751a\u81f3\u51e0\u5468\u624d\u53cd\u5e94\u8fc7\u6765\u3002\u8fd9\u79cd\u6ede\u540e\u5728\u8d8b\u52bf\u884c\u60c5\u4e2d\u65e0\u4f24\u5927\u96c5\uff0c\u4f46\u5728V\u578b\u53cd\u8f6c\u884c\u60c5\u91cc\uff0c\u7b49\u4f60\u770b\u5230\u4fe1\u53f7\uff0c\u4ef7\u683c\u53ef\u80fd\u5df2\u7ecf\u8d70\u4e86\u5f88\u5927\u4e00\u6bb5\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. \u9707\u8361\u5e02\u662f\u5b83\u7684\u5669\u68a6<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u6a2a\u76d8\u6574\u7406\u3001\u4ef7\u683c\u533a\u95f4\u7a84\u5e45\u6ce2\u52a8\u7684\u884c\u60c5\u4e2d\uff0c\u5747\u7ebf\u4ea4\u53c9\u7b56\u7565\u4f1a\u9891\u7e41\u53d1\u51fa\u4fe1\u53f7\uff0c\u4f46\u5927\u591a\u6570\u90fd\u662f\u5047\u4fe1\u53f7\u3002\u5747\u7ebf\u521a\u4ea4\u53c9\u4e0a\u53bb\uff0c\u4ef7\u683c\u53c8\u6389\u56de\u6765\uff1b\u521a\u4ea4\u53c9\u4e0b\u6765\uff0c\u4ef7\u683c\u53c8\u5f39\u56de\u53bb\u3002\u8fd9\u79cd&#8221;\u53cd\u590d\u6a2a\u8df3&#8221;\u4e0d\u4ec5\u6d88\u8017\u7cbe\u529b\uff0c\u8fd8\u4f1a\u5e26\u6765\u4e0d\u5c0f\u7684\u6469\u64e6\u6210\u672c\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. \u5355\u4e00\u7ef4\u5ea6\uff0c\u7f3a\u4e4f\u591a\u7ef4\u9a8c\u8bc1<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5747\u7ebf\u53ea\u770b\u4ef7\u683c\u8fd9\u4e00\u4e2a\u7ef4\u5ea6\uff0c\u5b8c\u5168\u4e0d\u8003\u8651\u6210\u4ea4\u91cf\u3001\u6ce2\u52a8\u7387\u3001\u5e02\u573a\u60c5\u7eea\u7b49\u5176\u4ed6\u56e0\u7d20\u3002\u4e00\u4e2a\u6ca1\u6709\u6210\u4ea4\u91cf\u914d\u5408\u7684\u4ea4\u53c9\u4fe1\u53f7\uff0c\u53ef\u4fe1\u5ea6\u8981\u5927\u6253\u6298\u6263\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u600e\u4e48\u5e94\u5bf9\u8fd9\u4e9b\u5c40\u9650\uff1f\u6211\u7684\u505a\u6cd5\u662f\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-center\" data-align=\"center\"><strong>\u5c40\u9650\u6027<\/strong><\/th><th class=\"has-text-align-center\" data-align=\"center\"><strong>\u5e94\u5bf9\u65b9\u6cd5<\/strong><\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\">\u6ede\u540e\u6027<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u7528EMA\u6216WMA\u66ff\u4ee3SMA\uff0c\u7f29\u77ed\u54cd\u5e94\u65f6\u95f4<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">\u9707\u8361\u5e02\u5047\u4fe1\u53f7\u591a<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u53e0\u52a0ADX\u6307\u6807\u8fc7\u6ee4\uff0c\u53ea\u5728\u8d8b\u52bf\u660e\u786e\u65f6\u91c7\u7eb3\u4fe1\u53f7<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">\u7f3a\u5c11\u6210\u4ea4\u91cf\u9a8c\u8bc1<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u4fe1\u53f7\u89e6\u53d1\u65f6\u540c\u6b65\u68c0\u67e5\u6210\u4ea4\u91cf\u662f\u5426\u653e\u5927<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">\u5355\u4e00\u6307\u6807\u4e0d\u53ef\u9760<\/td><td class=\"has-text-align-center\" data-align=\"center\">\u5f15\u5165MACD\u6216RSI\u505a\u4e8c\u6b21\u786e\u8ba4\uff0c\u5f62\u6210&#8221;\u53cc\u4fe1\u53f7\u5171\u632f&#8221;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u2467 \u673a\u5668\u5b66\u4e60\u80fd\u5e2e\u4e0a\u5fd9\u5417\uff1f<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u662f\u4e00\u4e2a\u503c\u5f97\u804a\u804a\u7684\u8bdd\u9898\u3002\u6700\u8fd1\u4e24\u5e74\uff0c\u8d8a\u6765\u8d8a\u591a\u7684\u56e2\u961f\u5728\u5c1d\u8bd5\u628a\u673a\u5668\u5b66\u4e60\u548c\u4f20\u7edf\u5747\u7ebf\u7b56\u7565\u7ed3\u5408\u8d77\u6765\u3002\u601d\u8def\u5927\u81f4\u6709\u4e24\u79cd\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u7b2c\u4e00\u79cd\uff1a\u7528ML\u505a\u4fe1\u53f7\u8fc7\u6ee4\u3002<\/strong>\u5747\u7ebf\u4ea4\u53c9\u7167\u5e38\u89e6\u53d1\u4fe1\u53f7\uff0c\u4f46\u52a0\u4e00\u5c42ML\u6a21\u578b\u6765\u5224\u65ad\u8fd9\u4e2a\u4fe1\u53f7\u662f\u4e0d\u662f&#8221;\u53ef\u4fe1&#8221;\u3002\u6a21\u578b\u7684\u8f93\u5165\u7279\u5f81\u53ef\u4ee5\u5305\u62ec\uff1a\u4ea4\u53c9\u53d1\u751f\u65f6\u7684\u6210\u4ea4\u91cf\u3001\u6ce2\u52a8\u7387\u3001\u5e02\u573a\u5bbd\u5ea6\u3001\u76f8\u5173\u6807\u7684\u7684\u8d70\u52bf\u7b49\u7b49\u3002\u8f93\u51fa\u5c31\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u4e8c\u5143\u5224\u65ad\uff1a\u8fd9\u4e2a\u4fe1\u53f7\u9760\u8c31\u8fd8\u662f\u4e0d\u9760\u8c31\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u7b2c\u4e8c\u79cd\uff1a\u7528ML\u76f4\u63a5\u505a\u53c2\u6570\u52a8\u6001\u9009\u62e9\u3002<\/strong>\u4e0d\u518d\u6b7b\u5b88\u4e00\u7ec4\u56fa\u5b9a\u53c2\u6570\uff0c\u800c\u662f\u8ba9\u6a21\u578b\u6839\u636e\u5f53\u524d\u7684\u5e02\u573a\u72b6\u6001\uff08\u8d8b\u52bf\u3001\u6ce2\u52a8\u3001\u6d41\u52a8\u6027\u7b49\u7279\u5f81\uff09\u52a8\u6001\u9009\u62e9\u6700\u5408\u9002\u7684\u53c2\u6570\u7ec4\u5408\u3002\u6bd4\u5982\u5728\u6ce2\u52a8\u7387\u9ad8\u7684\u73af\u5883\u81ea\u52a8\u5207\u6362\u5230\u5927\u53c2\u6570\uff0c\u6ce2\u52a8\u7387\u4f4e\u7684\u65f6\u5019\u5207\u6362\u5230\u5c0f\u53c2\u6570\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e24\u79cd\u601d\u8def\u6211\u90fd\u505a\u8fc7\u4e00\u4e9b\u63a2\u7d22\u6027\u8d28\u7684\u5b9e\u9a8c\uff0c\u8bf4\u5b9e\u8bdd\u6548\u679c\u6709\u597d\u6709\u574f\u3002ML\u786e\u5b9e\u80fd\u5728\u67d0\u4e9b\u573a\u666f\u4e0b\u63d0\u5347\u51c6\u786e\u7387\uff0c\u4f46\u4e5f\u5f15\u5165\u4e86\u65b0\u7684\u8fc7\u62df\u5408\u98ce\u9669\u3002\u8fd9\u4e2a\u8bdd\u9898\u4ee5\u540e\u6709\u673a\u4f1a\u5355\u72ec\u5199\u4e00\u7bc7\u6765\u7ec6\u804a\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u5199\u5728\u6700\u540e<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5747\u7ebf\u4ea4\u53c9\u7b56\u7565\uff0c\u7b80\u5355\u5230\u4f60\u7b2c\u4e00\u6b21\u770b\u5c31\u80fd\u7406\u89e3\uff0c\u4f46\u590d\u6742\u5230\u4f60\u9700\u8981\u82b1\u597d\u51e0\u5e74\u624d\u80fd\u5728\u5b9e\u76d8\u4e2d\u771f\u6b63\u7528\u597d\u5b83\u3002\u8fd9\u7bc7\u6587\u7ae0\u4ece\u65b9\u6cd5\u8bba\u3001\u4ee3\u7801\u5b9e\u73b0\u3001\u51c6\u786e\u7387\u8bc4\u4f30\u3001\u53c2\u6570\u4f18\u5316\u5230\u5c40\u9650\u6027\u5206\u6790\u8d70\u4e86\u4e00\u904d\u5168\u6d41\u7a0b\uff0c\u5e0c\u671b\u80fd\u5e2e\u4f60\u5efa\u7acb\u4e00\u4e2a\u66f4\u5b8c\u6574\u7684\u8ba4\u77e5\u6846\u67b6\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u540e\u9001\u5927\u5bb6\u4e00\u53e5\u8bdd\uff1a<strong>\u7b56\u7565\u7684\u597d\u574f\u4e0d\u53d6\u51b3\u4e8e\u5b83\u6709\u591a\u590d\u6742\uff0c\u800c\u53d6\u51b3\u4e8e\u4f60\u5bf9\u5b83\u7684\u7406\u89e3\u6709\u591a\u6df1\u3002<\/strong>\u5747\u7ebf\u4ea4\u53c9\u8fd9\u79cd&#8221;\u8001\u6389\u7259&#8221;\u7684\u4fe1\u53f7\uff0c\u7528\u597d\u4e86\u7167\u6837\u80fd\u6210\u4e3a\u4f60\u5de5\u5177\u7bb1\u91cc\u6700\u597d\u7528\u7684\u90a3\u628a\u6273\u624b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u5927\u5bb6\u9700\u8981\u6df1\u5165\u5b66\u4e60\u4e86\u89e3\uff0c\u53ef\u4ee5\u770b\u770b\u6211\u524d\u9762\u5199\u8fc7\u7684\u4e00\u7bc7\u6587\u7ae0\uff1a<a href=\"https:\/\/mp.weixin.qq.com\/s?__biz=MzkzNzY0NjIyNQ==&amp;mid=2247487656&amp;idx=1&amp;sn=82e1b23c2b7efb5af2487541bef2734e&amp;scene=21#wechat_redirect\" target=\"_blank\" rel=\"noreferrer noopener\">\u638c\u63e1\u8fd95\u79cd\u4e13\u5bb6\u7ea7MA(\u79fb\u52a8\u5e73\u5747\u7ebf)\u6280\u672f\uff0c\u8ba9\u60a8\u7684\u4ea4\u6613\u5982\u9c7c\u5f97\u6c34<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u611f\u8c22\u82b1\u65f6\u95f4\u8bfb\u5230\u8fd9\u91cc\u3002\u5982\u679c\u4f60\u89c9\u5f97\u6587\u7ae0\u6709\u6536\u83b7\uff0c\u6b22\u8fce\u5206\u4eab\u7ed9\u4e5f\u5728\u7814\u7a76\u91cf\u5316\u7b56\u7565\u7684\u670b\u53cb\u3002\u54b1\u4eec\u4e0b\u7bc7\u89c1\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u98ce\u9669\u63d0\u793a\uff1a<\/strong>\u672c\u6587\u4ec5\u4f9b\u53c2\u8003\uff0c\u4e0d\u6784\u6210\u6295\u8d44\u5efa\u8bae\u3002\u6295\u8d44\u6709\u98ce\u9669\uff0c\u5165\u5e02\u9700\u8c28\u614e\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u7248\u6743\u58f0\u660e\uff1a<\/strong>\u672c\u6587\u4e3a\u539f\u521b\u5185\u5bb9\uff0c\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a>#\u91cf\u5316\u4ea4\u6613<\/a>&nbsp;<a>#Python<\/a>&nbsp;<a>#\u5747\u7ebf\u7b56\u7565<\/a>&nbsp;<a>#SMA<\/a>&nbsp;<a>#EMA<\/a>&nbsp;<a>#WMA<\/a>&nbsp;<a>#\u6280\u672f\u5206\u6790<\/a>&nbsp;<a>#\u8d8b\u52bf\u4fe1\u53f7<\/a>&nbsp;<a>#\u7b56\u7565\u56de\u6d4b<\/a>&nbsp;<a>#\u53c2\u6570\u4f18\u5316<\/a>&nbsp;<a>#\u6570\u636e\u5206\u6790<\/a>&nbsp;<a>#\u8001\u4f59\u635e\u9c7c<\/a><\/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&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/blog.laoyulaoyu.top\/index.php\/2026\/05\/25\/%e4%bb%8e%e9%9b%b6%e5%88%b0%e5%ae%9e%e6%88%98%ef%bc%9a%e6%89%8b%e6%8a%8a%e6%89%8b%e6%95%99%e4%bd%a0%e7%8e%a9%e8%bd%ac%e5%9d%87%e7%ba%bf%e4%ba%a4%e5%8f%89%e7%ad%96%e7%95%a5\/\">Continue reading<span class=\"screen-reader-text\">\u4ece\u96f6\u5230\u5b9e\u6218\uff1a\u624b\u628a\u624b\u6559\u4f60\u73a9\u8f6c\u5747\u7ebf\u4ea4\u53c9\u7b56\u7565<\/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":[17,4,5,6],"class_list":["post-3474","post","type-post","status-publish","format-standard","hentry","category-aiinvest","tag-ai","tag-6","entry"],"_links":{"self":[{"href":"https:\/\/blog.laoyulaoyu.top\/index.php\/wp-json\/wp\/v2\/posts\/3474","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.laoyulaoyu.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.laoyulaoyu.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.laoyulaoyu.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.laoyulaoyu.top\/index.php\/wp-json\/wp\/v2\/comments?post=3474"}],"version-history":[{"count":1,"href":"https:\/\/blog.laoyulaoyu.top\/index.php\/wp-json\/wp\/v2\/posts\/3474\/revisions"}],"predecessor-version":[{"id":3475,"href":"https:\/\/blog.laoyulaoyu.top\/index.php\/wp-json\/wp\/v2\/posts\/3474\/revisions\/3475"}],"wp:attachment":[{"href":"https:\/\/blog.laoyulaoyu.top\/index.php\/wp-json\/wp\/v2\/media?parent=3474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.laoyulaoyu.top\/index.php\/wp-json\/wp\/v2\/categories?post=3474"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.laoyulaoyu.top\/index.php\/wp-json\/wp\/v2\/tags?post=3474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}