{"id":2711,"date":"2026-11-26T11:16:27","date_gmt":"2026-11-26T17:16:27","guid":{"rendered":"https:\/\/www.patternsmart.com\/cn\/?p=2711"},"modified":"2026-11-26T17:27:40","modified_gmt":"2026-11-26T17:27:40","slug":"mt4-ea-%e5%a6%82%e4%bd%95%e6%a3%80%e6%9f%a5%e7%a7%bb%e5%8a%a8%e6%ad%a2%e6%8d%9f%e4%bf%ae%e6%94%b9%e7%9a%84%e7%bb%8f%e7%ba%aa%e5%95%86%e8%b7%9d%e7%a6%bb%e9%99%90%e5%88%b6","status":"publish","type":"post","link":"https:\/\/www.patternsmart.com\/cn\/mt4-ea-%e5%a6%82%e4%bd%95%e6%a3%80%e6%9f%a5%e7%a7%bb%e5%8a%a8%e6%ad%a2%e6%8d%9f%e4%bf%ae%e6%94%b9%e7%9a%84%e7%bb%8f%e7%ba%aa%e5%95%86%e8%b7%9d%e7%a6%bb%e9%99%90%e5%88%b6\/","title":{"rendered":"MT4 EA \u5982\u4f55\u68c0\u67e5\u79fb\u52a8\u6b62\u635f\u4fee\u6539\u7684\u7ecf\u7eaa\u5546\u8ddd\u79bb\u9650\u5236"},"content":{"rendered":"<div class=\"postie-post\">\n<p>\u79fb\u52a8\u6b62\u635f\u8ba1\u7b97\u51fa\u7684\u4ef7\u683c\u5373\u4f7f\u6570\u5b66\u4e0a\u5408\u7406\uff0c\u7ecf\u7eaa\u5546\u4e5f\u53ef\u80fd\u62d2\u7edd\u4fee\u6539\u3002MT4\u7684\u6b62\u635f\u8ddd\u79bb\u4e0e\u51bb\u7ed3\u8ddd\u79bb\u4ee5Point\u4e3a\u5355\u4f4d\uff0c\u4e0d\u80fd\u6df7\u540c\u4e8epip\u3002\u53ef\u9760\u7684EA\u5e94\u5c06\u5019\u9009\u6b62\u635f\u3001\u8d44\u683c\u68c0\u67e5\u53ca\u5b9e\u9645\u4fee\u6539\u5206\u79bb\u3002<\/p>\n<h2>\u5b9e\u4f8b\uff1a\u4e94\u4f4dEURUSD\u62a5\u4ef7<\/h2>\n<p>\u5047\u8bbeBid=1.10500\uff0cPoint=0.00001\uff0c\u6700\u5c0f\u6b62\u635f\u8ddd\u79bb30\u70b9\uff0c\u51bb\u7ed3\u8ddd\u79bb20\u70b9\uff0c\u73b0\u6709\u591a\u5934\u6b62\u635f1.10400\u3002\u5019\u90091.10490\u76f8\u8ddd10\u70b9\uff0c\u4e0d\u901a\u8fc7\uff1b1.10470\u6070\u597d\u76f8\u8ddd30\u70b9\uff0c\u8fb9\u754c\u53ef\u80fd\u53d7\u6d6e\u70b9\u8868\u793a\u6216\u62a5\u4ef7\u53d8\u5316\u5f71\u54cd\uff1b1.10450\u76f8\u8ddd50\u70b9\uff0c\u65e2\u6536\u7d27\u539f\u6b62\u635f\u4e5f\u7b26\u5408\u540d\u4e49\u8ddd\u79bb\u9650\u5236\u3002<\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/www.patternsmart.com\/cn\/wp-content\/uploads\/2026\/11\/PS_StopModify_CN_Fig1.png\" alt=\"PS_StopModify_CN_Fig1.png\" title=\"\u540d\u4e49\u6700\u5c0f\u8ddd\u79bb30\u70b9\uff0c50\u70b9\u7b26\u5408\u521d\u7b5b\uff0c\u4ecd\u987b\u9075\u5b88\u670d\u52a1\u5668\u9650\u5236\u3002\" width=\"960\" height=\"420\" style=\"max-width:100%;height:auto\"><figcaption>\u540d\u4e49\u6700\u5c0f\u8ddd\u79bb30\u70b9\uff0c50\u70b9\u7b26\u5408\u521d\u7b5b\uff0c\u4ecd\u987b\u9075\u5b88\u670d\u52a1\u5668\u9650\u5236\u3002<\/figcaption><\/figure>\n<h2>OrderModify\u524d\u68c0\u67e5<\/h2>\n<p>\u4ee5\u4e0b\u793a\u4f8b\u7247\u6bb5\u653e\u5728OnTick\u4e2d\uff0c\u5728\u6309\u8ba2\u5355\u53f7\u9009\u5b9a\u76ee\u6807\u5e02\u4ef7\u4e70\u5355\u5e76\u68c0\u67e5\u54c1\u79cd\u548cMagic Number\u4e4b\u540e\u6267\u884c\u3002candidateSL\u7531\u79fb\u52a8\u6b62\u635f\u8ba1\u7b97\u63d0\u4f9b\u3002\u7247\u6bb5\u4e0d\u5904\u7406\u5176\u4ed6\u54c1\u79cd\u6216\u7a7a\u5934\u3002<\/p>\n<pre style=\"white-space:pre;font-family:Consolas,Monaco,monospace\"><code>\/\/ Selected BUY order on current chart symbol only<br>RefreshRates();<br>double pt = MarketInfo(Symbol(), MODE_POINT);<br>int digits = (int)MarketInfo(Symbol(), MODE_DIGITS);<br>double sl = NormalizeDouble(candidateSL, digits);<br>double distance = (Bid - sl) \/ pt;<br>double minStop = MarketInfo(Symbol(), MODE_STOPLEVEL);<br>double freeze = MarketInfo(Symbol(), MODE_FREEZELEVEL);<br>if (sl &gt; OrderStopLoss() &amp;&amp; sl &lt; Bid &amp;&amp;<br>\u00a0\u00a0\u00a0\u00a0distance &gt;= minStop &amp;&amp; distance &gt; freeze)<br>{<br>\u00a0\u00a0\u00a0\u00a0ResetLastError();<br>\u00a0\u00a0\u00a0\u00a0if (!OrderModify(OrderTicket(), OrderOpenPrice(), sl,<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OrderTakeProfit(), 0, clrNONE))<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Print(&quot;Modify failed: &quot;, GetLastError());<br>}<\/code><\/pre>\n<p>\u7a7a\u5934\u5e94\u4f7f\u7528Ask\u8ba1\u7b97\u4e0e\u5019\u9009\u6b62\u635f\u7684\u8ddd\u79bb\uff0c\u8981\u6c42\u6b62\u635f\u5411\u4e0b\u6536\u7d27\uff0c\u5e76\u5355\u72ec\u5904\u7406\u539f\u6b62\u635f\u4e3a\u96f6\u7684\u60c5\u51b5\u3002\u4ec5\u6309\u5c0f\u6570\u4f4d\u6570\u89c4\u8303\u5316\u53ef\u80fd\u4e0d\u7b26\u5408\u67d0\u4e9b\u54c1\u79cd\u7684\u5b9e\u9645Tick\u4ef7\u683c\u7f51\u683c\uff0c\u8fd8\u9700\u9a8c\u8bc1Tick\u5927\u5c0f\u3002MODE_STOPLEVEL\u4e3a\u96f6\u4e5f\u53ef\u80fd\u4ee3\u8868\u52a8\u6001\u670d\u52a1\u5668\u9650\u5236\u3002\u51bb\u7ed3\u89c4\u5219\u8fd8\u53ef\u80fd\u5f71\u54cd\u5176\u4ed6\u8ba2\u5355\u4ef7\u683c\u6216\u64cd\u4f5c\uff0c\u6b64\u68c0\u67e5\u5e76\u975e\u5b8c\u6574\u7684\u670d\u52a1\u5668\u8d44\u683c\u9a8c\u8bc1\u3002<\/p>\n<h2>\u8fd0\u884c\u9a8c\u8bc1<\/h2>\n<ol>\n<li>\u4ec5\u5f53\u6b62\u635f\u6536\u7d27\u8fbe\u5230\u6709\u6548\u589e\u91cf\u65f6\u4fee\u6539\uff0c\u907f\u514d\u5bf9\u8fd1\u4e4e\u4e0d\u53d8\u7684\u4ef7\u683c\u53cd\u590d\u53d1\u9001\u8bf7\u6c42\u3002<\/li>\n<li>\u8bb0\u5f55\u65e7\u6b62\u635f\u3001\u5019\u9009\u6b62\u635f\u3001Bid\/Ask\u3001\u6b62\u635f\u53ca\u51bb\u7ed3\u8ddd\u79bb\u3001\u8ba2\u5355\u53f7\u4e0e\u9519\u8bef\u7801\u3002<\/li>\n<li>\u9047\u5230\u65e0\u6548\u6b62\u635f\u6216\u62d2\u7edd\u4fee\u6539\u7b49\u9519\u8bef\uff0c\u5237\u65b0\u62a5\u4ef7\u5e76\u5728\u540e\u7eed\u5408\u9002Tick\u91cd\u65b0\u5224\u65ad\uff0c\u4e0d\u8981\u4e3a\u4e86\u5f3a\u884c\u6210\u529f\u800c\u6697\u4e2d\u653e\u5bbd\u4fdd\u62a4\u6b62\u635f\u3002<\/li>\n<li>\u5728\u6a21\u62df\u8d26\u6237\u6d4b\u8bd5\u8fb9\u754c\u3001\u70b9\u5dee\u3001\u8df3\u7a7a\u53ca\u52a8\u6001\u9650\u5236\u3002\u5386\u53f2\u6d4b\u8bd5\u53ef\u80fd\u65e0\u6cd5\u91cd\u73b0\u670d\u52a1\u5668\u62d2\u7edd\u884c\u4e3a\u3002<\/li>\n<\/ol>\n<p>\u5b98\u65b9\u53c2\u8003\uff1a<a href=\"https:\/\/docs.mql4.com\/constants\/environment_state\/marketinfoconstants\">MQL4 symbol properties<\/a>\u3002<\/p>\n<p>\u4ee5\u4e0a\u4e3a\u5047\u8bbe\u6027\u6559\u5b66\u793a\u4f8b\uff0c\u672a\u8fdb\u884c\u7f16\u8bd1\u6216\u56de\u6d4b\u3002\u4ea4\u6613\u5b58\u5728\u4e8f\u635f\u98ce\u9669\uff0c\u6a21\u62df\u8868\u73b0\u4e0d\u4ee3\u8868\u672a\u6765\u7ed3\u679c\u3002<\/p>\n<p>\u5982\u9700\u5c06\u6b64\u514d\u8d39\u7b56\u7565\u601d\u8def\u6269\u5c55\u4e3a\u81ea\u5df1\u7684\u4ea4\u6613\u7a0b\u5e8f\uff0c\u6b22\u8fce\u8054\u7cfb\u6211\u4eec\u4e86\u89e3<a href=\"https:\/\/www.patternsmart.com\/cn\/custom\/\">MT4\u4ea4\u6613\u7b56\u7565\u5b9a\u5236\u5f00\u53d1\u670d\u52a1<\/a>\u3002<\/p>\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u79fb\u52a8\u6b62\u635f\u8ba1\u7b97\u51fa\u7684\u4ef7\u683c\u5373\u4f7f\u6570\u5b66\u4e0a\u5408\u7406\uff0c\u7ecf\u7eaa\u5546\u4e5f\u53ef\u80fd\u62d2\u7edd\u4fee\u6539\u3002MT4\u7684\u6b62\u635f\u8ddd\u79bb\u4e0e\u51bb\u7ed3\u8ddd\u79bb\u4ee5Point\u4e3a\u5355\u4f4d\uff0c\u4e0d\u80fd\u6df7 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2712,"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,520],"tags":[426,126,340,422,614],"class_list":["post-2711","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mt4","category-520","tag-mql4","tag-mt4","tag-340","tag-422","tag-614"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/www.patternsmart.com\/cn\/wp-content\/uploads\/2026\/11\/PS_StopModify_CN_Fig1.png","_links":{"self":[{"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/posts\/2711","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=2711"}],"version-history":[{"count":0,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/posts\/2711\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/media\/2712"}],"wp:attachment":[{"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/media?parent=2711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/categories?post=2711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/tags?post=2711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}