{"id":6138,"date":"2025-06-03T13:58:29","date_gmt":"2025-06-04T06:52:29","guid":{"rendered":"https:\/\/badgameshow.com\/steven\/?p=6138"},"modified":"2025-06-04T13:58:29","modified_gmt":"2025-06-04T06:52:29","slug":"%e5%ad%b8%e7%bf%92%e5%a6%82%e4%bd%95%e5%88%a9%e7%94%a8%e7%a7%bb%e5%8b%95%e5%b9%b3%e5%9d%87%e8%b6%a8%e5%90%91%e6%8c%87%e6%95%b8dx%e4%ba%a4%e6%98%93%e6%8c%87%e6%a8%99","status":"publish","type":"post","link":"https:\/\/badgameshow.com\/steven\/python\/%e5%ad%b8%e7%bf%92%e5%a6%82%e4%bd%95%e5%88%a9%e7%94%a8%e7%a7%bb%e5%8b%95%e5%b9%b3%e5%9d%87%e8%b6%a8%e5%90%91%e6%8c%87%e6%95%b8dx%e4%ba%a4%e6%98%93%e6%8c%87%e6%a8%99\/","title":{"rendered":"2025 \u6700\u65b0 Python \u7a0b\u5f0f\u6559\u5b78\uff1a\u5982\u4f55\u5229\u7528\u79fb\u52d5\u5e73\u5747\u8da8\u5411\u6307\u6578(DX) \u4ea4\u6613\u6307\u6a19\u9032\u884c\u4ea4\u6613"},"content":{"rendered":"<p><meta name=\"keywords\" content=\"Python, \u79fb\u52d5\u5e73\u5747\u8da8\u5411\u6307\u6578, DX, \u4ea4\u6613\u6307\u6a19, \u6295\u8cc7, \u6280\u8853\u5206\u6790\"><\/p>\n<h1>2025 \u6700\u65b0 Python \u7a0b\u5f0f\u6559\u5b78\uff1a\u5982\u4f55\u5229\u7528\u79fb\u52d5\u5e73\u5747\u8da8\u5411\u6307\u6578(DX) \u4ea4\u6613\u6307\u6a19\u9032\u884c\u4ea4\u6613<\/h1>\n<p>\u79fb\u52d5\u5e73\u5747\u8da8\u5411\u6307\u6578(DX) \u662f\u4e00\u500b\u91cd\u8981\u7684\u4ea4\u6613\u6307\u6a19\uff0c\u5b83\u53ef\u4ee5\u5e6b\u52a9\u6295\u8cc7\u8005\u66f4\u597d\u5730\u5224\u65b7\u8da8\u52e2\uff0c\u4e26\u63d0\u4f9b\u4ea4\u6613\u6a5f\u6703\u3002\u672c\u6587\u5c07\u4ecb\u7d392025\u5e74\u6700\u65b0\u7684DX\u6307\u6a19\u4f7f\u7528\u6642\u6a5f\uff0c\u4ee5\u53ca\u5982\u4f55\u4f7f\u7528Python\u4f86\u5be6\u73fe\u5b83\uff0c\u4e26\u63d0\u4f9b\u5be6\u4f5c\u7bc4\u4f8b\u548c\u932f\u8aa4\u6392\u9664\u7684\u6280\u5de7\u3002<\/p>\n<h2>\u4ec0\u9ebc\u662f\u79fb\u52d5\u5e73\u5747\u8da8\u5411\u6307\u6578(DX)<\/h2>\n<p>\u79fb\u52d5\u5e73\u5747\u8da8\u5411\u6307\u6578(DX) \u662f\u4e00\u500b\u6280\u8853\u6307\u6a19\uff0c\u7528\u65bc\u5224\u65b7\u8da8\u52e2\u7684\u5f37\u5f31\u3002\u5b83\u662f\u57fa\u65bc\u5169\u500b\u6307\u6578\uff1a\u6b63\u5411\u6307\u6578\u548c\u8ca0\u5411\u6307\u6578\u3002\u6b63\u5411\u6307\u6578\u662f\u57fa\u65bc\u6700\u8fd1\u7684\u6b63\u8da8\u52e2\uff0c\u800c\u8ca0\u5411\u6307\u6578\u5247\u662f\u57fa\u65bc\u6700\u8fd1\u7684\u8ca0\u8da8\u52e2\u3002<\/p>\n<p>DX\u6307\u6a19\u7684\u503c\u4ecb\u65bc-100\u5230100\u4e4b\u9593\uff0c\u5176\u4e2d\u6b63\u503c\u8868\u793a\u8da8\u52e2\u5411\u4e0a\uff0c\u800c\u8ca0\u503c\u5247\u8868\u793a\u8da8\u52e2\u5411\u4e0b\u3002\u7576DX\u6307\u6a19\u7684\u503c\u63a5\u8fd1100\u6642\uff0c\u8868\u793a\u8da8\u52e2\u8d8a\u5f37\uff0c\u53cd\u4e4b\u5247\u8d8a\u5f31\u3002<\/p>\n<h2>DX\u6307\u6a19\u7684\u4f7f\u7528\u6642\u6a5f<\/h2>\n<p>DX\u6307\u6a19\u53ef\u7528\u65bc\u5224\u65b7\u8da8\u52e2\u7684\u5f37\u5f31\uff0c\u4e26\u63d0\u4f9b\u4ea4\u6613\u6a5f\u6703\u3002\u7576DX\u6307\u6a19\u7684\u503c\u8d85\u904e+\/-20\u6642\uff0c\u8868\u793a\u8da8\u52e2\u5df2\u7d93\u5f62\u6210\uff0c\u53ef\u4ee5\u8003\u616e\u9032\u884c\u4ea4\u6613\u3002\u6b64\u5916\uff0cDX\u6307\u6a19\u4e5f\u53ef\u7528\u65bc\u5224\u65b7\u8da8\u52e2\u7684\u8f49\u6298\u9ede\u3002\u7576DX\u6307\u6a19\u7684\u503c\u5f9e\u6b63\u8f49\u70ba\u8ca0\uff0c\u6216\u5f9e\u8ca0\u8f49\u70ba\u6b63\uff0c\u901a\u5e38\u8868\u793a\u8da8\u52e2\u53ef\u80fd\u6b63\u5728\u8f49\u8b8a\u3002<\/p>\n<h2>\u5982\u4f55\u4f7f\u7528Python\u4f86\u8a08\u7b97DX\u6307\u6a19<\/h2>\n<p>\u4f7f\u7528Python\u4f86\u8a08\u7b97DX\u6307\u6a19\u975e\u5e38\u7c21\u55ae\uff0c\u53ea\u9700\u4f7f\u7528\u5167\u5efa\u7684<a href=\"https:\/\/docs.python.org\/3\/library\/ta.html\" target=\"_blank\" rel=\"noopener\">ta-lib<\/a>\u51fd\u5f0f\u5eab\u3002\u4ee5\u4e0b\u662f\u6b65\u9a5f\uff1a<\/p>\n<p>1. \u5b89\u88ddta-lib\u51fd\u5f0f\u5eab\uff1a<\/p>\n<p>&#8220;`bash<br \/>\npip install ta-lib<br \/>\n&#8220;`<\/p>\n<p>2. \u4f7f\u7528\u4ee5\u4e0b\u7a0b\u5f0f\u78bc\u4f86\u8a08\u7b97DX\u6307\u6a19\uff1a<\/p>\n<p>&#8220;`python<br \/>\nimport talib<br \/>\nimport numpy as np<\/p>\n<p># \u5b9a\u7fa9\u80a1\u7968\u50f9\u683c\u5e8f\u5217<br \/>\nclose = np.array([100.00, 101.01, 102.03, 100.97, 100.89, 101.82, 102.90, 103.20])<\/p>\n<p># \u8a08\u7b97DX\u6307\u6a19<br \/>\ndx = talib.DX(close, timeperiod=14)<\/p>\n<p># \u986f\u793a\u7d50\u679c<br \/>\nprint(dx)<br \/>\n&#8220;`<\/p>\n<p>\u57f7\u884c\u4ee5\u4e0a\u7a0b\u5f0f\u78bc\u5f8c\uff0c\u53ef\u80fd\u6703\u5f97\u5230\u4ee5\u4e0b\u7d50\u679c\uff1a<\/p>\n<p>&#8220;`plaintext<br \/>\n[nan, nan, nan, nan, nan, nan, nan, nan]\n&#8220;`<\/p>\n<p>\u9019\u662f\u56e0\u70ba\u8cc7\u6599\u9ede\u4e0d\u8db3\u4ee5\u8a08\u7b9714\u65e5\u7684DX\u6307\u6a19\u3002\u78ba\u4fdd\u63d0\u4f9b\u8db3\u5920\u7684\u50f9\u683c\u6578\u64da\u4ee5\u7372\u5f97\u6b63\u78ba\u7684DX\u6307\u6a19\u503c\u3002<\/p>\n<h2>\u5ef6\u4f38\u61c9\u7528\u8207\u932f\u8aa4\u6392\u9664<\/h2>\n<p>\u82e5\u5728\u4f7f\u7528\u904e\u7a0b\u4e2d\u9047\u5230`nan`\u503c\uff0c\u8acb\u6aa2\u67e5\u4ee5\u4e0b\u5e7e\u9ede\uff1a<br \/>\n&#8211; \u78ba\u4fdd\u8f38\u5165\u7684\u50f9\u683c\u5e8f\u5217\u9577\u5ea6\u81f3\u5c11\u70ba14\u500b\u6578\u503c\u3002<br \/>\n&#8211; \u6aa2\u67e5\u6578\u64da\u662f\u5426\u5b58\u5728\u7f3a\u5931\u503c\uff0c\u4e26\u8003\u616e\u9032\u884c\u63d2\u503c\u6216\u522a\u9664\u3002<br \/>\n&#8211; \u78ba\u4fdd\u5df2\u6b63\u78ba\u5b89\u88dd\u548c\u5c0e\u5165`ta-lib`\u5eab\uff0c\u4e26\u4e14\u7248\u672c\u7b26\u5408\u9700\u6c42\u3002<\/p>\n<p>\u4f7f\u7528DX\u6307\u6a19\u6642\uff0c\u60a8\u9084\u53ef\u4ee5\u8003\u616e\u7d50\u5408\u5176\u4ed6\u6280\u8853\u6307\u6a19\u9032\u884c\u66f4\u5168\u9762\u7684\u5206\u6790\uff0c\u4f8b\u5982\u76f8\u5c0d\u5f37\u5f31\u6307\u6a19(RSI)\u6216\u79fb\u52d5\u5e73\u5747\u7dda(MA)\u3002<\/p>\n<h2>\u7d50\u8ad6<\/h2>\n<p>\u79fb\u52d5\u5e73\u5747\u8da8\u5411\u6307\u6578(DX) \u662f\u4e00\u500b\u91cd\u8981\u7684\u4ea4\u6613\u6307\u6a19\uff0c\u80fd\u5e6b\u52a9\u6295\u8cc7\u8005\u5224\u65b7\u8da8\u52e2\u4e26\u63d0\u4f9b\u4ea4\u6613\u6a5f\u6703\u3002\u4f7f\u7528Python\u4f86\u8a08\u7b97DX\u6307\u6a19\u975e\u5e38\u7c21\u55ae\uff0c\u53ea\u9700\u4f7f\u7528\u5167\u5efa\u7684ta-lib\u51fd\u5f0f\u5eab\u3002\u901a\u904e\u672c\u6587\u5b78\u7fd2\uff0c\u60a8\u53ef\u4ee5\u6709\u6548\u5730\u5229\u7528DX\u6307\u6a19\u9032\u884c\u4ea4\u6613\u5206\u6790\uff0c\u4ee5\u63d0\u9ad8\u6295\u8cc7\u6c7a\u7b56\u7684\u6e96\u78ba\u6027\u3002<\/p>\n<p>\u82e5\u60f3\u9032\u4e00\u6b65\u4e86\u89e3Python\u7684\u61c9\u7528\uff0c\u6b61\u8fce\u53c3\u8003\u6211\u5011\u7684\u8a73\u7d30\u6559\u5b78\u6587\u7ae0 [Python\u9032\u968e\u6280\u8853\u6559\u5b78](https:\/\/miner.tw)\u3002<\/p>\n<h2>Q&#038;A\uff08\u5e38\u898b\u554f\u984c\u89e3\u7b54\uff09<\/h2>\n<p>**Q1: DX\u6307\u6a19\u7684\u503c\u70ba\u4ec0\u9ebc\u6703\u51fa\u73fenan\uff1f**<br \/>\nA: DX\u6307\u6a19\u7684\u503c\u70ba`nan`\u901a\u5e38\u662f\u56e0\u70ba\u8f38\u5165\u6578\u64da\u4e0d\u8db3\u4ee5\u8a08\u7b97\u6240\u9700\u7684\u6642\u9593\u5340\u9593\u3002\u8acb\u78ba\u4fdd\u81f3\u5c11\u670914\u500b\u6578\u64da\u9ede\u3002<\/p>\n<p>**Q2: \u6211\u53ef\u4ee5\u5c07DX\u6307\u6a19\u8207\u54ea\u4e9b\u5176\u4ed6\u6307\u6a19\u7d50\u5408\u4f7f\u7528\uff1f**<br \/>\nA: \u60a8\u53ef\u4ee5\u5c07DX\u6307\u6a19\u8207\u76f8\u5c0d\u5f37\u5f31\u6307\u6a19(RSI)\u3001\u79fb\u52d5\u5e73\u5747\u7dda(MA)\u7b49\u5176\u4ed6\u6280\u8853\u6307\u6a19\u7d50\u5408\u4f7f\u7528\uff0c\u4ee5\u7372\u5f97\u66f4\u5168\u9762\u7684\u5206\u6790\u3002<\/p>\n<p>**Q3: \u5982\u4f55\u9078\u64c7\u9069\u5408\u7684\u6642\u9593\u5340\u9593\uff1f**<br \/>\nA: \u6642\u9593\u5340\u9593\u7684\u9078\u64c7\u901a\u5e38\u4f9d\u64da\u60a8\u7684\u4ea4\u6613\u98a8\u683c\u3002\u5982\u679c\u60a8\u662f\u77ed\u671f\u4ea4\u6613\u8005\uff0c\u53ef\u80fd\u6703\u9078\u64c7\u8f03\u77ed\u7684\u6642\u9593\u5340\u9593\uff1b\u800c\u9577\u671f\u6295\u8cc7\u8005\u5247\u53ef\u80fd\u9078\u64c7\u8f03\u9577\u7684\u6642\u9593\u5340\u9593\u3002<\/p>\n<p>&#8212;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6458\u8981\uff1a\u79fb\u52d5\u5e73\u5747\u8da8\u5411\u6307\u6578(DX)\u662f\u4e00\u7a2e\u4ea4\u6613\u6307\u6a19\uff0c\u53ef\u4ee5\u5e6b\u52a9\u6295\u8cc7\u8005\u66f4\u597d\u5730\u5206\u6790\u5e02\u5834\u8da8\u52e2\uff0c\u4e26\u63d0\u4f9b\u66f4\u591a\u7684\u4ea4\u6613\u6a5f\u6703\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u4f7f\u7528Python\u4f86\u8a08\u7b97DX\u6307\u6a19\uff0c\u4e26\u63d0\u4f9b\u4e00\u500b\u7c21\u55ae\u7684\u7bc4\u4f8b\u4f86\u8aaa\u660e\u5982\u4f55\u4f7f\u7528DX\u6307\u6a19\u9032\u884c\u4ea4\u6613\u3002<\/p>\n","protected":false},"author":1,"featured_media":2518,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[18,189],"tags":[15,188],"class_list":["post-6138","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-189","tag-python","tag-188"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/badgameshow.com\/steven\/wp-content\/uploads\/2022\/12\/DALL\u00b7E-2022-12-28-14.25.55-\u62f7\u8c9d2.png","jetpack-related-posts":[],"jetpack_shortlink":"https:\/\/wp.me\/pcFK27-1B0","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/6138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/comments?post=6138"}],"version-history":[{"count":1,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/6138\/revisions"}],"predecessor-version":[{"id":6139,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/6138\/revisions\/6139"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/media\/2518"}],"wp:attachment":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/media?parent=6138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/categories?post=6138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/tags?post=6138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}