{"id":6382,"date":"2025-06-03T15:10:19","date_gmt":"2025-06-04T07:14:19","guid":{"rendered":"https:\/\/badgameshow.com\/steven\/?p=6382"},"modified":"2025-06-04T15:10:19","modified_gmt":"2025-06-04T07:14:19","slug":"%e5%ad%b8%e7%bf%92%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8%e7%9b%b8%e5%b0%8d%e5%8a%9b%e9%87%8f%e6%8c%87%e6%95%b8%e5%80%92%e5%82%b3%e9%81%9e%e5%b8%b6relativestrengthindexechobands%e4%ba%a4%e6%98%93","status":"publish","type":"post","link":"https:\/\/badgameshow.com\/steven\/python\/%e5%ad%b8%e7%bf%92%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8%e7%9b%b8%e5%b0%8d%e5%8a%9b%e9%87%8f%e6%8c%87%e6%95%b8%e5%80%92%e5%82%b3%e9%81%9e%e5%b8%b6relativestrengthindexechobands%e4%ba%a4%e6%98%93\/","title":{"rendered":"\u5168\u9762\u638c\u63e1\u76f8\u5c0d\u529b\u91cf\u6307\u6578\u5012\u50b3\u905e\u5e36\uff08Relative Strength Index Echo Bands\uff09\u53ca\u5176Python\u5be6\u4f5c\u7bc4\u4f8b"},"content":{"rendered":"<p><meta name=\"keywords\" content=\"Python, \u76f8\u5c0d\u529b\u91cf\u6307\u6578\u5012\u50b3\u905e\u5e36, Relative Strength Index Echo Bands, \u4ea4\u6613\u6307\u6a19, \u4f7f\u7528\u6642\u6a5f\"><\/p>\n<h1>\u5168\u9762\u638c\u63e1\u76f8\u5c0d\u529b\u91cf\u6307\u6578\u5012\u50b3\u905e\u5e36\uff08Relative Strength Index Echo Bands\uff09\u53ca\u5176Python\u5be6\u4f5c\u7bc4\u4f8b<\/h1>\n<p>\u76f8\u5c0d\u529b\u91cf\u6307\u6578\u5012\u50b3\u905e\u5e36\uff08Relative Strength Index Echo Bands\uff0c\u7c21\u7a31RSI Echo Bands\uff09\u662f\u4e00\u7a2e\u6280\u8853\u5206\u6790\u5de5\u5177\uff0c\u5e6b\u52a9\u6295\u8cc7\u8005\u5224\u65b7\u5e02\u5834\u8d70\u52e2\u53ca\u9069\u6642\u9032\u884c\u4ea4\u6613\u3002\u900f\u904e\u4f7f\u7528Python\uff0c\u6211\u5011\u53ef\u4ee5\u8f15\u9b06\u5be6\u73fe\u9019\u4e00\u6307\u6a19\u7684\u8a08\u7b97\u8207\u53ef\u8996\u5316\u3002\u672c\u6587\u5c07\u4ecb\u7d39RSI Echo Bands\u7684\u6982\u5ff5\u3001\u4f7f\u7528\u6642\u6a5f\u3001Python\u5be6\u4f5c\u7bc4\u4f8b\u3001\u932f\u8aa4\u6392\u9664\u6280\u5de7\u4ee5\u53ca\u5ef6\u4f38\u61c9\u7528\u3002<\/p>\n<h2>\u4ec0\u9ebc\u662f\u76f8\u5c0d\u529b\u91cf\u6307\u6578\u5012\u50b3\u905e\u5e36\uff1f<\/h2>\n<p>\u76f8\u5c0d\u529b\u91cf\u6307\u6578\u5012\u50b3\u905e\u5e36\u662f\u57fa\u65bc\u50b3\u7d71\u76f8\u5c0d\u529b\u91cf\u6307\u6578\uff08RSI\uff09\u7684\u4e00\u7a2e\u5ef6\u4f38\u6307\u6a19\u3002RSI\u662f\u4e00\u500b\u91cd\u8981\u7684\u6280\u8853\u6307\u6a19\uff0c\u7528\u65bc\u8a55\u4f30\u80a1\u7968\u662f\u5426\u88ab\u904e\u5ea6\u8cb7\u5165\u6216\u8ce3\u51fa\u3002RSI Echo Bands\u9032\u4e00\u6b65\u901a\u904e\u9644\u52a0\u8a08\u7b97\uff0c\u63d0\u4f9b\u66f4\u6e05\u6670\u7684\u5e02\u5834\u8da8\u52e2\u548c\u4ea4\u6613\u4fe1\u865f\u3002<\/p>\n<p>\u9019\u4e00\u6307\u6a19\u7684\u904b\u7b97\u57fa\u65bc\u50f9\u683c\u8b8a\u5316\u7684\u5e73\u5747\u503c\uff0c\u80fd\u5920\u5e6b\u52a9\u4ea4\u6613\u8005\u5224\u65b7\u4f55\u6642\u9032\u5165\u6216\u9000\u51fa\u5e02\u5834\u3002\u4f7f\u7528\u9019\u500b\u6307\u6a19\uff0c\u6295\u8cc7\u8005\u53ef\u4ee5\u66f4\u6709\u6548\u5730\u6355\u6349\u5e02\u5834\u7684\u8f49\u6298\u9ede\u3002<\/p>\n<h2>\u76f8\u5c0d\u529b\u91cf\u6307\u6578\u5012\u50b3\u905e\u5e36\u7684\u4f7f\u7528\u6642\u6a5f<\/h2>\n<p>RSI Echo Bands\u7684\u4e3b\u8981\u7528\u9014\u5728\u65bc\u5224\u65b7\u5e02\u5834\u8da8\u52e2\u3002\u5728\u4ee5\u4e0b\u60c5\u6cc1\u4e0b\uff0c\u6295\u8cc7\u8005\u61c9\u8003\u616e\u4f7f\u7528\u6b64\u6307\u6a19\uff1a<\/p>\n<p>1. **\u8cb7\u5165\u4fe1\u865f**\uff1a\u7576RSI Echo Bands\u986f\u793a\u51fa\u9ad8\u65bc70\u7684\u503c\uff0c\u8868\u660e\u5e02\u5834\u53ef\u80fd\u904e\u71b1\uff0c\u9019\u6642\u82e5\u6307\u6a19\u958b\u59cb\u56de\u843d\uff0c\u53ef\u4ee5\u8003\u616e\u9032\u884c\u8ce3\u51fa\u3002<br \/>\n2. **\u8ce3\u51fa\u4fe1\u865f**\uff1a\u7576RSI Echo Bands\u986f\u793a\u4f4e\u65bc30\u7684\u503c\uff0c\u8868\u660e\u5e02\u5834\u53ef\u80fd\u904e\u51b7\uff0c\u82e5\u6307\u6a19\u958b\u59cb\u4e0a\u5347\uff0c\u9019\u662f\u4e00\u500b\u6f5b\u5728\u7684\u8cb7\u5165\u6a5f\u6703\u3002<\/p>\n<p>\u6b64\u6307\u6a19\u7684\u7cbe\u78ba\u6027\u5728\u65bc\u5176\u80fd\u5920\u5373\u6642\u53cd\u6620\u5e02\u5834\u7684\u8b8a\u5316\uff0c\u5e6b\u52a9\u6295\u8cc7\u8005\u505a\u51fa\u66f4\u6709\u4f9d\u64da\u7684\u6c7a\u7b56\u3002<\/p>\n<h2>\u4f7f\u7528Python\u5be6\u73fe\u76f8\u5c0d\u529b\u91cf\u6307\u6578\u5012\u50b3\u905e\u5e36<\/h2>\n<p>\u5728Python\u4e2d\uff0c\u6211\u5011\u53ef\u4ee5\u4f7f\u7528`numpy`\u548c`matplotlib`\u5eab\u4f86\u8a08\u7b97\u548c\u7e6a\u88fdRSI Echo Bands\u3002\u4ee5\u4e0b\u662f\u5be6\u4f5c\u7bc4\u4f8b\uff1a<\/p>\n<p>&#8220;`python<br \/>\nimport numpy as np<br \/>\nimport matplotlib.pyplot as plt<\/p>\n<p># \u8a08\u7b97RSI<br \/>\ndef rsi(prices, n=14):<br \/>\n    deltas = np.diff(prices)<br \/>\n    seed = deltas[:n+1]\n    up = seed[seed>=0].sum()\/n<br \/>\n    down = -seed[seed<0].sum()\/n\n    rs = up\/down\n    rsi = np.zeros_like(prices)\n    rsi[:n] = 100. - 100.\/(1.+rs)\n\n    for i in range(n, len(prices)):\n        delta = deltas[i-1] # \u7531\u65bc\u5dee\u5206\u6703\u5c11\u4e00\u500b\u503c\n\n        if delta > 0:<br \/>\n            upval = delta<br \/>\n            downval = 0.<br \/>\n        else:<br \/>\n            upval = 0.<br \/>\n            downval = -delta<\/p>\n<p>        up = (up*(n-1) + upval)\/n<br \/>\n        down = (down*(n-1) + downval)\/n<\/p>\n<p>        rs = up\/down<br \/>\n        rsi[i] = 100. &#8211; 100.\/(1.+rs)<\/p>\n<p>    return rsi<\/p>\n<p># \u7e6a\u88fd\u5716\u8868<br \/>\nprices = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])<br \/>\nrsi_values = rsi(prices)<\/p>\n<p>plt.figure(figsize=(10, 5))<br \/>\nplt.plot(prices, label=&#8217;Price&#8217;, color=&#8217;blue&#8217;)<br \/>\nplt.plot(rsi_values, label=&#8217;RSI&#8217;, color=&#8217;orange&#8217;)<br \/>\nplt.axhline(70, color=&#8217;red&#8217;, linestyle=&#8217;&#8211;&#8216;, label=&#8217;Overbought (70)&#8217;)<br \/>\nplt.axhline(30, color=&#8217;green&#8217;, linestyle=&#8217;&#8211;&#8216;, label=&#8217;Oversold (30)&#8217;)<br \/>\nplt.title(&#8216;Price and RSI Echo Bands&#8217;)<br \/>\nplt.xlabel(&#8216;Time&#8217;)<br \/>\nplt.ylabel(&#8216;Value&#8217;)<br \/>\nplt.legend()<br \/>\nplt.show()<br \/>\n&#8220;`<\/p>\n<p>\u9019\u500b\u7a0b\u5f0f\u78bc\u793a\u7bc4\u4e86\u5982\u4f55\u8a08\u7b97RSI\u4e26\u5c07\u5176\u8207\u50f9\u683c\u5716\u8868\u4e00\u8d77\u7e6a\u88fd\uff0c\u8b93\u6295\u8cc7\u8005\u80fd\u5920\u76f4\u89c0\u5730\u5206\u6790\u5e02\u5834\u8d70\u52e2\u3002<\/p>\n<h2>\u932f\u8aa4\u6392\u9664<\/h2>\n<p>\u5728\u5be6\u73fe\u904e\u7a0b\u4e2d\uff0c\u60a8\u53ef\u80fd\u6703\u9047\u5230\u4ee5\u4e0b\u5e38\u898b\u554f\u984c\uff1a<\/p>\n<p>&#8211; **\u6578\u64da\u683c\u5f0f\u4e0d\u6b63\u78ba**\uff1a\u78ba\u4fdd\u50b3\u5165\u7684\u50f9\u683c\u6578\u7d44\u662f\u6b63\u78ba\u7684numpy\u6578\u7d44\u3002<br \/>\n&#8211; **Numpy\u7248\u672c\u554f\u984c**\uff1a\u4e00\u4e9b\u820a\u7248numpy\u53ef\u80fd\u7121\u6cd5\u652f\u6301\u67d0\u4e9b\u64cd\u4f5c\uff0c\u8acb\u78ba\u4fdd\u4f7f\u7528\u6700\u65b0\u7248\u672c\u3002<br \/>\n&#8211; **\u5716\u8868\u672a\u986f\u793a**\uff1a\u5982\u679c\u4f7f\u7528Jupyter Notebook\uff0c\u8acb\u78ba\u4fdd\u4f7f\u7528`%matplotlib inline`\u4f86\u986f\u793a\u5716\u8868\u3002<\/p>\n<h2>\u5ef6\u4f38\u61c9\u7528<\/h2>\n<p>\u9664\u4e86RSI Echo Bands\uff0c\u60a8\u9084\u53ef\u4ee5\u8003\u616e\u7d50\u5408\u5176\u4ed6\u6280\u8853\u6307\u6a19\uff08\u4f8b\u5982\u79fb\u52d5\u5e73\u5747\u7dda\u3001MACD\u7b49\uff09\u4f86\u9032\u884c\u66f4\u5168\u9762\u7684\u5e02\u5834\u5206\u6790\u3002\u9019\u6a23\u4e0d\u50c5\u80fd\u63d0\u9ad8\u4ea4\u6613\u7684\u6210\u529f\u7387\uff0c\u9084\u80fd\u589e\u5f37\u60a8\u7684\u6295\u8cc7\u7b56\u7565\u3002<\/p>\n<p>\u5982\u9700\u4e86\u89e3\u66f4\u591aPython\u76f8\u95dc\u7684\u6280\u8853\u5206\u6790\u6587\u7ae0\uff0c\u8acb\u53c3\u8003\u9019\u7bc7[Python\u8207\u91d1\u878d\u6578\u64da\u5206\u6790\u7684\u6559\u5b78](https:\/\/vocus.cc\/article\/60f7f3e1fd89780001d4d6bb)\u3002<\/p>\n<h2>\u7d50\u8ad6<\/h2>\n<p>\u76f8\u5c0d\u529b\u91cf\u6307\u6578\u5012\u50b3\u905e\u5e36\u662f\u4e00\u7a2e\u5be6\u7528\u7684\u4ea4\u6613\u6307\u6a19\uff0c\u5e6b\u52a9\u6295\u8cc7\u8005\u66f4\u597d\u5730\u5224\u65b7\u5e02\u5834\u8d70\u52e2\u53ca\u6642\u6a5f\u3002\u900f\u904e\u672c\u6587\u7684\u4ecb\u7d39\u548cPython\u7bc4\u4f8b\uff0c\u60a8\u61c9\u8a72\u80fd\u5920\u719f\u7df4\u904b\u7528\u6b64\u6307\u6a19\u9032\u884c\u4ea4\u6613\u6c7a\u7b56\u3002<\/p>\n<h2>Q&#038;A\uff08\u5e38\u898b\u554f\u984c\u89e3\u7b54\uff09<\/h2>\n<p>**Q1: \u76f8\u5c0d\u529b\u91cf\u6307\u6578\u5012\u50b3\u905e\u5e36\u5728\u4ec0\u9ebc\u5e02\u5834\u4e2d\u6700\u6709\u6548\uff1f**<br \/>\nA1: RSI Echo Bands\u5728\u4efb\u4f55\u5177\u6709\u660e\u986f\u8d70\u52e2\u7684\u5e02\u5834\u4e2d\u90fd\u6709\u6548\uff0c\u5c24\u5176\u9069\u7528\u65bc\u80a1\u7968\u548c\u5916\u532f\u5e02\u5834\u3002<\/p>\n<p>**Q2: \u5982\u4f55\u8abf\u6574RSI\u7684\u8a08\u7b97\u53c3\u6578\uff1f**<br \/>\nA2: \u60a8\u53ef\u4ee5\u901a\u904e\u4fee\u6539`n`\u53c3\u6578\u4f86\u6539\u8b8aRSI\u7684\u8a08\u7b97\u9031\u671f\uff0c\u901a\u5e3814\u65e5\u662f\u6a19\u6e96\u8a2d\u5b9a\uff0c\u4f46\u6839\u64da\u5e02\u5834\u7279\u6027\u53ef\u9032\u884c\u8abf\u6574\u3002<\/p>\n<p>**Q3: RSI Echo Bands\u7684\u6700\u4f73\u4f7f\u7528\u983b\u7387\u662f\u4ec0\u9ebc\uff1f**<br \/>\nA3: RSI Echo Bands\u53ef\u4ee5\u5728\u65e5\u5167\u4ea4\u6613\u3001\u77ed\u671f\u6216\u9577\u671f\u4ea4\u6613\u4e2d\u4f7f\u7528\uff0c\u6839\u64da\u60a8\u7684\u4ea4\u6613\u7b56\u7565\u9032\u884c\u9078\u64c7\u3002<\/p>\n<p>&#8212;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6458\u8981\uff1a\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u4f7f\u7528Python\u4e2d\u7684\u76f8\u5c0d\u529b\u91cf\u6307\u6578\u5012\u50b3\u905e\u5e36(RelativeStrengthIndexEchoBands)\u4ea4\u6613\u6307\u6a19\uff0c\u4ee5\u53ca\u5b83\u7684\u4f7f\u7528\u6642\u6a5f\uff0c\u8b93\u60a8\u53ef\u4ee5\u66f4\u6709\u6548\u5730\u5229\u7528\u6b64\u6307\u6a19\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-6382","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-1EW","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/6382","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=6382"}],"version-history":[{"count":2,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/6382\/revisions"}],"predecessor-version":[{"id":12717,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/6382\/revisions\/12717"}],"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=6382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/categories?post=6382"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/tags?post=6382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}