{"id":3171,"date":"2026-12-05T11:03:33","date_gmt":"2026-12-05T17:03:33","guid":{"rendered":"https:\/\/www.patternsmart.com\/cn\/?p=3171"},"modified":"2026-12-05T17:07:51","modified_gmt":"2026-12-05T17:07:51","slug":"mt4%e5%9f%ba%e4%ba%8e%e5%89%8d%e4%b8%80%e6%a0%b9atr%e7%9a%84%e6%94%b6%e7%9b%98%e5%ae%9e%e4%bd%93%e5%bc%ba%e5%ba%a6%e6%9f%b1%e7%8a%b6%e5%9b%be","status":"publish","type":"post","link":"https:\/\/www.patternsmart.com\/cn\/mt4%e5%9f%ba%e4%ba%8e%e5%89%8d%e4%b8%80%e6%a0%b9atr%e7%9a%84%e6%94%b6%e7%9b%98%e5%ae%9e%e4%bd%93%e5%bc%ba%e5%ba%a6%e6%9f%b1%e7%8a%b6%e5%9b%be\/","title":{"rendered":"MT4\u57fa\u4e8e\u524d\u4e00\u6839ATR\u7684\u6536\u76d8\u5b9e\u4f53\u5f3a\u5ea6\u67f1\u72b6\u56fe"},"content":{"rendered":"<div class=\"postie-post\">\n<h1>MT4\u57fa\u4e8e\u524d\u4e00\u6839ATR\u7684\u6536\u76d8\u5b9e\u4f53\u5f3a\u5ea6\u67f1\u72b6\u56fe<\/h1>\n<p>\u9ad8\u7ea7\u4ea4\u6613\u6559\u7a0b<\/p>\n<p>\u540c\u6837\u5927\u5c0f\u7684K\u7ebf\u5b9e\u4f53\uff0c\u5728\u5e73\u9759\u884c\u60c5\u4e2d\u53ef\u80fd\u5341\u5206\u7a81\u51fa\uff0c\u5728\u9ad8\u6ce2\u52a8\u884c\u60c5\u4e2d\u5374\u5f88\u666e\u901a\u3002\u5982\u4f55\u5229\u7528K\u7ebf\u5f62\u6210\u4e4b\u524d\u7684\u6ce2\u52a8\u7387\u8861\u91cf\u5b9e\u4f53\u5f3a\u5ea6\uff0c\u540c\u65f6\u907f\u514d\u672a\u6536\u76d8\u4fe1\u53f7\u5e72\u6270\u5224\u65ad\uff1f<\/p>\n<h2>\u8bfb\u5b8c\u672c\u6587\uff0c\u4f60\u5c06\u638c\u63e1<\/h2>\n<ul>\n<li>\u5229\u7528\u524d\u4e00\u6839ATR\u6807\u51c6\u5316\u5e26\u65b9\u5411\u7684K\u7ebf\u5b9e\u4f53\u3002<\/li>\n<li>\u7406\u89e3\u6b63\u8d1f\u5f3a\u5ea6\u53ca\u53c2\u8003\u9608\u503c\u3002<\/li>\n<li>\u5728MQL4\u4e2d\u5b9e\u73b0\u6536\u76d8\u786e\u8ba4\u548c\u5b89\u5168\u7684\u5386\u53f2\u7d22\u5f15\u3002<\/li>\n<li>\u5b89\u88c5\u6307\u6807\u5e76\u901a\u8fc7\u624b\u5de5\u8ba1\u7b97\u9a8c\u8bc1\u7ed3\u679c\u3002<\/li>\n<\/ul>\n<h2>\u8ba1\u7b97\u539f\u7406<\/h2>\n<p>\u7528\u6536\u76d8\u4ef7\u51cf\u53bb\u5f00\u76d8\u4ef7\uff0c\u518d\u9664\u4ee5\u524d\u4e00\u6839\u5df2\u5b8c\u6210K\u7ebf\u7684ATR\uff0c\u9ed8\u8ba4\u5468\u671f\u4e3a14\u3002\u7ed3\u679c\u6ca1\u6709\u4ef7\u683c\u5355\u4f4d\uff0c\u6b63\u503c\u8868\u793a\u9633\u7ebf\u5b9e\u4f53\uff0c\u8d1f\u503c\u8868\u793a\u9634\u7ebf\u5b9e\u4f53\u3002\u6b63\u8d1f1\u53c2\u8003\u7ebf\u4ee3\u8868\u5b9e\u4f53\u5927\u5c0f\u7b49\u4e8e\u6b64\u524d\u4e00\u4e2aATR\uff0c\u5e76\u975e\u4ea4\u6613\u4fe1\u53f7\u3002\u91c7\u7528\u524d\u4e00\u6839ATR\u53ef\u4ee5\u907f\u514d\u5f53\u524d\u88ab\u6d4bK\u7ebf\u540c\u65f6\u62ac\u9ad8\u5206\u6bcd\u3002<\/p>\n<h2>\u8ba1\u7b97\u793a\u4f8b<\/h2>\n<p>\u5047\u8bbe\u524d\u4e00\u6839ATR\u4e3a0.50\uff0c\u5f00\u76d8100.00\uff0c\u6536\u76d8100.60\uff0c\u5f3a\u5ea6\u4e3a+1.20\u3002\u5982\u679c\u5f00\u76d8100.00\uff0c\u6536\u76d899.30\uff0cATR\u4e0d\u53d8\uff0c\u5219\u5f3a\u5ea6\u4e3a-1.40\u3002\u5341\u5b57\u661f\u5373\u4f7f\u5f71\u7ebf\u5f88\u957f\uff0c\u5b9e\u4f53\u5f3a\u5ea6\u4ecd\u4e3a\u96f6\u3002<\/p>\n<p> <img decoding=\"async\" alt=\"atr-body.png\" src=\"https:\/\/www.patternsmart.com\/cn\/wp-content\/uploads\/2026\/12\/atr-body.png\" width=\"640\"><\/p>\n<p>\u56fe\u793a\uff1a\u4ece\u5de6\u81f3\u53f3\u7684\u5047\u8bbe\u5f3a\u5ea6\u4e3a0.2\u30010.7\u30011.2\u30010.4\u3001-0.3\u3001-1.4\u3001-0.6\u30010.8\u3002\u4e2d\u592e\u4e3a\u96f6\u7ebf\uff0c\u7eff\u8272\u548c\u7ea2\u8272\u6c34\u5e73\u7ebf\u5206\u522b\u4e3a+1\u548c-1\u3002\u793a\u610f\u56fe\u989c\u8272\u7528\u4e8e\u533a\u5206\u8d8a\u8fc7\u9608\u503c\u7684\u67f1\u4f53\uff0c\u5b9e\u9645\u6e90\u7801\u91c7\u7528\u5355\u4e00\u84dd\u8272\u67f1\u72b6\u56fe\u3002<\/p>\n<h2>\u5b8c\u6574MQL4\u6e90\u7801<\/h2>\n<pre style=\"white-space:pre;font-family:Consolas,Monaco,monospace\"><code>#property strict<br>#property indicator_separate_window<br>#property indicator_buffers 1<br>#property indicator_color1 SteelBlue<br>#property indicator_level1 1.0<br>#property indicator_level2 -1.0<br>input int Period=14;<br>double Score[];<br>int OnInit()<br>{<br>\u00a0\u00a0\u00a0if(Period&lt;2) return(INIT_PARAMETERS_INCORRECT);<br>\u00a0\u00a0\u00a0SetIndexBuffer(0,Score);<br>\u00a0\u00a0\u00a0ArraySetAsSeries(Score,true);<br>\u00a0\u00a0\u00a0SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,3);<br>\u00a0\u00a0\u00a0SetIndexEmptyValue(0,EMPTY_VALUE);<br>\u00a0\u00a0\u00a0IndicatorShortName(&quot;Closed ATR Body Score&quot;);<br>\u00a0\u00a0\u00a0return(INIT_SUCCEEDED);<br>}<br>int OnCalculate(const int rates_total,const int prev_calculated,<br>\u00a0const datetime &amp;time[],const double &amp;open[],const double &amp;high[],<br>\u00a0const double &amp;low[],const double &amp;close[],const long &amp;tick_volume[],<br>\u00a0const long &amp;volume[],const int &amp;spread[])<br>{<br>\u00a0\u00a0\u00a0ArraySetAsSeries(open,true);<br>\u00a0\u00a0\u00a0ArraySetAsSeries(close,true);<br>\u00a0\u00a0\u00a0\/\/ Rebuild on history changes; never publish the live bar.<br>\u00a0\u00a0\u00a0ArrayInitialize(Score,EMPTY_VALUE);<br>\u00a0\u00a0\u00a0for(int i=rates_total-Period-2;i&gt;=1;i--)<br>\u00a0\u00a0\u00a0{<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ Reference ATR ends before the measured candle.<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0double atr=iATR(NULL,0,Period,i+1);<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if(atr&gt;0) Score[i]=(close[i]-open[i])\/atr;<br>\u00a0\u00a0\u00a0}<br>\u00a0\u00a0\u00a0return(rates_total);<br>}<\/code><\/pre>\n<h2>\u5b9e\u73b0\u7ec6\u8282<\/h2>\n<p>MT4\u65f6\u95f4\u5e8f\u5217\u7d22\u5f150\u4ee3\u8868\u6700\u65b0K\u7ebf\u3002\u5faa\u73af\u5728\u7d22\u5f151\u505c\u6b62\uff0c\u4e0d\u663e\u793a\u6b63\u5728\u5f62\u6210\u7684K\u7ebf\u3002ATR\u8c03\u7528\u4f7f\u7528i+1\u800c\u975ei\u3002\u6700\u65e9\u8ba1\u7b97\u4f4d\u7f6e\u91c7\u7528\u4fdd\u5b88\u8fb9\u754c\uff0c\u4e3aATR\u53ca\u6b64\u524d\u6536\u76d8\u4ef7\u9884\u7559\u5386\u53f2\u6570\u636e\u3002\u5386\u53f2\u4e0d\u8db3\u6216ATR\u4e3a\u96f6\u65f6\u4e0d\u7ed8\u5236\u3002\u6b64\u53c2\u8003\u5b9e\u73b0\u6bcf\u6b21\u91cd\u65b0\u8ba1\u7b97\u7f13\u51b2\u533a\uff0c\u4fbf\u4e8e\u7406\u89e3\uff0c\u4f46\u957f\u5386\u53f2\u53ef\u80fd\u5e26\u6765\u989d\u5916\u5f00\u9500\u3002\u751f\u4ea7\u7248\u672c\u53ef\u5229\u7528prev_calculated\u589e\u91cf\u8ba1\u7b97\uff0c\u540c\u65f6\u6b63\u786e\u5904\u7406\u5386\u53f2\u5237\u65b0\u548c\u65b0K\u7ebf\u3002<\/p>\n<h2>\u5b89\u88c5\u4e0e\u6d4b\u8bd5<\/h2>\n<p>\u5728MT4\u9009\u62e9\u6587\u4ef6\u3001\u6253\u5f00\u6570\u636e\u6587\u4ef6\u5939\uff0c\u8fdb\u5165MQL4\/Indicators\u3002\u4f7f\u7528MetaEditor\u65b0\u5efaMQ4\u6587\u4ef6\uff0c\u7c98\u8d34\u6e90\u7801\u5e76\u7f16\u8bd1\uff0c\u68c0\u67e5\u8bca\u65ad\u4fe1\u606f\u3002\u5237\u65b0\u5bfc\u822a\u5668\u540e\u52a0\u8f7d\u6307\u6807\u3002\u5728\u6570\u636e\u7a97\u53e3\u8bfb\u53d6\u5df2\u6536\u76d8K\u7ebf\u6570\u503c\uff0c\u5bf9\u7167\u5185\u7f6eATR\u524d\u4e00\u6839\u6570\u503c\u8fdb\u884c\u624b\u5de5\u8ba1\u7b97\u3002\u5c06\u5468\u671f\u4ece14\u6539\u4e3a28\u518d\u6b21\u9a8c\u8bc1\u3002\u89c2\u5bdf\u5b9e\u65f6K\u7ebf\uff0c\u7d22\u5f150\u4e0d\u5e94\u663e\u793a\u67f1\u4f53\uff1b\u4e0b\u4e00\u6839K\u7ebf\u5f00\u59cb\u540e\uff0c\u4e0a\u4e00\u6839\u624d\u5177\u5907\u8ba1\u7b97\u6761\u4ef6\u3002\u8fd8\u5e94\u6d4b\u8bd5\u5e73\u76d8\u3001\u8df3\u7a7a\u3001\u5386\u53f2\u4e0d\u8db3\u53ca\u5468\u671f\u5207\u6362\u3002\u672c\u6587\u6e90\u7801\u5c1a\u672a\u5b9e\u9645\u7f16\u8bd1\u6216\u8fd0\u884c\u6d4b\u8bd5\u3002<\/p>\n<h2>\u5e94\u7528\u4e0e\u5c40\u9650<\/h2>\n<p>\u8f83\u5927\u7684\u5b9e\u4f53\u5f3a\u5ea6\u63cf\u8ff0\u76f8\u5bf9\u4e8e\u8fd1\u671f\u6ce2\u52a8\u7387\u7684\u65b9\u5411\u6027\u53d8\u5316\uff0c\u5e76\u4e0d\u4ee3\u8868\u8d8b\u52bf\u5ef6\u7eed\u6982\u7387\u3002\u5206\u5b50\u4e0d\u76f4\u63a5\u8861\u91cf\u8df3\u7a7a\u3001\u5f71\u7ebf\u548c\u6d41\u52a8\u6027\u3002ATR\u53ef\u80fd\u6ede\u540e\u4e8e\u7a81\u7136\u53d8\u5316\u7684\u6ce2\u52a8\u7387\uff0c\u4e0d\u540c\u7ecf\u7eaa\u5546\u53ca\u4ea4\u6613\u65f6\u6bb5\u4e5f\u4f1a\u4ea7\u751f\u4e0d\u540c\u6570\u636e\u3002\u6536\u76d8\u786e\u8ba4\u907f\u514d\u901a\u5e38\u7684\u76d8\u4e2d\u91cd\u7ed8\uff0c\u4f46\u5386\u53f2\u6570\u636e\u4fee\u8ba2\u6216\u53c2\u6570\u53d8\u5316\u4ecd\u53ef\u80fd\u6539\u53d8\u5386\u53f2\u7ed3\u679c\u3002\u4e0d\u8981\u5c06\u8d8a\u8fc7\u53c2\u8003\u7ebf\u76f4\u63a5\u7b49\u540c\u4e8e\u4e70\u5356\u4fe1\u53f7\uff0c\u5e94\u6bd4\u8f83\u4e0d\u540c\u54c1\u79cd\u548c\u65f6\u6bb5\u7684\u5206\u5e03\u3002<\/p>\n<p>\u5982\u9700\u5b9a\u5236\u9608\u503c\u63d0\u9192\u6216\u591a\u5468\u671f\u529f\u80fd\uff0c\u53ef\u4e86\u89e3<a href=\"https:\/\/www.patternsmart.com\/cn\/custom\/\">MT4\u6307\u6807\u5b9a\u5236\u5f00\u53d1\u670d\u52a1<\/a>\u3002<\/p>\n<p>\u98ce\u9669\u63d0\u793a\uff1a\u672c\u6587\u4ec5\u7528\u4e8e\u6280\u672f\u6559\u80b2\uff0c\u4ea4\u6613\u5b58\u5728\u4e8f\u635f\u98ce\u9669\uff0c\u4f7f\u7528\u524d\u5e94\u72ec\u7acb\u9a8c\u8bc1\u3002<\/p>\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>MT4\u57fa\u4e8e\u524d\u4e00\u6839ATR\u7684\u6536\u76d8\u5b9e\u4f53\u5f3a\u5ea6\u67f1\u72b6\u56fe \u9ad8\u7ea7\u4ea4\u6613\u6559\u7a0b \u540c\u6837\u5927\u5c0f\u7684K\u7ebf\u5b9e\u4f53\uff0c\u5728\u5e73\u9759\u884c\u60c5\u4e2d\u53ef\u80fd\u5341\u5206\u7a81\u51fa\uff0c\u5728\u9ad8\u6ce2 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3172,"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":[167,233,217],"tags":[102,425,464],"class_list":["post-3171","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mt4","category-233","category-217","tag-atr","tag-mt4","tag-464"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/www.patternsmart.com\/cn\/wp-content\/uploads\/2026\/12\/atr-body.png","_links":{"self":[{"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/posts\/3171","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=3171"}],"version-history":[{"count":0,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/posts\/3171\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/media\/3172"}],"wp:attachment":[{"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/media?parent=3171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/categories?post=3171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/tags?post=3171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}