{"id":2835,"date":"2026-11-28T18:00:33","date_gmt":"2026-11-29T00:00:33","guid":{"rendered":"https:\/\/www.patternsmart.com\/cn\/?p=2835"},"modified":"2026-11-29T00:07:31","modified_gmt":"2026-11-29T00:07:31","slug":"thinkscript%e7%ad%96%e7%95%a5%e5%a6%82%e4%bd%95%e5%8c%ba%e5%88%86%e4%bf%a1%e5%8f%b7%e4%bb%b7%e6%a0%bc%e4%b8%8e%e6%a8%a1%e6%8b%9f%e5%85%a5%e5%9c%ba%e4%bb%b7%e6%a0%bc","status":"publish","type":"post","link":"https:\/\/www.patternsmart.com\/cn\/thinkscript%e7%ad%96%e7%95%a5%e5%a6%82%e4%bd%95%e5%8c%ba%e5%88%86%e4%bf%a1%e5%8f%b7%e4%bb%b7%e6%a0%bc%e4%b8%8e%e6%a8%a1%e6%8b%9f%e5%85%a5%e5%9c%ba%e4%bb%b7%e6%a0%bc\/","title":{"rendered":"thinkScript\u7b56\u7565\u5982\u4f55\u533a\u5206\u4fe1\u53f7\u4ef7\u683c\u4e0e\u6a21\u62df\u5165\u573a\u4ef7\u683c"},"content":{"rendered":"<div class=\"postie-post\">\n<p>\u5df2\u5b8c\u6210K\u7ebf\u6536\u76d8\u65f6\u8bc6\u522b\u51fa\u7684\u7a81\u7834\uff0c\u4e0d\u4e00\u5b9a\u80fd\u4ee5\u8be5\u6536\u76d8\u4ef7\u4ea4\u6613\u3002thinkorswim\u7684AddOrder\u751f\u6210\u7684\u662f\u5047\u8bbe\u7b56\u7565\u8ba2\u5355\uff0c\u5e76\u975e\u65e0\u4eba\u503c\u5b88\u7684\u5b9e\u76d8\u81ea\u52a8\u4ea4\u6613\u3002\u5e94\u5c06\u4fe1\u53f7\u4e0e\u4e0b\u4e00\u6839K\u7ebf\u7684\u6a21\u62df\u5165\u573a\u5206\u5f00\u6d4b\u8bd5\u3002<\/p>\n<h2>\u6570\u503c\u5b9e\u4f8b<\/h2>\n<p>\u5047\u8bbe100\u5904\u8bc6\u522b\u7a81\u7834\uff0c\u4e0b\u4e00\u6839\u5f00\u76d8103\uff0c\u6a21\u62df\u5165\u573a\u4ef7\u4e3a103\u800c\u975e100\u3002\u82e5\u4e4b\u540e\u5047\u8bbe\u9000\u51fa\u4ef7105\uff0c\u5219\u6263\u9664\u6210\u672c\u524d\u7684\u4ef7\u683c\u6536\u76ca\u4e3a2\u800c\u975e5\u3002\u8df3\u7a7a\u6539\u53d8\u4ea4\u6613\u7ecf\u6d4e\u6027\uff0c\u5374\u4e0d\u6539\u53d8\u4fe1\u53f7\u672c\u8eab\u3002<\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/www.patternsmart.com\/cn\/wp-content\/uploads\/2026\/11\/PS_TOS_Gap_CN.png\" alt=\"PS_TOS_Gap_CN.png\" width=\"800\" height=\"360\" style=\"max-width:100%;height:auto\"><figcaption>\u4fe1\u53f7\u4ef7100\u4e0e\u4e0b\u4e00\u6839\u6a21\u62df\u5165\u573a\u4ef7103\u7684\u5bf9\u6bd4\u3002<\/figcaption><\/figure>\n<h2>\u5b9e\u73b0\u903b\u8f91<\/h2>\n<p>\u4ee5\u6b64\u524dK\u7ebf\u6700\u9ad8\u4ef7\u4e3a\u963b\u529b\uff0c\u6392\u9664\u5f53\u524dK\u7ebf\u3002\u6761\u4ef6\u68c0\u6d4b\u4ece\u672a\u9ad8\u4e8e\u6b64\u524d\u963b\u529b\u5230\u9ad8\u4e8e\u5f53\u524d\u963b\u529b\u7684\u8f6c\u6362\u3002\u7531\u4e8e\u963b\u529b\u6eda\u52a8\u53d8\u5316\uff0c\u5b83\u5e76\u975e\u56fa\u5b9a\u6c34\u5e73\u7ebf\u3002AddOrder\u91c7\u7528\u4e0b\u4e00\u6839\u5f00\u76d8\u4f5c\u4e3a\u6a21\u62df\u4ef7\u683c\uff1bopen[-1]\u9002\u7528\u4e8e\u6b64\u6a21\u62df\u4ef7\u683c\u53c2\u6570\uff0c\u4e0d\u5e94\u4f5c\u4e3a\u4fe1\u53f7\u8f93\u5165\u3002<\/p>\n<pre style=\"white-space:pre;font-family:Consolas,Monaco,monospace\"><code>input length = 20;<br>def resistance = Highest(high[1], length);<br>def breakout = close &gt; resistance and close[1] &lt;= resistance[1];<br>AddOrder(OrderType.BUY_TO_OPEN, breakout, open[-1], 1,<br>\u00a0\u00a0\u00a0\u00a0Color.GREEN, Color.GREEN, &quot;Breakout&quot;);<\/code><\/pre>\n<p>\u6b64\u5904\u4ec5\u6f14\u793a\u5165\u573a\u3002\u89e3\u91ca\u5b8c\u6574\u7b56\u7565\u62a5\u544a\u524d\u5e94\u52a0\u5165\u72ec\u7acb\u9000\u51fa\u4e0e\u4ed3\u4f4d\u63a7\u5236\u3002\u91cd\u590d\u7a81\u7834\u53ef\u80fd\u4f9d\u636e\u7b56\u7565\u8bbe\u7f6e\u4ea7\u751f\u989d\u5916\u6a21\u62df\u5165\u573a\u3002\u672c\u793a\u4f8b\u4e0d\u662f\u5b8c\u6574\u4ed3\u4f4d\u63a7\u5236\u5668\u3002<\/p>\n<h2>\u6d4b\u8bd5\u4e0e\u5c40\u9650<\/h2>\n<p>\u5bf9\u76f8\u540c\u4e8b\u4ef6\u6bd4\u8f83\u4fe1\u53f7\u6536\u76d8\u4e0e\u4e0b\u4e00\u6839\u5f00\u76d8\uff0c\u8bb0\u5f55\u6709\u7b26\u53f7\u8df3\u7a7a\u3001\u4e2d\u4f4d\u6570\u3001\u4e0d\u5229\u5c3e\u90e8\u53ca\u6263\u9664\u624b\u7eed\u8d39\u548c\u5408\u7406\u6ed1\u70b9\u540e\u7684\u7ed3\u679c\u3002\u5206\u522b\u5206\u6790\u9694\u591c\u548c\u65f6\u6bb5\u5207\u6362\u3002\u6ce8\u610f\u6700\u540e\u4e00\u6839K\u7ebf\u5c1a\u65e0\u4e0b\u4e00\u6839\u5f00\u76d8\u4ef7\u3002\u4e0d\u8981\u5728\u4fe1\u53f7\u4e2d\u4f7f\u7528\u672a\u6765\u4ef7\u683c\u3002\u5386\u53f2\u7b56\u7565\u7bad\u5934\u4e0d\u4ee3\u8868\u53ef\u6267\u884c\u5b9e\u76d8\u8ba2\u5355\u3002\u8df3\u7a7a\u3001\u6d41\u52a8\u6027\u548c\u6210\u672c\u5747\u53ef\u80fd\u9020\u6210\u4e8f\u635f\u3002<\/p>\n<p>\u5b98\u65b9\u53c2\u8003\uff1a<a href=\"https:\/\/toslc.thinkorswim.com\/center\/reference\/thinkScript\/Functions\/Others\/AddOrder\">\u5e73\u53f0\u6280\u672f\u6587\u6863<\/a>\u3002<\/p>\n<p>\u793a\u4f8b\u672a\u5b9e\u9645\u7f16\u8bd1\u6216\u56de\u6d4b\uff0c\u4ec5\u4f9b\u6559\u5b66\uff0c\u4ea4\u6613\u5b58\u5728\u4e8f\u635f\u98ce\u9669\u3002<\/p>\n<p>\u5982\u9700\u8fdb\u4e00\u6b65\u5b9a\u5236\u6b64\u7b56\u7565\u601d\u8def\uff0c\u8bf7\u8054\u7cfb\u6211\u4eec\u4e86\u89e3<a href=\"https:\/\/www.patternsmart.com\/cn\/custom\/\">Thinkorswim\u4ea4\u6613\u7b56\u7565\u5b9a\u5236\u5f00\u53d1\u670d\u52a1<\/a>\u3002<\/p>\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5df2\u5b8c\u6210K\u7ebf\u6536\u76d8\u65f6\u8bc6\u522b\u51fa\u7684\u7a81\u7834\uff0c\u4e0d\u4e00\u5b9a\u80fd\u4ee5\u8be5\u6536\u76d8\u4ef7\u4ea4\u6613\u3002thinkorswim\u7684AddOrder\u751f\u6210\u7684\u662f\u5047\u8bbe\u7b56\u7565 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2836,"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":[71,520,233],"tags":[152,177,340,553,639],"class_list":["post-2835","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thinkorswim","category-520","category-233","tag-thinkorswim","tag-thinkscript","tag-340","tag-553","tag-639"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/www.patternsmart.com\/cn\/wp-content\/uploads\/2026\/11\/PS_TOS_Gap_CN.png","_links":{"self":[{"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/posts\/2835","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=2835"}],"version-history":[{"count":0,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/posts\/2835\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/media\/2836"}],"wp:attachment":[{"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/media?parent=2835"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/categories?post=2835"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.patternsmart.com\/cn\/wp-json\/wp\/v2\/tags?post=2835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}