{"id":6224,"date":"2025-06-02T15:17:40","date_gmt":"2025-06-04T07:26:40","guid":{"rendered":"https:\/\/badgameshow.com\/steven\/?p=6224"},"modified":"2025-06-04T15:17:40","modified_gmt":"2025-06-04T07:26:40","slug":"%e5%ad%b8%e7%bf%92%e5%a6%82%e4%bd%95%e5%88%a9%e7%94%a8%e6%8a%80%e8%a1%93%e6%8c%87%e6%a8%99%e5%b8%b6technicalindicatorbands%e4%ba%a4%e6%98%93%e6%8c%87%e6%a8%99%e7%9a%84python%e7%af%84%e4%be%8b","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%e6%8a%80%e8%a1%93%e6%8c%87%e6%a8%99%e5%b8%b6technicalindicatorbands%e4%ba%a4%e6%98%93%e6%8c%87%e6%a8%99%e7%9a%84python%e7%af%84%e4%be%8b\/","title":{"rendered":"\u30102025 \u6700\u65b0\uff01\u4f7f\u7528 Python \u8a08\u7b97\u6280\u8853\u6307\u6a19\u5e36 (Technical Indicator Bands) \u7684\u5b8c\u6574\u6559\u5b78\u8207\u5be6\u4f5c\u7bc4\u4f8b\u3011"},"content":{"rendered":"<p><meta name=\"keywords\" content=\"Python, \u6280\u8853\u6307\u6a19\u5e36, \u4ea4\u6613\u6307\u6a19, \u4f7f\u7528\u6642\u6a5f, \u80a1\u7968\u5206\u6790, \u8cfc\u8cb7\u6642\u6a5f, \u8ce3\u51fa\u6642\u6a5f\"><\/p>\n<h1>\u6280\u8853\u6307\u6a19\u5e36 (Technical Indicator Bands) \u4ea4\u6613\u6307\u6a19\u7684\u4f7f\u7528\u6642\u6a5f\u4ee5\u53ca Python \u7bc4\u4f8b<\/h1>\n<p>\u6280\u8853\u6307\u6a19\u5e36 (Technical Indicator Bands) \u662f\u4e00\u7a2e\u5728\u80a1\u5e02\u4ea4\u6613\u4e2d\u7d93\u5e38\u4f7f\u7528\u7684\u6280\u8853\u6307\u6a19\uff0c\u80fd\u5e6b\u52a9\u6295\u8cc7\u8005\u5224\u65b7\u80a1\u7968\u50f9\u683c\u7684\u8da8\u52e2\uff0c\u4e26\u63d0\u4f9b\u6f5b\u5728\u7684\u8cb7\u8ce3\u6642\u6a5f\u3002\u9019\u7a2e\u6307\u6a19\u57fa\u65bc\u904e\u53bb\u7684\u50f9\u683c\u6578\u64da\uff0c\u8a08\u7b97\u51fa\u4e0a\u9650\u548c\u4e0b\u9650\uff0c\u8b93\u6295\u8cc7\u8005\u80fd\u5920\u66f4\u597d\u5730\u638c\u63e1\u5e02\u5834\u52d5\u5411\u3002<\/p>\n<p>## \u6280\u8853\u6307\u6a19\u5e36\u7684\u57fa\u672c\u539f\u7406<\/p>\n<p>\u6280\u8853\u6307\u6a19\u5e36\u7684\u6838\u5fc3\u5728\u65bc\u8a08\u7b97\u51fa\u4e00\u689d\u4e2d\u9593\u7dda\u53ca\u5176\u4e0a\u4e0b\u9650\u3002\u7576\u80a1\u7968\u50f9\u683c\u8d85\u904e\u4e0a\u9650\u6642\uff0c\u9019\u901a\u5e38\u8868\u793a\u80a1\u50f9\u53ef\u80fd\u6703\u4e0b\u8dcc\uff1b\u7576\u50f9\u683c\u4f4e\u65bc\u4e0b\u9650\u6642\uff0c\u5247\u53ef\u80fd\u9810\u793a\u8457\u80a1\u50f9\u6703\u4e0a\u6f32\u3002\u9019\u8b93\u6295\u8cc7\u8005\u53ef\u4ee5\u4f9d\u64da\u50f9\u683c\u8d70\u52e2\u505a\u51fa\u66f4\u70ba\u660e\u667a\u7684\u4ea4\u6613\u6c7a\u7b56\u3002<\/p>\n<p>## \u4f7f\u7528\u6642\u6a5f<\/p>\n<p>&#8211; **\u8ce3\u51fa\u6642\u6a5f**\uff1a\u7576\u80a1\u7968\u50f9\u683c\u7a81\u7834\u4e0a\u9650\u6642\uff0c\u53ef\u4ee5\u8003\u616e\u8ce3\u51fa\u3002<br \/>\n&#8211; **\u8cb7\u5165\u6642\u6a5f**\uff1a\u7576\u80a1\u7968\u50f9\u683c\u8dcc\u7834\u4e0b\u9650\u6642\uff0c\u53ef\u4ee5\u8003\u616e\u8cb7\u5165\u3002<\/p>\n<p>## \u4f7f\u7528 Python \u8a08\u7b97\u6280\u8853\u6307\u6a19\u5e36<\/p>\n<p>\u4ee5\u4e0b\u662f\u4f7f\u7528 Python \u8a08\u7b97\u6280\u8853\u6307\u6a19\u5e36\u7684\u5b8c\u6574\u5be6\u4f5c\u7bc4\u4f8b\uff1a<\/p>\n<p>&#8220;`python<br \/>\nimport numpy as np<\/p>\n<p># \u8a08\u7b97\u6280\u8853\u6307\u6a19\u5e36\u7684\u4e0a\u9650\u548c\u4e0b\u9650<br \/>\ndef get_bands(prices, window):<br \/>\n    # \u8a08\u7b97\u6280\u8853\u6307\u6a19\u5e36\u7684\u4e2d\u9593\u7dda<br \/>\n    mid = np.mean(prices[-window:])<br \/>\n    # \u8a08\u7b97\u6280\u8853\u6307\u6a19\u5e36\u7684\u4e0a\u9650<br \/>\n    upper = mid + np.std(prices[-window:])<br \/>\n    # \u8a08\u7b97\u6280\u8853\u6307\u6a19\u5e36\u7684\u4e0b\u9650<br \/>\n    lower = mid &#8211; np.std(prices[-window:])<br \/>\n    return mid, upper, lower<\/p>\n<p># \u5047\u8a2d\u80a1\u7968\u50f9\u683c\u70ba [100, 101, 102, 103, 104]\nprices = [100, 101, 102, 103, 104]\n# \u8a08\u7b97\u6280\u8853\u6307\u6a19\u5e36\u7684\u4e0a\u9650\u548c\u4e0b\u9650<br \/>\nmid, upper, lower = get_bands(prices, 5)<br \/>\n# \u986f\u793a\u6280\u8853\u6307\u6a19\u5e36\u7684\u4e0a\u9650\u548c\u4e0b\u9650<br \/>\nprint(&#8220;\u4e0a\u9650:&#8221;, upper)<br \/>\nprint(&#8220;\u4e2d\u9593\u7dda:&#8221;, mid)<br \/>\nprint(&#8220;\u4e0b\u9650:&#8221;, lower)<br \/>\n&#8220;`<\/p>\n<p>### \u932f\u8aa4\u6392\u9664<\/p>\n<p>\u5728\u57f7\u884c\u4e0a\u8ff0\u7a0b\u5f0f\u78bc\u6642\uff0c\u53ef\u80fd\u6703\u9047\u5230\u4ee5\u4e0b\u554f\u984c\uff1a<\/p>\n<p>1. **\u8f38\u5165\u50f9\u683c\u6578\u64da\u4e0d\u8db3**\uff1a\u78ba\u4fdd\u50b3\u5165\u7684\u50f9\u683c\u6578\u64da\u5217\u8868\u81f3\u5c11\u5305\u542b `window` \u6578\u91cf\u7684\u5143\u7d20\uff0c\u5426\u5247\u5c07\u7121\u6cd5\u8a08\u7b97\u3002<br \/>\n2. **\u6578\u64da\u985e\u578b\u932f\u8aa4**\uff1a\u78ba\u4fdd\u50f9\u683c\u6578\u64da\u70ba\u6578\u503c\u578b\uff08\u5982\u6574\u6578\u6216\u6d6e\u9ede\u6578\uff09\u800c\u975e\u5b57\u4e32\u3002<\/p>\n<p>### \u5ef6\u4f38\u61c9\u7528<\/p>\n<p>\u6280\u8853\u6307\u6a19\u5e36\u4e0d\u50c5\u53ef\u4ee5\u61c9\u7528\u65bc\u80a1\u7968\u5e02\u5834\uff0c\u9084\u53ef\u4ee5\u64f4\u5c55\u5230\u5176\u4ed6\u91d1\u878d\u5de5\u5177\u7684\u5206\u6790\uff0c\u5982\u5916\u532f\u3001\u671f\u8ca8\u7b49\uff0c\u5e6b\u52a9\u4ea4\u6613\u8005\u66f4\u597d\u5730\u628a\u63e1\u5e02\u5834\u8da8\u52e2\u3002<\/p>\n<p>\u5982\u9700\u4e86\u89e3\u66f4\u591a\u95dc\u65bc Python \u7684\u61c9\u7528\uff0c\u53ef\u4ee5\u53c3\u8003\u9019\u7bc7 [Python \u6559\u5b78\u6587](https:\/\/vocus.cc) \u9032\u4e00\u6b65\u64f4\u5c55\u4f60\u7684\u77e5\u8b58\u3002<\/p>\n<p>## Q&#038;A\uff08\u5e38\u898b\u554f\u984c\u89e3\u7b54\uff09<\/p>\n<p>**Q1: \u6280\u8853\u6307\u6a19\u5e36\u7684\u8a08\u7b97\u516c\u5f0f\u662f\u4ec0\u9ebc\uff1f**<br \/>\nA1: \u6280\u8853\u6307\u6a19\u5e36\u7531\u4e2d\u9593\u7dda\uff08\u904e\u53bb `n` \u5929\u7684\u5e73\u5747\u50f9\u683c\uff09\u3001\u4e0a\u9650\uff08\u4e2d\u9593\u7dda\u52a0\u4e0a\u904e\u53bb `n` \u5929\u7684\u6a19\u6e96\u5dee\uff09\u4ee5\u53ca\u4e0b\u9650\uff08\u4e2d\u9593\u7dda\u6e1b\u53bb\u904e\u53bb `n` \u5929\u7684\u6a19\u6e96\u5dee\uff09\u7d44\u6210\u3002<\/p>\n<p>**Q2: \u4ec0\u9ebc\u6642\u5019\u61c9\u8a72\u4f7f\u7528\u6280\u8853\u6307\u6a19\u5e36\u9032\u884c\u4ea4\u6613\uff1f**<br \/>\nA2: \u7576\u80a1\u7968\u50f9\u683c\u63a5\u8fd1\u4e0a\u9650\u6642\uff0c\u8003\u616e\u8ce3\u51fa\uff1b\u7576\u80a1\u7968\u50f9\u683c\u63a5\u8fd1\u4e0b\u9650\u6642\uff0c\u8003\u616e\u8cb7\u5165\u3002\u9019\u53ef\u4ee5\u5e6b\u52a9\u4f60\u6700\u5927\u5316\u5229\u6f64\u4e26\u964d\u4f4e\u98a8\u96aa\u3002<\/p>\n<p>**Q3: \u662f\u5426\u6709\u5176\u4ed6\u6280\u8853\u6307\u6a19\u53ef\u4ee5\u642d\u914d\u4f7f\u7528\uff1f**<br \/>\nA3: \u662f\u7684\uff0c\u5e38\u898b\u7684\u6280\u8853\u6307\u6a19\u5305\u62ec\u79fb\u52d5\u5e73\u5747\u7dda\u3001\u76f8\u5c0d\u5f37\u5f31\u6307\u6a19 (RSI) \u548c\u5e03\u6797\u5e36\u7b49\uff0c\u9019\u4e9b\u6307\u6a19\u53ef\u4ee5\u63d0\u4f9b\u66f4\u5168\u9762\u7684\u5e02\u5834\u5206\u6790\u3002<\/p>\n<p>&#8212;<\/p>\n<p>\u9019\u6a23\u7684\u5167\u5bb9\u66f4\u65b0\u8207\u512a\u5316\u4e0d\u50c5\u7b26\u5408\u6700\u65b0\u7684 Python \u8a9e\u6cd5\u8207\u6700\u4f73\u5be6\u8e10\uff0c\u9084\u80fd\u63d0\u5347\u6587\u7ae0\u7684\u53ef\u8b80\u6027\u53ca SEO \u6548\u679c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6458\u8981\uff1a\u6280\u8853\u6307\u6a19\u5e36(TechnicalIndicatorBands)\u662f\u4e00\u7a2e\u5e38\u7528\u7684\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\u69cb\u5efa\u6280\u8853\u6307\u6a19\u5e36\uff0c\u4e26\u63d0\u4f9b\u4e00\u4e9b\u7bc4\u4f8b\u4f86\u89e3\u91cb\u5982\u4f55\u4f7f\u7528\u5b83\u5011\u4f86\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-6224","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-1Co","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/6224","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=6224"}],"version-history":[{"count":1,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/6224\/revisions"}],"predecessor-version":[{"id":6225,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/6224\/revisions\/6225"}],"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=6224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/categories?post=6224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/tags?post=6224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}