{"id":3649,"date":"2026-08-05T07:17:00","date_gmt":"2026-08-04T23:17:00","guid":{"rendered":"https:\/\/blog.laoyulaoyu.top\/?p=3649"},"modified":"2026-07-24T17:48:36","modified_gmt":"2026-07-24T09:48:36","slug":"%e5%a4%a7%e5%a4%9a%e6%95%b0%e7%aa%81%e7%a0%b4%e4%ba%a4%e6%98%93%e5%80%92%e5%9c%a8%e6%94%b6%e7%bc%a9%e9%98%b6%e6%ae%b5%ef%bc%8c%e8%80%8c%e8%bf%99%e4%b8%aaea%e7%ad%89%e7%9a%84%e6%98%af","status":"publish","type":"post","link":"https:\/\/blog.laoyulaoyu.top\/index.php\/2026\/08\/05\/%e5%a4%a7%e5%a4%9a%e6%95%b0%e7%aa%81%e7%a0%b4%e4%ba%a4%e6%98%93%e5%80%92%e5%9c%a8%e6%94%b6%e7%bc%a9%e9%98%b6%e6%ae%b5%ef%bc%8c%e8%80%8c%e8%bf%99%e4%b8%aaea%e7%ad%89%e7%9a%84%e6%98%af\/","title":{"rendered":"\u5927\u591a\u6570\u7a81\u7834\u4ea4\u6613\u5012\u5728\u201c\u6536\u7f29\u9636\u6bb5\u201d\uff0c\u800c\u8fd9\u4e2aEA\u7b49\u7684\u662f\u201c\u6269\u5f20\u786e\u8ba4\u201d\uff08\u9644\u5b8c\u6574\u6e90\u7801\uff09"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u4f5c \u8005\uff1a<a href=\"https:\/\/www.laoyulaoyu.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u8001\u4f59\u635e\u9c7c<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-cyan-bluish-gray-color\">\u539f\u521b\u4e0d\u6613\uff0c\u8f6c\u8f7d\u8bf7\u6807\u660e\u51fa\u5904\u53ca\u539f\u4f5c\u8005\u3002<\/mark><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/laoyulaoyu.com\/wp-content\/uploads\/2026\/07\/cover-18.png\" alt=\"\" class=\"wp-image-4623\"\/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u6587\u4e2d\u793a\u4f8b\u4ec5\u7528\u4e8e\u6280\u672f\u8ba8\u8bba\uff0c\u4e0d\u6784\u6210\u4efb\u4f55\u64cd\u4f5c\u5efa\u8bae\u3002<br>\u91cf\u5316\u7b56\u7565\u5f00\u53d1\u5e94\u4ee5\u5b66\u4e60\u548c\u6280\u672f\u4ea4\u6d41\u4e3a\u76ee\u7684\u3002<br>\u672c\u53f7\u4e0d\u8350\u80a1\u3001\u4e0d\u5356\u8bfe\u3001\u4e0d\u627f\u8bfa\u6536\u76ca\u3002<br>\u5e02\u573a\u6709\u98ce\u9669\uff0c\u8bf7\u5408\u6cd5\u5408\u89c4\u6295\u8d44\u3002<\/p>\n<\/blockquote>\n\n\n\n<p class=\"has-text-align-left wp-block-paragraph\">\u672c\u6587\u7ea6 2900 \u5b57 | \u9884\u8ba1\u9605\u8bfb 5-8 \u5206\u949f\uff0c\u540e\u6709\u4ee3\u7801\u4e0b\u8f7d\uff0c\u5efa\u8bae\u5148\u6536\u85cf\u3002<\/p>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">\u00b7 \u00b7 \u00b7<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u505a\u8fc7\u7a81\u7834\u4ea4\u6613\u7684\u4eba\u90fd\u61c2\u8fd9\u4e2a\u753b\u9762\uff1a\u5e03\u6797\u5e26\u7684\u4e0a\u4e0b\u8f68\u8d8a\u6536\u8d8a\u7a84\uff0c\u6ce2\u52a8\u7387\u88ab\u538b\u5230\u4e00\u4e2a\u6781\u4f4e\u7684\u6c34\u5e73\uff0c\u7136\u540e\u67d0\u4e00\u6839K\u7ebf\u7a81\u7136\u62c9\u51fa\u53bb\u3002\u8d5a\u5230\u7684\u4f1a\u558a&#8221;\u6293\u4f4f\u4e86&#8221;\uff0c\u9519\u8fc7\u7684\u4eba\u4f1a\u5550\u4e00\u53e3\u8bf4&#8221;\u5047\u7a81\u7834&#8221;\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e2a\u6a21\u5f0f\u672c\u8eab\u5df2\u7ecf\u88ab\u4eba\u5199\u4e86\u65e0\u6570\u904d\u3002\u95ee\u9898\u4ece\u6765\u4e0d\u662f\u600e\u4e48\u53d1\u73b0\u6536\u7f29\uff1a\u968f\u4fbf\u626b\u4e00\u773c\u5e03\u6797\u5e26\u5bbd\u5ea6\u5c31\u77e5\u9053\u4e86\u3002\u95ee\u9898\u662f\u8fd9\u4e09\u4e2a\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u8fd9\u6839K\u7ebf\u662f\u771f\u7a81\u7834\u8fd8\u662f\u566a\u97f3\uff1f\u591a\u8fd8\u662f\u7a7a\uff1f\u4ed3\u4f4d\u653e\u591a\u5927\uff1f<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">\u4eca\u5929\u6211\u5c31\u7528\u5e03\u6797\u5e26\u5bbd\u5ea6\u3001\u4e00\u76ee\u5747\u8861\u4e91\u5c42\u3001\u968f\u673a\u6307\u6807\u4e09\u4e2a\u4e1c\u897f\uff0c\u4e00\u6b21\u6027\u56de\u7b54\u8fd9\u4e09\u4e2a\u95ee\u9898\u3002MQL5\u4ee3\u7801\u5168\u5f00\u6e90\uff0c\u4f1a\u5728\u6587\u7ae0\u672b\u5c3e\u63d0\u4f9b\u4e0b\u8f7d\u5730\u5740\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6574\u4f53\u7684\u6d41\u7a0b\u548c\u8f93\u51fa\u5927\u6982\u662f\u4e0b\u9762\u8fd9\u6837\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/laoyulaoyu.com\/wp-content\/uploads\/2026\/07\/ct.png\" alt=\"\" class=\"wp-image-4624\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u25b2 EA\u4fe1\u53f7\u6d41\u7a0b\uff1a\u5e03\u6797\u5bbd\u5ea6\u786e\u8ba4\u6269\u5f20 \u2192 \u4e91\u5c42\u5b9a\u65b9\u5411 \u2192 \u968f\u673a\u6307\u6807\u6ee4\u566a\u97f3 \u2192 ATR\u7b97\u4ed3\u4f4d\u548c\u6b62\u635f<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e00\u3001\u522b\u7b49&#8221;\u6536\u7f29&#8221;\uff0c\u7b49&#8221;\u6269\u5f20\u786e\u8ba4&#8221;<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5927\u591a\u6570\u5e03\u6797\u5e26\u7a81\u7834\u7b56\u7565\u7684\u5199\u6cd5\u662f\uff1a\u5e26\u5bbd\u4f4e\u4e8e\u67d0\u4e2a\u9608\u503c\u5c31\u89e6\u53d1\u5165\u573a\u3002\u8fd9\u4e2a\u903b\u8f91\u6709\u4e2a\u660e\u663e\u7684\u95ee\u9898\uff1a\u6536\u7f29\u53ef\u4ee5\u6301\u7eed\u51e0\u5341\u6839K\u7ebf\u3002\u4f60\u5728\u91cc\u9762\u5f00\u5355\uff0c\u8ddf\u629b\u786c\u5e01\u5dee\u4e0d\u591a\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4eca\u5929\u8fd9\u4e2a EA \u6362\u4e86\u4e2a\u601d\u8def\u3002\u5b83\u4e0d\u5173\u5fc3\u6536\u7f29\u5230\u591a\u7a84\uff0c\u5b83\u5173\u5fc3\u7684\u662f\uff1a\u6536\u7f29\u7ed3\u675f\u4e4b\u540e\uff0c\u5e26\u5bbd\u6709\u6ca1\u6709&#8221;\u771f\u7684\u5f20\u5f00&#8221;\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5177\u4f53\u5b9e\u73b0\u5206\u4e24\u6b65\u3002\u7b2c\u4e00\u6b65\uff0c\u5728\u6700\u8fd1 N \u6839 K \u7ebf\u91cc\u627e\u5230\u5e26\u5bbd\u7684\u6700\u4f4e\u70b9\u3002\u7b2c\u4e8c\u6b65\uff0c\u5f53\u524d\u5e26\u5bbd\u5fc5\u987b\u6bd4\u90a3\u4e2a\u6700\u4f4e\u70b9\u5927\u4e86\u81f3\u5c11 20%\uff08\u9ed8\u8ba4\u53c2\u6570&nbsp;<code>InpExpansionFactor = 1.20<\/code>\uff09\uff0cEA \u624d\u8ba4\u4e3a\u6269\u5f20\u53d1\u751f\u4e86\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e2a 20% \u4e0d\u662f\u62cd\u8111\u888b\u62cd\u51fa\u6765\u7684\u3002\u5982\u679c\u53ea\u6bd4\u8f83\u76f8\u90bb\u4e24\u6839 K \u7ebf\u7684\u5e26\u5bbd\uff0c\u6da8 2% \u662f\u6269\u5f20\uff0c\u6da8 5% \u4e5f\u662f\u6269\u5f20\uff1a\u4f46\u524d\u8005\u53ef\u80fd\u53ea\u662f\u566a\u97f3\uff0c\u540e\u8005\u624d\u662f\u771f\u6b63\u7684\u6ce2\u52a8\u7387\u56de\u5f52\u3002\u7528 20% \u8fd9\u4e2a\u9608\u503c\uff0c\u672c\u8d28\u4e0a\u662f\u5728\u7b49\u6ce2\u52a8\u7387&#8221;\u8db3\u591f\u5927&#8221;\u7684\u53d8\u5316\uff0c\u800c\u4e0d\u662f\u76ef\u7740\u6bcf\u4e00\u6839 K \u7ebf\u7684\u5c0f\u5e45\u8df3\u52a8\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee3\u7801\u903b\u8f91\u503c\u5f97\u770b\u4e00\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ \u7a97\u53e3\u5185\u7684\u6700\u4f4e\u5e26\u5bbd\ndouble minRecentWidth = DBL_MAX;\nfor(int i = 1; i &lt;= InpBreakoutLookback; i++) {\n&nbsp; &nbsp; double w = (upper&#91;i] - lower&#91;i]) \/ MathMax(middle&#91;i], 1e-10);\n&nbsp; &nbsp; if(w &lt; minRecentWidth) minRecentWidth = w;\n}\n\n\/\/ \u5f53\u524d\u5e26\u5bbd\u6bd4\u6700\u4f4e\u70b9\u6269\u5f20\u4e8620%\uff1f\u89e6\u53d1\nbool isExpanding = curWidth &gt; minRecentWidth * InpExpansionFactor;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e2a\u8bbe\u8ba1\u7684\u5b9e\u9645\u6548\u679c\u662f\uff1a\u5b83\u4e0d\u4f1a\u5728\u5e02\u573a\u7f29\u91cf\u6a2a\u76d8\u4e86\u4e09\u4e2a\u6708\u3001\u5e26\u5bbd\u4e00\u76f4\u8db4\u5728\u5730\u4e0a\u7684\u65f6\u5019\u53cd\u590d\u5f00\u5355\u3002\u5b83\u7b49\u7684\u662f&#8221;\u538b\u5230\u6781\u81f4\u4e4b\u540e\u771f\u7684\u5f00\u59cb\u52a8\u4e86&#8221;\u7684\u90a3\u4e00\u523b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e8c\u3001\u65b9\u5411\u4ea4\u7ed9\u4e00\u76ee\u5747\u8861\u4e91\uff0c\u4e0d\u505a\u731c\u6d4b<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u6269\u5f20\u786e\u8ba4\u4e86\uff0c\u65b9\u5411\u600e\u4e48\u529e\uff1f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e2a EA \u7528\u7684\u662f\u4e00\u76ee\u5747\u8861\u7684\u4e91\u5c42\uff08Kumo\uff09\u3002\u89c4\u5219\u5f88\u76f4\u767d\uff1a\u4ef7\u683c\u5728\u4e91\u5c42\u4e0a\u65b9 \u2192 \u53ea\u505a\u591a\u3002\u4ef7\u683c\u5728\u4e91\u5c42\u4e0b\u65b9 \u2192 \u53ea\u505a\u7a7a\u3002\u4ef7\u683c\u5728\u4e91\u5c42\u5185\u90e8 \u2192 \u4e0d\u5f00\u5355\uff0c\u7b49\u7740\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e3a\u4ec0\u4e48\u4e0d\u7528\u5747\u7ebf\u4ea4\u53c9\u6216\u8005\u8721\u70db\u989c\u8272\uff1f\u56e0\u4e3a\u4e91\u5c42\u672c\u8eab\u662f\u4e00\u4e2a&#8221;\u5171\u8bc6\u533a\u57df&#8221;\uff1a\u53ea\u6709\u5f53\u4ef7\u683c\u5df2\u7ecf\u7ad9\u5728\u4e91\u7684\u4e00\u4fa7\uff0c\u624d\u80fd\u8bf4\u660e\u591a\u7a7a\u54ea\u4e00\u65b9\u5360\u636e\u4e86\u4e0a\u98ce\u3002\u4e91\u5185\u90e8\u7684\u884c\u60c5\u672c\u8d28\u4e0a\u65b9\u5411\u4e0d\u660e\u786e\uff0c\u5f3a\u884c\u5f00\u5355\u5c31\u662f\u5728\u8d4c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>double cloudTop &nbsp; = MathMax(spanA&#91;1], spanB&#91;1]);\ndouble cloudBottom = MathMin(spanA&#91;1], spanB&#91;1]);\nbool wantBuy &nbsp;= (price &gt; cloudTop);\nbool wantSell = (price &lt; cloudBottom);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6709\u4e86\u8fd9\u4e2a\u7ea6\u675f\uff0cEA \u4e0d\u4f1a\u5728\u65b9\u5411\u4e0d\u660e\u7684\u7a84\u5e45\u9707\u8361\u91cc\u6d6a\u8d39\u5b50\u5f39\u3002\u6269\u5f20\u786e\u8ba4\u544a\u8bc9\u4f60&#8221;\u6ce2\u52a8\u7387\u56de\u6765\u4e86&#8221;\uff0c\u4e91\u5c42\u65b9\u5411\u544a\u8bc9\u4f60&#8221;\u4f60\u8981\u8ddf\u54ea\u8fb9&#8221;\u3002\u4e24\u4e2a\u6761\u4ef6\u540c\u65f6\u6ee1\u8db3\uff0c\u4fe1\u53f7\u624d\u6210\u7acb\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e09\u3001\u518d\u52a0\u4e00\u9053\u8fc7\u6ee4\uff1a\u968f\u673a\u6307\u6807<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u65b9\u5411\u662f\u5bf9\u7684\uff0c\u4f46\u7a81\u7834\u4ecd\u7136\u53ef\u80fd\u662f\u5047\u52a8\u4f5c\u3002EA \u7684\u7b2c\u4e09\u5c42\u4fdd\u62a4\u662f\u968f\u673a\u6307\u6807\u7684 %K\/%D \u4ea4\u53c9\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u903b\u8f91\u8ddf\u4e91\u5c42\u4e00\u81f4\uff1a\u53ea\u53d6\u540c\u65b9\u5411\u7684\u4ea4\u53c9\u3002\u505a\u591a\u4fe1\u53f7\u5fc5\u987b\u7b49 %K \u4ece\u4e0b\u65b9\u5411\u4e0a\u7a7f\u8fc7 %D\uff0c\u505a\u7a7a\u4fe1\u53f7\u5fc5\u987b\u7b49 %K \u4ece\u4e0a\u65b9\u5411\u4e0b\u8dcc\u7834 %D\u3002\u5982\u679c\u65b9\u5411\u5bf9\uff0c\u4f46\u968f\u673a\u6307\u6807\u6ca1\u4ea4\u53c9\uff1f\u4e0d\u5f00\u5355\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>bool bullishCross = (kPrev &lt;= dPrev) &amp;&amp; (kNow &gt; dNow);\nbool bearishCross = (kPrev &gt;= dPrev) &amp;&amp; (kNow &lt; dNow);\nif(wantBuy &amp;&amp; !bullishCross) wantBuy = false;\nif(wantSell &amp;&amp; !bearishCross) wantSell = false;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u800c\u4e14\u8fd9\u4e2a\u8fc7\u6ee4\u662f\u53ef\u9009\u7684\uff08<code>InpRequireStochCross<\/code>\uff09\uff0c\u5173\u6389\u4e4b\u540e\u5c31\u80fd A\/B \u6d4b\u8bd5\uff1a\u5f00\u548c\u4e0d\u5f00\uff0c\u54ea\u4e2a\u6548\u679c\u597d\u3002\u8fd9\u4e00\u70b9\u5728 EA \u8bbe\u8ba1\u91cc\u5f88\u91cd\u8981\uff1a\u4f60\u7684\u89c4\u5219\u80fd\u4e0d\u80fd\u5173\u6389\u56de\u6d4b\uff0c\u51b3\u5b9a\u4e86\u4f60\u662f\u5728\u7528\u4e00\u6761\u89c4\u5219\u8fd8\u662f\u5728\u8d4c\u4e00\u4e2a\u6545\u4e8b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u56db\u3001\u4ed3\u4f4d\u6309&#8221;\u4f60\u60f3\u8d5a\u591a\u5c11\u94b1&#8221;\u53cd\u63a8<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u505a\u8fc7\u591a\u54c1\u79cd EA \u7684\u4eba\u90fd\u77e5\u9053\uff1a0.1 \u624b EURUSD \u548c 0.1 \u624b XAUUSD \u662f\u4e00\u56de\u4e8b\u5417\uff1f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f53\u7136\u4e0d\u662f\u3002\u4e00\u4e2a\u6ce2\u52a8 10 \u4e2a\u70b9\uff0c\u4e00\u4e2a\u6ce2\u52a8 100 \u4e2a\u70b9\uff0c\u540c\u6837\u7684\u624b\u6570\u610f\u5473\u7740\u5b8c\u5168\u4e0d\u540c\u7684\u98ce\u9669\u66b4\u9732\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u672cEA \u7684\u4ed3\u4f4d\u903b\u8f91\u5012\u8fc7\u6765\u7b97\uff1a\u4f60\u5148\u5b9a&#8221;\u8fd9\u7b14\u4ea4\u6613\u6b62\u76c8\u4e86\u8981\u8d5a\u591a\u5c11\u94b1&#8221;\uff08\u6bd4\u5982 50 \u6b27\u5143\uff09\uff0c\u7136\u540e EA \u6839\u636e\u5f53\u524d\u54c1\u79cd\u7684 tick value \u548c ATR \u7b97\u51fa\u7684\u6b62\u76c8\u8ddd\u79bb\uff0c\u53cd\u63a8\u9700\u8981\u5f00\u591a\u5c11\u624b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>double CalcLotForTargetProfit(string symbol, double tpDistance, double targetProfit) {\n&nbsp; &nbsp; double tickValue = SymbolInfoDouble(symbol, SYMBOL_TRADE_TICK_VALUE);\n&nbsp; &nbsp; double tickSize &nbsp;= SymbolInfoDouble(symbol, SYMBOL_TRADE_TICK_SIZE);\n&nbsp; &nbsp; double valuePerLot = (tpDistance \/ tickSize) * tickValue;\n&nbsp; &nbsp; double lot = targetProfit \/ valuePerLot;\n&nbsp; &nbsp; \/\/ ... \u5bf9\u9f50\u5230\u54c1\u79cd\u7684\u6700\u5c0f\u624b\u6570\u6b65\u957f\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e2a\u8bbe\u8ba1\u7684\u597d\u5904\u662f\uff1a\u4f60\u4e0d\u662f\u5728\u7ba1\u7406\u624b\u6570\uff0c\u4f60\u662f\u5728\u7ba1\u7406&#8221;\u6bcf\u7b14\u4ea4\u6613\u60f3\u5192\u591a\u5c11\u3001\u8d5a\u591a\u5c11&#8221;\uff1a\u8fd9\u6bd4\u76ef\u7740\u624b\u6570\u770b\u8981\u8bda\u5b9e\u5f97\u591a\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b62\u635f\u548c\u6b62\u76c8\u7684\u8ddd\u79bb\u672c\u8eab\u4e5f\u7528\u4e86 ATR \u7684\u500d\u6570\uff1a\u6b62\u635f 1.5\u00d7ATR\uff0c\u6b62\u76c8\u56fa\u5b9a 3.0\u00d7ATR\u3002ATR \u52a8\uff0c\u6b62\u635f\u6b62\u76c8\u8ddf\u7740\u52a8\u3002\u54c1\u79cd\u6ce2\u52a8\u5927\u5c31\u81ea\u52a8\u653e\u5bbd\u6b62\u635f\uff0c\u4ea7\u54c1\u91cf\u5c0f\u5c31\u81ea\u52a8\u6536\u7d27\u3002\u4e0d\u4f1a\u51fa\u73b0&#8221;\u56fa\u5b9a 20 \u70b9\u6b62\u635f\u5728\u9ec4\u91d1\u4e0a\u7b49\u4e8e\u6ca1\u8bbe&#8221;\u7684\u60c5\u51b5\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e94\u3001\u6d6e\u76c8\u8dd1\u8d77\u6765\u4e86\uff0ctrailing stop \u8ddf\u4e0a<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u7a81\u7834\u4ea4\u6613\u6709\u4e00\u4e2a\u5f88\u6076\u5fc3\u7684\u4f53\u9a8c\uff1a\u65b9\u5411\u5bf9\u4e86\uff0c\u8dd1\u4e86 3%\uff0c\u6ca1\u6b62\u76c8\uff0c\u7136\u540e\u4e00\u4e2a\u56de\u8e29\u626b\u6389\u6b62\u635f\uff0c\u53d8\u6210\u4e8f\u635f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u672cEA \u52a0\u4e86\u4e00\u4e2a trailing stop\uff0c\u4f46\u5b83\u4e0d\u662f\u4e00\u5f00\u4ed3\u5c31\u8ddf\u7740\u8dd1\u3002\u5b83\u7b49\u6d6e\u76c8\u8d85\u8fc7\u4e00\u5b9a\u8ddd\u79bb\uff08<code>InpTrailingStartATRMult<\/code>\uff0c\u9ed8\u8ba4 1\u00d7ATR\uff09\u4e4b\u540e\u624d\u542f\u52a8\uff0c\u800c\u4e14\u53ea\u5f80\u6709\u5229\u65b9\u5411\u79fb\u52a8\uff0c\u4e0d\u5f80\u540e\u9000\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>double trailDist = atrValue * InpTrailingATRMult; &nbsp;\/\/ \u6bd4\u5982 0.5\u00d7ATR\uff0c\u8ddf\u5f97\u5f88\u7d27\ndouble profitDist = tick.bid - openPrice;\nif(profitDist &lt; startDist) return; &nbsp;\/\/ \u4e0d\u591f\u8fdc\uff0c\u4e0d\u8ddf\ndouble newSL = tick.bid - trailDist;\nif(newSL &gt; currentSL) trade.PositionModify(...);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">0.5\u00d7ATR \u7684\u8ddf\u7d27\u8ddd\u79bb\uff0c\u52a0\u4e0a 1\u00d7ATR \u7684\u542f\u52a8\u95e8\u69db\uff0c\u610f\u5473\u7740 EA \u53ea\u6709\u5728\u76c8\u5229\u8db3\u591f\u591a\u7684\u65f6\u5019\u624d\u5f00\u59cb\u9501\u5b9a\u5229\u6da6\uff0c\u800c\u4e0d\u662f\u521a\u5f00\u5355\u5c31\u6025\u7740\u4e0a\u79fb\u6b62\u635f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u516d\u3001\u6309\u54c1\u79cd\u00d7\u65f6\u95f4\u6846\u67b6\u72ec\u7acb\u7edf\u8ba1<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u591a\u6570 EA \u8dd1\u5b8c\u4e4b\u540e\uff0c\u4f60\u53ea\u77e5\u9053\u603b\u76c8\u4e8f\u3002\u8d5a\u4e86 500 \u5757\uff0c\u4e0d\u9519\u3002\u4f46\u4f60\u77e5\u9053\u8fd9 500 \u5757\u662f H4 \u8d5a\u7684 800 \u6263\u6389 M15 \u4e8f\u7684 300 \u5417\uff1f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6211\u4eec EA \u5185\u90e8\u7ef4\u62a4\u4e86\u4e00\u4e2a context \u6570\u7ec4\uff0c\u6bcf\u4e00\u4e2a context \u5bf9\u5e94\u4e00\u4e2a\u300c\u54c1\u79cd + \u65f6\u95f4\u6846\u67b6\u300d\u7684\u7ec4\u5408\u3002M15 \u7684 EURUSD\u3001H4 \u7684 EURUSD\u3001D1 \u7684 GBPUSD\u2026\u2026\u6bcf\u4e00\u4e2a\u7ec4\u5408\u6709\u81ea\u5df1\u7684\u6307\u6807\u53e5\u67c4\u3001magic number \u548c\u72ec\u7acb\u7684\u4ea4\u6613\u7edf\u8ba1\u3002\u6bcf\u6b21\u6709\u4ed3\u4f4d\u5173\u95ed\u4ed3\u4f4d\uff0c<code>OnTradeTransaction<\/code>&nbsp;\u4f1a\u628a\u76c8\u4e8f\u5f52\u5230\u5bf9\u5e94\u7684 context \u4e0a\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u65e5\u5fd7\u6253\u51fa\u6765\u957f\u8fd9\u6837\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>EURUSD H4 &nbsp;| trades=12 wins=7 losses=5 &nbsp;winRate=58.3% &nbsp;profitTotal=145.30\nEURUSD D1 &nbsp;| trades=4 &nbsp;wins=3 losses=1 &nbsp;winRate=75.0% &nbsp;profitTotal=89.10\nGBPUSD M30 | trades=31 wins=14 losses=17 winRate=45.2% &nbsp;profitTotal=-38.50<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u773c\u5c31\u80fd\u770b\u51fa\u6765\uff1aD1 \u80dc\u7387 75% \u4f46\u4ea4\u6613\u592a\u5c11\uff0cM30 \u4ea4\u6613\u591a\u4f46\u4e8f\u94b1\uff0cH4 \u624d\u662f\u4e3b\u8981\u8d21\u732e\u8005\u3002\u8fd9\u4e2a\u7ea7\u522b\u7684\u900f\u660e\u5ea6\u5728\u514d\u8d39 EA \u91cc\u4e0d\u591a\u89c1\u3002\u4f60\u53ef\u4ee5\u76f4\u63a5\u7528\u8fd9\u4e9b\u6570\u636e\u51b3\u5b9a\u5173\u6389\u54ea\u4e9b\u65f6\u95f4\u6846\u67b6\u3001\u8c03\u54ea\u4e2a\u54c1\u79cd\u7684\u53c2\u6570\uff0c\u4e0d\u7528\u9760\u731c\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e03\u3001\u9700\u8981\u6ce8\u610f\u7684\u51e0\u70b9<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u53c2\u6570\u4e0d\u662f\u901a\u7528\u7684\u3002<\/strong>&nbsp;\u5e03\u6797\u5e26\u7684\u56de\u6eaf\u7a97\u53e3\u3001\u6269\u5f20\u56e0\u5b50\u3001ATR \u500d\u6570\uff1a\u8fd9\u4e9b\u4e1c\u897f\u5bf9 EURUSD H4 \u597d\u7528\u7684\uff0c\u4e0d\u4e00\u5b9a\u4f1a\u5bf9 XAUUSD M10 \u597d\u7528\u3002\u5fc5\u987b\u5206\u54c1\u79cd\u5206\u65f6\u95f4\u6846\u67b6\u6d4b\uff0c\u522b\u5077\u61d2\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u76f8\u5173\u6027\u98ce\u9669\u3002<\/strong>&nbsp;\u5728 EURUSD \u548c GBPUSD \u4e0a\u540c\u65f6\u8dd1\u540c\u4e00\u4e2a\u903b\u8f91\uff0c\u884c\u60c5\u6765\u4e86\u4e24\u8fb9\u90fd\u5f00\u5355\u3002\u4f60\u4ee5\u4e3a\u4f60\u5728\u5206\u6563\u98ce\u9669\uff0c\u5b9e\u9645\u4e0a\u4f60\u5728\u52a0\u500d\u66b4\u9732\u4e8e\u540c\u4e00\u4e2a\u65b9\u5411\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u6ca1\u6709\u603b\u655e\u53e3\u4e0a\u9650\u3002<\/strong>&nbsp;\u6309\u76ee\u6807\u76c8\u5229\u91d1\u989d\u53cd\u63a8\u624b\u6570\uff0c\u8fd9\u4e2a\u8bbe\u8ba1\u89e3\u51b3\u4e86\u5355\u54c1\u79cd\u7684\u95ee\u9898\u3002\u4f46\u5982\u679c 9 \u4e2a\u65f6\u95f4\u6846\u67b6\u540c\u65f6\u5728\u67d0\u4e2a\u54c1\u79cd\u4e0a\u5f00\u4e86\u5355\uff0c\u4f60\u7684\u603b\u4ed3\u4f4d\u53ef\u80fd\u662f\u5355\u7b14\u7684 9 \u500d\u3002\u4f5c\u8005\u81ea\u5df1\u4e5f\u8bf4\u4e86\uff0c\u8fd9\u4e2a EA \u7f3a\u4e00\u4e2a\u8d26\u6237\u7ea7\u522b\u7684\u603b\u98ce\u9669\u4e0a\u9650\uff1a&#8221;\u8fd9\u4e5f\u662f\u4e00\u4e2a\u503c\u5f97\u5355\u72ec\u52a0\u7684\u63a7\u5236\u9879&#8221;\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\u63d0\u793a\uff1a<\/strong>\u6211\u8fd9\u4e2aEA\u5c31\u662f\u4e2a\u6a21\u677f\uff0c\u4e0d\u662f\u6210\u54c1\u3002Squeeze-breakout \u7b56\u7565\u672c\u8eab\u5c31\u662f\u5047\u4fe1\u53f7\u9ad8\u53d1\u7684\u7c7b\u578b\u3002\u53c2\u6570\u9700\u8981\u5728\u4f60\u81ea\u5df1\u7684\u54c1\u79cd\u548c\u65f6\u95f4\u6846\u67b6\u4e0a\u8dd1\u5b9e\u8bc1\uff0c\u4e0d\u662f\u590d\u5236\u7c98\u8d34\u5c31\u80fd\u4e0a\u5b9e\u76d8\u7684\u3002<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4ee3\u7801\u548c\u4e0b\u8f7d<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b8c\u6574\u6e90\u4ee3\u7801\u53ef\u4ee5\u4ece\u8fd9\u91cc\u76f4\u63a5\u4e0b\u8f7d\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udd17https:\/\/www.laoyulaoyu.com\/code\/BollingerSEA.zip<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u4e09\u4e2a\u6307\u6807\u7684\u4e32\u8054\u903b\u8f91\uff1a<\/strong>\u5e03\u6797\u5bbd\u5ea6\u786e\u8ba4\u6269\u5f20\u3001\u4e00\u76ee\u5747\u8861\u5b9a\u65b9\u5411\u3001\u968f\u673a\u6307\u6807\u8fc7\u6ee4\u5047\u4fe1\u53f7\uff1a\u52a0\u4e0a ATR \u6b62\u635f\u6b62\u76c8\u3001trailing stop\u3001\u591a\u4e0a\u4e0b\u6587\u5e76\u884c\u8dd1\uff0c\u8fd9\u5957\u4e1c\u897f\u5c31\u7b97\u4e0d\u76f4\u63a5\u7528\uff0c\u6846\u67b6\u601d\u8def\u4e5f\u503c\u5f97\u53c2\u8003\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><a>#MQL5<\/a>&nbsp;<a>#\u5e03\u6797\u5e26<\/a>&nbsp;<a>#\u4e00\u76ee\u5747\u8861<\/a>&nbsp;<a>#EA<\/a>&nbsp;<a>#\u591a\u65f6\u95f4\u6846\u67b6<\/a>&nbsp;<a>#\u7a81\u7834\u4ea4\u6613<\/a>&nbsp;<a>#\u968f\u673a\u6307\u6807<\/a>&nbsp;<a>#ATR\u6b62\u635f<\/a>&nbsp;<a>#\u91cf\u5316\u4ea4\u6613<\/a>&nbsp;<a>#\u5916\u6c47EA<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f5c \u8005\uff1a\u8001\u4f59\u635e\u9c7c \u539f\u521b\u4e0d\u6613\uff0c\u8f6c\u8f7d\u8bf7\u6807\u660e\u51fa\u5904\u53ca\u539f\u4f5c\u8005&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/blog.laoyulaoyu.top\/index.php\/2026\/08\/05\/%e5%a4%a7%e5%a4%9a%e6%95%b0%e7%aa%81%e7%a0%b4%e4%ba%a4%e6%98%93%e5%80%92%e5%9c%a8%e6%94%b6%e7%bc%a9%e9%98%b6%e6%ae%b5%ef%bc%8c%e8%80%8c%e8%bf%99%e4%b8%aaea%e7%ad%89%e7%9a%84%e6%98%af\/\">Continue reading<span class=\"screen-reader-text\">\u5927\u591a\u6570\u7a81\u7834\u4ea4\u6613\u5012\u5728\u201c\u6536\u7f29\u9636\u6bb5\u201d\uff0c\u800c\u8fd9\u4e2aEA\u7b49\u7684\u662f\u201c\u6269\u5f20\u786e\u8ba4\u201d\uff08\u9644\u5b8c\u6574\u6e90\u7801\uff09<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[17,4,5,14,6],"class_list":["post-3649","post","type-post","status-publish","format-standard","hentry","category-aiinvest","tag-ai","tag-14","tag-6","entry"],"_links":{"self":[{"href":"https:\/\/blog.laoyulaoyu.top\/index.php\/wp-json\/wp\/v2\/posts\/3649","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.laoyulaoyu.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.laoyulaoyu.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.laoyulaoyu.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.laoyulaoyu.top\/index.php\/wp-json\/wp\/v2\/comments?post=3649"}],"version-history":[{"count":1,"href":"https:\/\/blog.laoyulaoyu.top\/index.php\/wp-json\/wp\/v2\/posts\/3649\/revisions"}],"predecessor-version":[{"id":3650,"href":"https:\/\/blog.laoyulaoyu.top\/index.php\/wp-json\/wp\/v2\/posts\/3649\/revisions\/3650"}],"wp:attachment":[{"href":"https:\/\/blog.laoyulaoyu.top\/index.php\/wp-json\/wp\/v2\/media?parent=3649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.laoyulaoyu.top\/index.php\/wp-json\/wp\/v2\/categories?post=3649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.laoyulaoyu.top\/index.php\/wp-json\/wp\/v2\/tags?post=3649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}