{"id":2670,"date":"2026-11-25T11:03:12","date_gmt":"2026-11-25T17:03:12","guid":{"rendered":"https:\/\/www.patternsmart.com\/cn\/?p=2670"},"modified":"2026-11-25T17:08:02","modified_gmt":"2026-11-25T17:08:02","slug":"mt5-%e5%b7%b2%e6%94%b6%e7%9b%98-rsi-%e6%96%9c%e7%8e%87%e7%9b%b4%e6%96%b9%e5%9b%be%ef%bc%9a%e4%bd%bf%e7%94%a8-mql5-copybuffer-%e8%a1%a1%e9%87%8f%e6%8c%af%e8%8d%a1%e6%8c%87%e6%a0%87%e5%8f%98%e5%8c%96","status":"publish","type":"post","link":"https:\/\/www.patternsmart.com\/cn\/mt5-%e5%b7%b2%e6%94%b6%e7%9b%98-rsi-%e6%96%9c%e7%8e%87%e7%9b%b4%e6%96%b9%e5%9b%be%ef%bc%9a%e4%bd%bf%e7%94%a8-mql5-copybuffer-%e8%a1%a1%e9%87%8f%e6%8c%af%e8%8d%a1%e6%8c%87%e6%a0%87%e5%8f%98%e5%8c%96\/","title":{"rendered":"MT5 \u5df2\u6536\u76d8 RSI \u659c\u7387\u76f4\u65b9\u56fe\uff1a\u4f7f\u7528 MQL5 CopyBuffer \u8861\u91cf\u632f\u8361\u6307\u6807\u53d8\u5316\u901f\u5ea6"},"content":{"rendered":"<div class=\"postie-post\">\n<div>\n<p><strong>\u4ea4\u6613\u8fdb\u9636\u6559\u7a0b | MT5 | MQL5 \u81ea\u5b9a\u4e49\u6307\u6807<\/strong><\/p>\n<p>\u76f8\u5bf9\u5f3a\u5f31\u6307\u6807 RSI \u901a\u5e38\u7528\u4e8e\u89c2\u5bdf\u5f53\u524d\u8bfb\u6570\u662f\u5426\u9ad8\u4e8e\u6216\u4f4e\u4e8e\u67d0\u4e2a\u53c2\u8003\u6c34\u5e73\u3002\u4e0d\u8fc7\uff0c\u53e6\u4e00\u4e2a\u503c\u5f97\u7814\u7a76\u7684\u95ee\u9898\u662f RSI \u672c\u8eab\u53d8\u5316\u5f97\u6709\u591a\u5feb\u3002\u540c\u6837\u662f56\u7684 RSI \u8bfb\u6570\uff0c\u53ef\u80fd\u6765\u81ea\u4e09\u6839K\u7ebf\u524d\u768444\uff0c\u4e5f\u53ef\u80fd\u6765\u81ea55\u3002\u6700\u7ec8\u6c34\u5e73\u4e00\u81f4\uff0c\u4f46\u51c0\u53d8\u5316\u901f\u5ea6\u4e0d\u540c\u3002\u672c\u6587\u4f7f\u7528 MQL5 \u7f16\u5199\u4e00\u4e2a MT5 \u72ec\u7acb\u7a97\u53e3\u76f4\u65b9\u56fe\u6307\u6807\uff0c\u4ee5\u6bcf\u6839K\u7ebf\u7684 RSI \u70b9\u6570\u53d8\u5316\u8861\u91cf\u5df2\u6536\u76d8\u6570\u636e\u7684\u53d8\u5316\u901f\u5ea6\uff0c\u5e76\u6f14\u793a\u5982\u4f55\u8bfb\u53d6\u5185\u7f6e\u6307\u6807\u53e5\u67c4\u3001\u5bf9\u9f50\u7f13\u51b2\u533a\u7d22\u5f15\u4ee5\u53ca\u5904\u7406\u5386\u53f2\u6570\u636e\u5c1a\u672a\u51c6\u5907\u597d\u7684\u60c5\u51b5\u3002<\/p>\n<p>&#013; <\/p>\n<h2>\u660e\u786e\u659c\u7387\u7684\u8ba1\u7b97\u5b9a\u4e49<\/h2>\n<p>\u8bbe R(s) \u4e3a\u56fe\u8868\u7d22\u5f15 s \u5bf9\u5e94\u7684 RSI \u503c\uff0c\u5176\u4e2d\u7d22\u5f150\u4ee3\u8868\u6b63\u5728\u5f62\u6210\u7684K\u7ebf\uff0c\u7d22\u5f151\u4ee3\u8868\u6700\u8fd1\u4e00\u6839\u5df2\u6536\u76d8K\u7ebf\u3002\u8bbe N \u4e3a\u6b63\u6574\u6570\uff0c\u5219\u7d22\u5f15 s \u7684 RSI \u659c\u7387\uff1d\uff3bR(s)\u2212R(s+N)\uff3d\u00f7N\u3002\u672c\u4f8b\u9ed8\u8ba4\u4f7f\u7528\u6536\u76d8\u4ef7\u8ba1\u7b9714\u5468\u671f RSI\uff0c\u659c\u7387\u95f4\u9694\u4e3a3\u3002\u7ed3\u679c\u4e3a\u6b63\uff0c\u8868\u793a RSI \u5728\u6307\u5b9a\u533a\u95f4\u5185\u51c0\u4e0a\u5347\uff1b\u7ed3\u679c\u4e3a\u8d1f\uff0c\u8868\u793a\u51c0\u4e0b\u964d\uff1b\u7ed3\u679c\u4e3a\u96f6\uff0c\u5219\u8bf4\u660e\u4e24\u4e2a\u7aef\u70b9\u7684 RSI \u6570\u503c\u76f8\u540c\u3002<\/p>\n<p>\u8fd9\u4e2a\u516c\u5f0f\u662f\u6709\u9650\u5dee\u5206\u659c\u7387\uff0c\u5e76\u975e\u7ebf\u6027\u56de\u5f52\u659c\u7387\u3001RSI \u767e\u5206\u6bd4\u53d8\u5316\u7387\u3001\u4ef7\u683c\u53d8\u5316\u7387\u6216\u56fe\u8868\u7ebf\u6761\u7684\u89c6\u89c9\u503e\u659c\u89d2\u5ea6\u3002\u5355\u4f4d\u4e3a\u6bcf\u6839K\u7ebf\u7684 RSI \u70b9\u6570\u3002\u4e09\u4e2aK\u7ebf\u95f4\u9694\u9700\u8981\u56db\u4e2a RSI \u89c2\u6d4b\u503c\u3002\u516c\u5f0f\u4ec5\u4f7f\u7528\u4e24\u4e2a\u7aef\u70b9\uff0c\u56e0\u6b64\u4e00\u6761\u5e73\u7a33\u4e0a\u5347\u7684\u8def\u5f84\u548c\u4e00\u6761\u4e2d\u9014\u53cd\u590d\u6ce2\u52a8\u7684\u8def\u5f84\uff0c\u53ea\u8981\u7aef\u70b9\u76f8\u540c\uff0c\u4fbf\u4f1a\u5f97\u5230\u76f8\u540c\u659c\u7387\u3002<\/p>\n<p>&#013; <\/p>\n<h2>\u5047\u8bbe\u884c\u60c5\u8ba1\u7b97\u5b9e\u4f8b<\/h2>\n<p>\u5047\u8bbe\u6700\u8fd1\u56db\u6839\u5df2\u6536\u76d8K\u7ebf\u7684 RSI \u6309\u65f6\u95f4\u5148\u540e\u5206\u522b\u4e3a44\u300149\u300151\u548c56\uff0c\u5bf9\u5e94\u56fe\u8868\u7d22\u5f154\u30013\u30012\u30011\u3002\u51c0\u53d8\u5316\u4e3a56\u221244\uff1d12\u70b9\uff0c\u8de8\u8d8a\u4e09\u4e2aK\u7ebf\u95f4\u9694\uff0c\u56e0\u6b64\u6bcf\u6839K\u7ebf\u5e73\u5747\u53d8\u531612\u00f73\uff1d+4\u70b9\u3002\u76f4\u65b9\u56fe\u5728\u7d22\u5f151\u7684\u4f4d\u7f6e\u7ed8\u5236+4\uff0c\u800c\u4e0d\u662f\u5c06\u6570\u503c\u753b\u5728\u5f53\u524d\u672a\u6536\u76d8K\u7ebf\u4e0a\u3002<\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/www.patternsmart.com\/cn\/wp-content\/uploads\/2026\/11\/PS_MT5_RSISlope_CN_Fig1.png\" alt=\"PS_MT5_RSISlope_CN_Fig1.png\" title=\"RSI rises from 44 to 56 over three closed-bar intervals\" style=\"max-width:100%;height:auto\"><figcaption>\u56fe1\uff1a\u5047\u8bbe RSI \u4ece44\u4e0a\u5347\u81f356\uff0c\u8de8\u8d8a\u4e09\u4e2a\u5df2\u6536\u76d8K\u7ebf\u95f4\u9694\uff0c\u659c\u7387\u4e3a\u6bcf\u6839K\u7ebf+4\u4e2a RSI \u70b9\u3002<\/figcaption><\/figure>\n<p>&#013; <\/p>\n<p>\u5982\u679c\u5c06\u4e24\u4e2a\u7aef\u70b9\u4e92\u6362\uff0c\u7ed3\u679c\u53d8\u4e3a\u22124\u3002\u82e5 RSI \u4ece50\u5f00\u59cb\uff0c\u4e2d\u9014\u5347\u81f365\uff0c\u6700\u7ec8\u56de\u523050\uff0c\u659c\u7387\u5219\u4e3a\u96f6\u3002\u56e0\u6b64\u96f6\u659c\u7387\u4e0d\u7b49\u4e8e\u6574\u4e2a\u533a\u95f4\u7684\u52a8\u80fd\u59cb\u7ec8\u7a33\u5b9a\u3002\u540c\u6837\uff0cRSI \u572850\u4ee5\u4e0b\u65f6\u4e5f\u53ef\u80fd\u5177\u6709\u6b63\u659c\u7387\u3002\u632f\u8361\u6307\u6807\u7684\u5f53\u524d\u6c34\u5e73\u4e0e\u53d8\u5316\u901f\u5ea6\u662f\u4e24\u79cd\u4e0d\u540c\u7684\u4fe1\u606f\uff0c\u9700\u8981\u5206\u522b\u7814\u7a76\uff0c\u800c\u4e0d\u80fd\u76f4\u63a5\u4e92\u76f8\u66ff\u4ee3\u3002<\/p>\n<p>&#013; <\/p>\n<h2>\u5b8c\u6574 MQL5 \u6307\u6807\u4ee3\u7801<\/h2>\n<pre style=\"white-space:pre;font-family:Consolas,Monaco,monospace\"><code>\/\/ PatternSmart: confirmed RSI slope in RSI points per bar<br>#property indicator_separate_window<br>#property indicator_buffers 1<br>#property indicator_plots 1<br>#property indicator_type1 DRAW_HISTOGRAM<br>#property indicator_color1 clrRoyalBlue<br>#property indicator_width1 3<br>#property indicator_label1 \"RSI slope\"<br>#property indicator_level1 0.0<br><br>input int RSIPeriod = 14;<br>input int SlopeBars = 3;<br><br>double SlopeBuffer[];<br>double RsiValues[];<br>int RsiHandle = INVALID_HANDLE;<br>datetime LastBarTime = 0;<br><br>int OnInit()<br>{<br>\u00a0\u00a0\u00a0\u00a0if(RSIPeriod &lt; 2 || SlopeBars &lt; 1)<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return(INIT_PARAMETERS_INCORRECT);<br><br>\u00a0\u00a0\u00a0\u00a0if(!SetIndexBuffer(0, SlopeBuffer, INDICATOR_DATA))<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return(INIT_FAILED);<br>\u00a0\u00a0\u00a0\u00a0ArraySetAsSeries(SlopeBuffer, true);<br>\u00a0\u00a0\u00a0\u00a0ArraySetAsSeries(RsiValues, true);<br>\u00a0\u00a0\u00a0\u00a0PlotIndexSetDouble(0, PLOT_EMPTY_VALUE, EMPTY_VALUE);<br>\u00a0\u00a0\u00a0\u00a0IndicatorSetInteger(INDICATOR_DIGITS, 2);<br>\u00a0\u00a0\u00a0\u00a0IndicatorSetString(INDICATOR_SHORTNAME, \"Closed RSI Slope\");<br><br>\u00a0\u00a0\u00a0\u00a0RsiHandle = iRSI(_Symbol, _Period, RSIPeriod, PRICE_CLOSE);<br>\u00a0\u00a0\u00a0\u00a0if(RsiHandle == INVALID_HANDLE)<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return(INIT_FAILED);<br>\u00a0\u00a0\u00a0\u00a0LastBarTime = 0;<br>\u00a0\u00a0\u00a0\u00a0return(INIT_SUCCEEDED);<br>}<br><br>int OnCalculate(const int rates_total,<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0const int prev_calculated,<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0const datetime &amp;time[],<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0const double &amp;open[],<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0const double &amp;high[],<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0const double &amp;low[],<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0const double &amp;close[],<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0const long &amp;tick_volume[],<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0const long &amp;volume[],<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0const int &amp;spread[])<br>{<br>\u00a0\u00a0\u00a0\u00a0ArraySetAsSeries(time, true);<br>\u00a0\u00a0\u00a0\u00a0if((long)rates_total &lt; (long)RSIPeriod + SlopeBars + 2)<br>\u00a0\u00a0\u00a0\u00a0{<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ArrayInitialize(SlopeBuffer, EMPTY_VALUE);<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return(0);<br>\u00a0\u00a0\u00a0\u00a0}<br><br>\u00a0\u00a0\u00a0\u00a0\/\/ Rebuild on a new bar or after a history reset.<br>\u00a0\u00a0\u00a0\u00a0if(prev_calculated == rates_total &amp;&amp; time[0] == LastBarTime)<br>\u00a0\u00a0\u00a0\u00a0{<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0SlopeBuffer[0] = EMPTY_VALUE;<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return(rates_total);<br>\u00a0\u00a0\u00a0\u00a0}<br><br>\u00a0\u00a0\u00a0\u00a0ArrayInitialize(SlopeBuffer, EMPTY_VALUE);<br>\u00a0\u00a0\u00a0\u00a0if(BarsCalculated(RsiHandle) &lt; rates_total)<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return(0);<br><br>\u00a0\u00a0\u00a0\u00a0\/\/ Read only completed bars. With series indexing,<br>\u00a0\u00a0\u00a0\u00a0\/\/ RsiValues[0] corresponds to chart shift 1.<br>\u00a0\u00a0\u00a0\u00a0int count = rates_total - 1;<br>\u00a0\u00a0\u00a0\u00a0if(CopyBuffer(RsiHandle, 0, 1, count, RsiValues) != count)<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return(0);<br><br>\u00a0\u00a0\u00a0\u00a0int oldest = rates_total - 1 - RSIPeriod - SlopeBars;<br>\u00a0\u00a0\u00a0\u00a0for(int shift = oldest; shift &gt;= 1; --shift)<br>\u00a0\u00a0\u00a0\u00a0{<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0double recent = RsiValues[shift - 1];<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0double earlier = RsiValues[shift + SlopeBars - 1];<br><br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if(!MathIsValidNumber(recent) || !MathIsValidNumber(earlier))<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0continue;<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if(recent == EMPTY_VALUE || earlier == EMPTY_VALUE ||<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0recent &lt; 0.0 || recent &gt; 100.0 ||<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0earlier &lt; 0.0 || earlier &gt; 100.0)<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0continue;<br><br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0SlopeBuffer[shift] = (recent - earlier) \/ SlopeBars;<br>\u00a0\u00a0\u00a0\u00a0}<br><br>\u00a0\u00a0\u00a0\u00a0\/\/ Shift zero remains empty; no live-bar preview.<br>\u00a0\u00a0\u00a0\u00a0LastBarTime = time[0];<br>\u00a0\u00a0\u00a0\u00a0return(rates_total);<br>}<br><br>void OnDeinit(const int reason)<br>{<br>\u00a0\u00a0\u00a0\u00a0if(RsiHandle != INVALID_HANDLE)<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0IndicatorRelease(RsiHandle);<br>}<\/code><\/pre>\n<p>&#013; <\/p>\n<h2>\u6307\u6807\u53e5\u67c4\u548c\u7f13\u51b2\u533a\u7d22\u5f15\u4e3a\u4ec0\u4e48\u91cd\u8981\uff1f<\/h2>\n<p>MQL5 \u7684 iRSI \u8fd4\u56de\u5185\u7f6e\u6307\u6807\u53e5\u67c4\uff0c\u800c\u4e0d\u662f\u67d0\u6839K\u7ebf\u7684 RSI \u6570\u503c\u3002\u7a0b\u5e8f\u5728 OnInit \u4e2d\u521b\u5efa\u53e5\u67c4\uff0c\u5728\u9000\u51fa\u65f6\u91ca\u653e\u3002BarsCalculated \u7528\u4e8e\u68c0\u67e5\u6e90\u6307\u6807\u8ba1\u7b97\u8fdb\u5ea6\u3002CopyBuffer \u4ece RSI \u76840\u53f7\u7f13\u51b2\u533a\u3001\u56fe\u8868\u7d22\u5f151\u5f00\u59cb\u8bfb\u53d6\u6570\u636e\uff0c\u6545\u610f\u8df3\u8fc7\u672a\u6536\u76d8K\u7ebf\u3002<\/p>\n<p>\u4e34\u65f6\u6570\u7ec4 RsiValues \u91c7\u7528\u65f6\u95f4\u5e8f\u5217\u7d22\u5f15\u3002CopyBuffer \u5728\u7269\u7406\u5185\u5b58\u4e2d\u5c06\u8f83\u65e7\u6570\u636e\u653e\u5728\u524d\u9762\uff0c\u800c\u65f6\u95f4\u5e8f\u5217\u7d22\u5f15\u8bbe\u7f6e\u4f7f\u903b\u8f91\u8bbf\u95ee\u987a\u5e8f\u4ece\u6700\u65b0\u6570\u636e\u5f00\u59cb\u3002\u56e0\u6b64\u4e34\u65f6\u6570\u7ec4 RsiValues[0] \u5bf9\u5e94\u56fe\u8868\u7d22\u5f151\uff0c\u4e0d\u662f\u7d22\u5f150\u3002\u9ed8\u8ba4\u4e09\u4e2a\u95f4\u9694\u7684\u6700\u8fd1\u659c\u7387\u4f7f\u7528 RsiValues[0] \u548c RsiValues[3]\u3002\u660e\u786e\u8fd9\u4e00\u5bf9\u5e94\u5173\u7cfb\u53ef\u4ee5\u907f\u514d\u5e38\u89c1\u7684\u4e00\u4f4d\u7d22\u5f15\u504f\u79fb\u9519\u8bef\u3002\u81ea\u5b9a\u4e49\u6307\u6807\u8f93\u51fa\u7f13\u51b2\u533a\u5219\u76f4\u63a5\u4f7f\u7528\u56fe\u8868\u7d22\u5f15\uff0cEA \u8bfb\u53d6\u8be5\u6307\u68070\u53f7\u7f13\u51b2\u533a\u7684\u7d22\u5f151\u5373\u53ef\u83b7\u53d6\u6700\u8fd1\u5df2\u6536\u76d8\u659c\u7387\u3002<\/p>\n<p>&#013; <\/p>\n<h2>\u5386\u53f2\u6570\u636e\u51c6\u5907\u4e0e\u8ba1\u7b97\u65f6\u673a<\/h2>\n<p>\u9ed8\u8ba4 RSI \u5468\u671f14\u3001\u659c\u7387\u95f4\u96943\u65f6\uff0c\u7a0b\u5e8f\u4fdd\u5b88\u5730\u8981\u6c42\u81f3\u5c1119\u6839\u56fe\u8868K\u7ebf\u624d\u80fd\u8ba1\u7b97\u6700\u8fd1\u7684\u5df2\u6536\u76d8\u7ed3\u679c\uff0c\u5e76\u4fdd\u7559\u6700\u65e9\u7684 RSI \u9884\u70ed\u533a\u4e3a\u7a7a\u503c\u3002\u7a0b\u5e8f\u8981\u6c42 CopyBuffer \u8fd4\u56de\u5b8c\u6574\u7684\u8bf7\u6c42\u6570\u91cf\uff0c\u4e0d\u5728\u90e8\u5206\u6570\u636e\u5230\u8fbe\u65f6\u7ee7\u7eed\u8bbf\u95ee\u672a\u5b8c\u6210\u7684\u6570\u7ec4\u3002\u5bf9\u4e8e\u65e0\u6548\u6570\u503c\u6216\u7f3a\u5931\u6570\u636e\uff0c\u6307\u6807\u8f93\u51fa EMPTY_VALUE\uff0c\u800c\u5408\u6cd5\u7684 RSI \u6781\u503c0\u4e0e100\u4ecd\u7136\u53c2\u4e0e\u8ba1\u7b97\u3002<\/p>\n<p>\u51fa\u73b0\u65b0K\u7ebf\u6216\u8005\u5e73\u53f0\u8981\u6c42\u91cd\u65b0\u8ba1\u7b97\u5386\u53f2\u6570\u636e\u65f6\uff0c\u7a0b\u5e8f\u91cd\u65b0\u6784\u5efa\u5df2\u6536\u76d8\u5386\u53f2\u7ed3\u679c\u3002\u901a\u8fc7\u6bd4\u8f83\u5f53\u524dK\u7ebf\u65f6\u95f4\u4e0e LastBarTime\uff0c\u5373\u4f7f\u56fe\u8868\u8fbe\u5230\u5386\u53f2\u6570\u91cf\u4e0a\u9650\u3001K\u7ebf\u603b\u6570\u4e0d\u53d8\uff0c\u4e5f\u53ef\u4ee5\u8bc6\u522b\u65b0K\u7ebf\u3002\u76f8\u540cK\u7ebf\u5f62\u6210\u671f\u95f4\u7684\u91cd\u590d\u8c03\u7528\u5219\u8df3\u8fc7\u5b8c\u6574\u7f13\u51b2\u533a\u590d\u5236\u3002\u5982\u679c\u590d\u5236\u5931\u8d25\uff0c\u8fd4\u56de0\uff0c\u4f7f\u7ec8\u7aef\u5728\u540e\u7eed\u8ba1\u7b97\u4e8b\u4ef6\u4e2d\u91cd\u65b0\u5c1d\u8bd5\u3002\u672c\u4f8b\u4f18\u5148\u4fdd\u8bc1\u7d22\u5f15\u903b\u8f91\u6e05\u6670\uff0c\u5386\u53f2\u6570\u636e\u975e\u5e38\u591a\u6216\u540c\u65f6\u52a0\u8f7d\u5927\u91cf\u54c1\u79cd\u65f6\uff0c\u5b8c\u6574\u590d\u5236\u7684\u6027\u80fd\u6210\u672c\u53ef\u80fd\u8f83\u9ad8\u3002\u66f4\u9ad8\u6548\u7684\u7248\u672c\u53ef\u4ee5\u5728\u6b63\u5e38\u66f4\u65b0\u65f6\u4ec5\u590d\u5236\u5fc5\u8981\u7684\u8fd1\u671f\u6570\u636e\uff0c\u800c\u5728\u5386\u53f2\u91cd\u7f6e\u65f6\u4fdd\u7559\u5b8c\u6574\u91cd\u7b97\u903b\u8f91\u3002<\/p>\n<p>&#013; <\/p>\n<h2>\u5b89\u88c5\u4e0e\u53c2\u6570\u8bbe\u7f6e<\/h2>\n<ol>\n<li>\u6253\u5f00 MT5\uff0c\u8fdb\u5165 File \u2192 Open Data Folder\uff0c\u627e\u5230 MQL5\/Indicators \u76ee\u5f55\u3002<\/li>\n<li>\u5728 MetaEditor \u4e2d\u521b\u5efa PS_Closed_RSI_Slope.mq5 \u6587\u4ef6\uff0c\u7c98\u8d34\u5b8c\u6574\u4ee3\u7801\u5e76\u7f16\u8bd1\u3002<\/li>\n<li>\u68c0\u67e5\u7f16\u8bd1\u4fe1\u606f\uff0c\u5fc5\u8981\u65f6\u5237\u65b0 Navigator\uff0c\u518d\u5c06\u6307\u6807\u6dfb\u52a0\u5230\u56fe\u8868\u3002<\/li>\n<li>\u52a0\u8f7d\u6807\u51c6 RSI \u6307\u6807\uff0c\u8bbe\u4e3a14\u5468\u671f\u3001\u6536\u76d8\u4ef7\u8ba1\u7b97\uff0c\u5e76\u4f7f\u7528 Data Window \u67e5\u770b\u76f8\u540c\u5df2\u6536\u76d8K\u7ebf\u7684\u8bfb\u6570\u3002<\/li>\n<li>\u5148\u4ee5\u9ed8\u8ba4\u53c2\u6570\u9a8c\u8bc1\u516c\u5f0f\uff0c\u518d\u6839\u636e\u7814\u7a76\u76ee\u7684\u8c03\u6574\u5468\u671f\u548c\u95f4\u9694\u3002<\/li>\n<\/ol>\n<p>&#013; <\/p>\n<table border=\"1\" cellpadding=\"7\" style=\"border-collapse:collapse;width:100%\">\n<tr>\n<th>\u53c2\u6570<\/th>\n<th>\u9ed8\u8ba4\u503c<\/th>\n<th>\u5f71\u54cd<\/th>\n<\/tr>\n<tr>\n<td>RSIPeriod<\/td>\n<td>14<\/td>\n<td>\u8f83\u77ed\u5468\u671f\u5bf9\u8fd1\u671f\u4ef7\u683c\u53d8\u5316\u66f4\u654f\u611f\uff0c\u8f83\u957f\u5468\u671f\u901a\u5e38\u4f7f\u632f\u8361\u6307\u6807\u66f4\u5e73\u6ed1\u3002<\/td>\n<\/tr>\n<tr>\n<td>SlopeBars<\/td>\n<td>3<\/td>\n<td>\u8f83\u77ed\u95f4\u9694\u5f3a\u8c03\u8fd1\u671f\u53d8\u5316\uff0c\u8f83\u957f\u95f4\u9694\u8861\u91cf\u66f4\u957f\u65f6\u95f4\u5185\u7684\u51c0\u53d8\u5316\uff0c\u4e5f\u53ef\u80fd\u63a9\u76d6\u4e2d\u95f4\u53cd\u8f6c\u3002<\/td>\n<\/tr>\n<\/table>\n<p>\u4e09\u4e2a5\u5206\u949fK\u7ebf\u4e0e\u4e09\u4e2a\u65e5\u7ebfK\u7ebf\u7684\u65f6\u95f4\u8de8\u5ea6\u4e0d\u540c\uff0c\u867d\u7136\u5355\u4f4d\u90fd\u662f\u6bcf\u6839K\u7ebf\uff0c\u4f46\u4e0d\u80fd\u76f4\u63a5\u5f53\u4f5c\u6bcf\u5206\u949f\u6216\u6bcf\u5929\u7684\u53d8\u5316\u901f\u5ea6\u6bd4\u8f83\u3002\u7531\u4e8e RSI \u6570\u503c\u5904\u4e8e0\u81f3100\u4e4b\u95f4\uff0c\u659c\u7387\u7406\u8bba\u8303\u56f4\u4e3a\u2212100\/N\u81f3+100\/N\u3002\u5b9e\u9645\u8bfb\u6570\u5206\u5e03\u540c\u65f6\u53d7\u5230 RSI \u5468\u671f\u53ca\u659c\u7387\u95f4\u9694\u5f71\u54cd\u3002<\/p>\n<p>&#013; <\/p>\n<h2>\u9a8c\u8bc1\u6e05\u5355\u4e0e\u98ce\u9669\u8bf4\u660e<\/h2>\n<ul>\n<li>\u786e\u8ba4\u7d22\u5f150\u4e3a\u7a7a\u503c\uff0c\u6700\u65b0\u76f4\u65b9\u56fe\u7ed8\u5236\u5728\u7d22\u5f151\u3002<\/li>\n<li>\u4f7f\u7528\u6807\u51c6 RSI \u7684\u7d22\u5f151\u548c4\u8bfb\u6570\uff0c\u624b\u5de5\u6838\u5bf9\u9ed8\u8ba4\u7ed3\u679c\u3002<\/li>\n<li>\u5206\u522b\u6d4b\u8bd5\u7aef\u70b9\u76f8\u540c\u3001\u4e0a\u5347\u548c\u4e0b\u964d\u7684\u60c5\u51b5\u3002<\/li>\n<li>\u5c06 SlopeBars \u8bbe\u4e3a1\uff0c\u786e\u8ba4\u7ed3\u679c\u4e3a\u76f8\u90bb\u5df2\u6536\u76d8 RSI \u7684\u5dee\u503c\u3002<\/li>\n<li>\u5237\u65b0\u5386\u53f2\u884c\u60c5\uff0c\u9a8c\u8bc1\u5386\u53f2\u91cd\u5efa\u884c\u4e3a\uff0c\u800c\u4e0d\u662f\u7ee7\u7eed\u4f7f\u7528\u8fc7\u671f\u7ed3\u679c\u3002<\/li>\n<li>\u68c0\u67e5\u5386\u53f2\u52a0\u8f7d\u9636\u6bb5\uff0c\u786e\u4fdd\u7f3a\u5931\u6570\u636e\u4e0d\u4f1a\u88ab\u89e3\u91ca\u4e3a\u96f6\u659c\u7387\u3002<\/li>\n<\/ul>\n<p>\u672c\u6587\u5df2\u67e5\u9605 MQL5 \u5b98\u65b9\u53c2\u8003\u6587\u6863\u4e2d iRSI\u3001CopyBuffer \u4e0e BarsCalculated \u7684\u63a5\u53e3\u5b9a\u4e49\uff0c\u4f46\u5c1a\u672a\u5728\u5b9e\u9645 MT5 \u7ec8\u7aef\u7f16\u8bd1\u6216\u5b9e\u76d8\u6d4b\u8bd5\u3002\u4f7f\u7528\u524d\u8bf7\u901a\u8fc7\u81ea\u5df1\u7684\u7ec8\u7aef\u7248\u672c\u8fdb\u884c\u9a8c\u8bc1\u3002\u4ec5\u91c7\u7528\u5df2\u6536\u76d8K\u7ebf\u80fd\u591f\u907f\u514d\u4e00\u822c\u76d8\u4e2d\u6ce2\u52a8\u9020\u6210\u7684\u53d8\u5316\uff0c\u4f46\u65e0\u6cd5\u907f\u514d\u5386\u53f2\u884c\u60c5\u4fee\u8ba2\u3002RSI \u659c\u7387\u4e0d\u4ee3\u8868\u672a\u6765\u4ef7\u683c\u6536\u76ca\uff0c\u672c\u4f8b\u4e5f\u6ca1\u6709\u4e0b\u5355\u903b\u8f91\u3001\u70b9\u5dee\u8fc7\u6ee4\u6216\u4ed3\u4f4d\u7ba1\u7406\u3002\u672c\u6587\u4ec5\u7528\u4e8e\u6280\u672f\u5206\u6790\u548c\u7f16\u7a0b\u6559\u80b2\uff0c\u4e0d\u6784\u6210\u6295\u8d44\u5efa\u8bae\uff0c\u4ea4\u6613\u53ef\u80fd\u4ea7\u751f\u4e8f\u635f\u3002<\/p>\n<p>\u5982\u679c\u60a8\u5bf9\u8fd9\u4e2a\u514d\u8d39\u6307\u6807\u611f\u5174\u8da3\uff0c\u5e0c\u671b\u589e\u52a0\u7ebf\u6027\u56de\u5f52\u659c\u7387\u3001\u5f69\u8272\u52a8\u80fd\u533a\u95f4\u6216 EA \u96c6\u6210\uff0c\u6b22\u8fce\u8054\u7cfb\u6211\u4eec\u7684<a href=\"https:\/\/www.patternsmart.com\/cn\/custom\/\">\u4ea4\u6613\u8f6f\u4ef6\u5b9a\u5236\u5f00\u53d1\u670d\u52a1<\/a>\u3002<\/p>\n<\/p><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4ea4\u6613\u8fdb\u9636\u6559\u7a0b | MT5 | MQL5 \u81ea\u5b9a\u4e49\u6307\u6807 \u76f8\u5bf9\u5f3a\u5f31\u6307\u6807 RSI \u901a\u5e38\u7528\u4e8e\u89c2\u5bdf\u5f53\u524d\u8bfb\u6570\u662f\u5426\u9ad8\u4e8e\u6216\u4f4e\u4e8e\u67d0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2671,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_seo_schema_type":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"fifu_image_url":"","fifu_image_alt":"","_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[364,233,217],"tags":[97,599,428],"class_list":["post-2670","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mt5","category-233","category-217","tag-rsi","tag-599","tag-mt5"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/www.patternsmart.com\/cn\/wp-content\/uploads\/2026\/11\/PS_MT5_RSISlope_CN_Fig1.png","_links":{"self":[{"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/posts\/2670","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/comments?post=2670"}],"version-history":[{"count":0,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/posts\/2670\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/media\/2671"}],"wp:attachment":[{"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/media?parent=2670"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/categories?post=2670"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/tags?post=2670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}