{"id":176,"date":"2024-07-13T07:57:10","date_gmt":"2024-07-12T23:57:10","guid":{"rendered":"http:\/\/123.60.176.65\/?p=176"},"modified":"2024-07-13T07:57:10","modified_gmt":"2024-07-12T23:57:10","slug":"%e6%89%8b%e6%8a%8a%e6%89%8b%e6%95%99%e4%bd%a0ai%e9%a1%be%e6%8a%95%ef%bc%9a%e5%88%a9%e7%94%a8%e7%9b%88%e9%80%8f-api-%e9%a9%b1%e5%8a%a8-ai-%e7%ad%96%e7%95%a5%e5%ae%9e%e7%8e%b0%e7%be%8e%e8%82%a1%e8%87%aa","status":"publish","type":"post","link":"https:\/\/laoyulaoyu.com\/index.php\/2024\/07\/13\/%e6%89%8b%e6%8a%8a%e6%89%8b%e6%95%99%e4%bd%a0ai%e9%a1%be%e6%8a%95%ef%bc%9a%e5%88%a9%e7%94%a8%e7%9b%88%e9%80%8f-api-%e9%a9%b1%e5%8a%a8-ai-%e7%ad%96%e7%95%a5%e5%ae%9e%e7%8e%b0%e7%be%8e%e8%82%a1%e8%87%aa\/","title":{"rendered":"\u624b\u628a\u624b\u6559\u4f60ai\u987e\u6295\uff1a\u5229\u7528\u76c8\u900f API \u9a71\u52a8 AI \u7b56\u7565\u5b9e\u73b0\u7f8e\u80a1\u81ea\u52a8\u4ea4\u6613\uff08\u4e00\uff09"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<pre class=\"wp-block-verse\"><strong>\u5199\u5728\u524d\u9762\u7684\u8bdd\uff1a<\/strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">\u76c8\u900f\u8bc1\u5238<\/mark>\uff0c\u82f1\u6587\u540d\u79f0<span class=\"wx_search_keyword_wrap\">Interactive Brokers<i class=\"wx_search_keyword\"><\/i><\/span>\uff08\u7f29\u5199IB\uff09\uff0c\u53ef\u80fd\u662f\u76ee\u524d\u56fd\u5185\u7528\u6237\u6570\u91cf\u6700\u5927\u7684\u7f8e\u80a1\u8bc1\u5238\u7ecf\u7eaa\u5546\u4e4b\u4e00\uff0c\u5b83\u5bb6\u7684TWS API\u662f\u8bb8\u591a\u91cf\u5316\u4ea4\u6613\u5e73\u53f0\u7684\u63a5\u5165\u901a\u9053\u3002\u5728\u8fd9\u7bc7\u6587\u7ae0\u6211\u4f1a\u8be6\u7ec6\u8bf4\u660e\u5982\u4f55\u4f7f\u7528\u76c8\u900f\u8bc1\u5238API\u8fdb\u884c\u7f8e\u80a1\u7684\u59d4\u6258\u4e0b\u5355\u548c\u91cf\u5316\u4ea4\u6613\u3002\u9996\u5148\uff0c\u6211\u4f1a\u4ecb\u7ecd\u4e3a\u4ec0\u4e48\u4f7f\u7528\u76c8\u900f\u8bc1\u5238\u548c\u5176API\u7684\u4f18\u52bf\uff0c\u5bf9\u4e2a\u4eba\u6295\u8d44\u8005\u6765\u8bf4\uff0c\u5982\u4f55\u4e0b\u8f7d\u5e76\u8bbe\u7f6e\u76c8\u900f\u8bc1\u5238TWS\u5ba2\u6237\u7aef\uff0c\u4f7f\u5176\u652f\u6301API\u8bbf\u95ee\u3002\u7136\u540e\uff0c\u6211\u4f1a\u4ecb\u7ecd\u901a\u8fc7\u8fde\u63a5TWS\u540e\u5982\u4f55\u8fdb\u884c\u81ea\u52a8\u59d4\u6258\u4e0b\u5355\u7684\u65b9\u6cd5\u3002\u6700\u540e\u6211\u4ee5\u57fa\u4e8e\u7edf\u8ba1\u5957\u5229\u7684\u914d\u5bf9\u4ea4\u6613\u7b56\u7565\u4e3a\u4f8b\uff0c<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">\u4ecb\u7ecdAI\u4ea4\u6613\u7b56\u7565\u5f00\u53d1\u53ca\u5b9e\u76d8\u64cd\u4f5c\u7684\u5168\u8fc7\u7a0b\uff0c\u6700\u7ec8\u5b9e\u73b0\u81ea\u52a8\u5316\u4ea4\u6613\u3002<\/mark><\/pre>\n<\/blockquote>\n\n\n\n<p><strong>\u4e00\u3001&nbsp;IB\u76c8\u900f\u8bc1\u5238\u7b80\u4ecb<\/strong><\/p>\n\n\n\n<p>\u76c8\u900f\u8bc1\u5238\uff08Interactive Brokers\uff0c\u7b80\u79f0IB\uff09\u662f\u5168\u7403\u9886\u5148\u7684\u7535\u5b50\u4ea4\u6613\u5e73\u53f0\uff0c\u63d0\u4f9b\u5e7f\u6cdb\u7684\u91d1\u878d\u4ea7\u54c1\uff0c\u5305\u62ec\u80a1\u7968\u3001\u671f\u8d27\u3001\u671f\u6743\u3001\u5916\u6c47\u7b49\u3002\u51ed\u501f\u5176\u4f4e\u4f63\u91d1\u548c\u9ad8\u6548\u7684\u6267\u884c\u901f\u5ea6\uff0c\u76c8\u900f\u8bc1\u5238\u5438\u5f15\u4e86\u4f17\u591a\u4ea4\u6613\u5458\u548c\u6295\u8d44\u8005\u3002IB API\u662f\u4e00\u5957\u7531\u76c8\u900f\u8bc1\u5238\u63d0\u4f9b\u7684\u7f16\u7a0b\u63a5\u53e3\uff0c\u5141\u8bb8\u7528\u6237\u901a\u8fc7\u7f16\u7a0b\u8bed\u8a00\uff08\u5982Python\u3001Java\u3001C++\u7b49\uff09\u76f4\u63a5\u4e0e\u76c8\u900f\u8bc1\u5238\u7684\u4ea4\u6613\u7cfb\u7edf\u8fdb\u884c\u4ea4\u4e92\u3002\u4f7f\u7528IB API\uff0c\u7528\u6237\u53ef\u4ee5\u5b9e\u73b0\u81ea\u52a8\u5316\u4ea4\u6613\u3001\u83b7\u53d6\u5b9e\u65f6\u5e02\u573a\u6570\u636e\u3001\u7ba1\u7406\u8d26\u6237\u4fe1\u606f\u7b49\u529f\u80fd\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft is-resized\"><img decoding=\"async\" src=\"http:\/\/123.60.176.65\/wp-content\/uploads\/2024\/06\/640-9.webp\" alt=\"\" class=\"wp-image-182\" style=\"width:629px;height:auto\"\/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<section><strong>\u4f7f\u7528\u76c8\u900f\u8bc1\u5238API\u8fdb\u884c\u7f8e\u80a1\u91cf\u5316\u4ea4\u6613\u7684\u4f18\u52bf\uff1a<\/strong><\/section>\n\n\n\n<section>  <\/section>\n\n\n\n<section><strong>\u4f4e\u8d39\u7528<\/strong>\uff1a\u76c8\u900f\u8bc1\u5238\u7684\u4f63\u91d1\u7ed3\u6784\u900f\u660e\u4e14\u4f4e\u5ec9\uff0c\u9002\u5408\u9891\u7e41\u4ea4\u6613\u7684\u91cf\u5316\u7b56\u7565\u3002\u4f63\u91d1\u3001\u878d\u8d44\u5229\u7387\u3001\u6570\u636e\u8d39\u7528\uff0c\u51e0\u4e4e\u90fd\u662f\u884c\u4e1a\u6700\u4f4e\u6c34\u5e73\u3002<\/section>\n\n\n\n<section><strong>\u4e30\u5bcc\u7684API\u529f\u80fd<\/strong>\uff1aIB API\u652f\u6301\u5e7f\u6cdb\u7684\u4ea4\u6613\u6307\u4ee4\u548c\u5e02\u573a\u6570\u636e\u67e5\u8be2\uff0c\u6ee1\u8db3\u4e0d\u540c\u91cf\u5316\u4ea4\u6613\u7b56\u7565\u7684\u9700\u6c42\u3002<\/section>\n\n\n\n<section><strong>\u9ad8\u6548\u7684\u6267\u884c\u901f\u5ea6<\/strong>\uff1a\u76c8\u900f\u8bc1\u5238\u7684\u4ea4\u6613\u7cfb\u7edf\u54cd\u5e94\u8fc5\u901f\uff0c\u786e\u4fdd\u4ea4\u6613\u6307\u4ee4\u80fd\u591f\u53ca\u65f6\u6267\u884c\u3002<\/section>\n\n\n\n<section><strong>\u5168\u7403\u5316\u5e02\u573a\u63a5\u5165<\/strong>\uff1a\u572834\u4e2a\u56fd\u5bb6\/\u5730\u533a\u7684150\u4e2a\u5e02\u573a\u4ea4\u6613\u80a1\u7968\u3001\u671f\u6743\u3001\u671f\u8d27\u3001\u8d27\u5e01\u3001\u503a\u5238\u548c\u57fa\u91d1\u3002<\/section>\n\n\n\n<section><\/section>\n\n\n\n<section><strong>\u4e8c\u3001IB API\u5ba2\u6237\u7aefTWS\u7684\u4e0b\u8f7d\u548c\u8bbe\u7f6e<\/strong><\/section>\n\n\n\n<section><\/section>\n\n\n\n<section><strong>2.1 \u4e0b\u8f7dTWS<\/strong><\/section>\n\n\n\n<section>Trader Workstation\uff08TWS\uff09\u662f\u76c8\u900f\u8bc1\u5238\u7684\u4ea4\u6613\u5e73\u53f0\uff0c\u63d0\u4f9b\u76f4\u89c2\u7684\u56fe\u5f62\u754c\u9762\u548c\u4e30\u5bcc\u7684\u4ea4\u6613\u529f\u80fd\u3002IB&nbsp;API\u7684\u8fde\u63a5\u5bf9\u8c61\u662f\u5b89\u88c5\u5728\u7528\u6237\u7535\u8111\u4e0a\u7684IB\u5ba2\u6237\u7aefTWS\uff0c\u518d\u7531TWS\u6765\u8d1f\u8d23\u548cIB\u4ea4\u6613\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u901a\u8baf\u3002\u4e0b\u8f7d\u6b65\u9aa4\u5982\u4e0b\uff1a<\/section>\n\n\n\n<section>1\u3001\u8bbf\u95ee\u76c8\u900f\u8bc1\u5238\u5b98\u7f51\u3002<\/section>\n\n\n\n<section>2\u3001\u5728\u201cLogin\u201d\u83dc\u5355\u4e2d\u9009\u62e9\u201cTrader Workstation\u201d\u3002<\/section>\n\n\n\n<section>3\u3001\u70b9\u51fb\u4e0b\u8f7d\u94fe\u63a5\uff0c\u9009\u62e9\u9002\u5408\u60a8\u64cd\u4f5c\u7cfb\u7edf\u7684\u7248\u672c\uff08Windows\u3001Mac\u3001Linux\uff09\u3002<\/section>\n\n\n\n<section>4\u3001\u4e0b\u8f7d\u5e76\u5b89\u88c5TWS\u5ba2\u6237\u7aef\u3002<\/section>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft\"><img decoding=\"async\" src=\"http:\/\/123.60.176.65\/wp-content\/uploads\/2024\/06\/640-1-2.webp\" alt=\"\" class=\"wp-image-184\"\/><\/figure>\n<\/div>\n\n\n<section><\/section>\n\n\n\n<section><strong>2.2 \u8bbe\u7f6eTWS\u4ee5\u652f\u6301API<\/strong><\/section>\n\n\n\n<section>1\u3001\u542f\u52a8TWS\u5ba2\u6237\u7aef\u5e76\u767b\u5f55\u60a8\u7684\u8d26\u6237\uff0c\u5982\u679c\u6682\u65f6\u4e0d\u60f3\u7528\u5b9e\u76d8\u4ea4\u6613\u8d26\u6237\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u901a\u8fc7\u6a21\u62df\u4ea4\u6613\u7684\u8d26\u6237\u8fdb\u884c\u64cd\u4f5c\uff0c\u53ea\u9700\u8981\u4e00\u4e2aemail\u5373\u53ef\u3002<\/section>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft\"><img decoding=\"async\" src=\"http:\/\/123.60.176.65\/wp-content\/uploads\/2024\/06\/640-2-2.webp\" alt=\"\" class=\"wp-image-185\"\/><\/figure>\n<\/div>\n\n\n<section>2\u3001\u5728TWS\u4e3b\u754c\u9762\u4e0a\uff0c\u5bfc\u822a\u5230<code>Edit &gt; Global Configuration<\/code>\u3002<\/section>\n\n\n\n<section>3\u3001\u5728\u914d\u7f6e\u7a97\u53e3\u4e2d\uff0c\u9009\u62e9<code>API &gt; Settings<\/code>\u3002<\/section>\n\n\n\n<section>4\u3001\u52fe\u9009<code>Enable ActiveX and Socket Clients<\/code>\uff0c\u5e76\u8bbe\u7f6e\u7aef\u53e3\u53f7\uff08\u9ed8\u8ba4\u662f7496\uff09\u3002<\/section>\n\n\n\n<section>5\u3001\u786e\u8ba4\u5e76\u4fdd\u5b58\u8bbe\u7f6e\u3002<\/section>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft\"><img decoding=\"async\" src=\"http:\/\/123.60.176.65\/wp-content\/uploads\/2024\/06\/640-3-2.webp\" alt=\"\" class=\"wp-image-187\"\/><\/figure>\n<\/div>\n\n\n<p><strong>\u4e09\u3001\u7528Python\u8fde\u63a5TWS\u5e76\u8fdb\u884c\u4e0b\u5355\u4ea4\u6613<\/strong><\/p>\n\n\n\n<p><strong>3.1 \u5b89\u88c5ib-insync\u5e93<\/strong><\/p>\n\n\n\n<p><code>ib-insync<\/code>\u662f\u4e00\u4e2a\u975e\u5b98\u65b9\u7684IB API Python\u5ba2\u6237\u7aef\u5e93\uff0c\u63d0\u4f9b\u4e86\u66f4\u52a0\u7b80\u6d01\u6613\u7528\u7684\u63a5\u53e3\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n\n\n\n<section><img fetchpriority=\"high\" decoding=\"async\" class=\"size-full wp-image-186 alignleft\" src=\"http:\/\/123.60.176.65\/wp-content\/uploads\/2024\/06\/640-4-2.webp\" alt=\"\" width=\"628\" height=\"164\"><\/section>\n\n\n\n<section><strong>3.2 \u8fde\u63a5TWS\u5e76\u8fdb\u884c<span class=\"wx_search_keyword_wrap\">\u5e02\u4ef7\u59d4\u6258<i class=\"wx_search_keyword\"><\/i><\/span><\/strong><\/section>\n\n\n\n<section><\/section>\n\n\n\n<section>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528<code>ib-insync<\/code>\u5e93\u8fde\u63a5TWS\u5e76\u8fdb\u884c\u5e02\u4ef7\u59d4\u6258\u7684\u4f8b\u5b50\uff1a<\/section>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft\"><img decoding=\"async\" src=\"http:\/\/123.60.176.65\/wp-content\/uploads\/2024\/06\/640-5-2.webp\" alt=\"\" class=\"wp-image-188\"\/><\/figure>\n<\/div>\n\n\n<section>\u5728TWS\u5ba2\u6237\u7aef\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u8ba2\u5355\uff1a<\/section>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft\"><img decoding=\"async\" src=\"http:\/\/123.60.176.65\/wp-content\/uploads\/2024\/06\/640-6-2.webp\" alt=\"\" class=\"wp-image-190\"\/><\/figure>\n<\/div>\n\n\n<section><strong>3.3 \u8fde\u63a5TWS\u5e76\u8fdb\u884c\u9650\u4ef7\u59d4\u6258<\/strong><\/section>\n\n\n\n<section><\/section>\n\n\n\n<section>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f7f\u7528<code>ib-insync<\/code>\u5e93\u8fde\u63a5TWS\u5e76\u8fdb\u884c\u9650\u4ef7\u59d4\u6258\u7684\u4f8b\u5b50\uff1a<\/section>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft\"><img decoding=\"async\" src=\"http:\/\/123.60.176.65\/wp-content\/uploads\/2024\/06\/640-7-1.webp\" alt=\"\" class=\"wp-image-191\"\/><\/figure>\n<\/div>\n\n\n<p>\u5728TWS\u5ba2\u6237\u7aef\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u8ba2\u5355\uff1a<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft\"><img decoding=\"async\" src=\"http:\/\/123.60.176.65\/wp-content\/uploads\/2024\/06\/640-8-1.webp\" alt=\"\" class=\"wp-image-192\"\/><\/figure>\n<\/div>\n\n\n<section><strong>3.4 \u83b7\u53d6\u80a1\u7968\u7684\u5386\u53f2\u6570\u636e<\/strong><\/section>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft\"><img decoding=\"async\" src=\"http:\/\/123.60.176.65\/wp-content\/uploads\/2024\/06\/640-9-1.webp\" alt=\"\" class=\"wp-image-193\"\/><\/figure>\n<\/div>\n\n\n<p>\u5230\u8fd9\u91cc\u5982\u4f55\u4e0b\u8f7d\u5e76\u8bbe\u7f6e\u76c8\u900f\u8bc1\u5238TWS\u5ba2\u6237\u7aef\uff0c\u4f7f\u5176\u652f\u6301API\u8bbf\u95ee\u3002\u7136\u540e\u901a\u8fc7\u8fde\u63a5TWS\u540e\u5982\u4f55\u8fdb\u884c\u81ea\u52a8\u59d4\u6258\u4e0b\u5355\u7684\u65b9\u6cd5\u5df2\u7ecf\u4ecb\u7ecd\u5b8c\u6bd5\u4e86\uff0c\u4e0b\u4e00\u7bc7\u4e2d\u6211\u4f1a\u4ee5\u57fa\u4e8e\u7edf\u8ba1\u5957\u5229\u7684\u914d\u5bf9\u4ea4\u6613\u7b56\u7565\u4e3a\u4f8b\uff0c\u4ecb\u7ecdAI\u4ea4\u6613\u7b56\u7565\u5f00\u53d1\u53ca\u5b9e\u76d8\u64cd\u4f5c\u7684\u5168\u8fc7\u7a0b\uff0c\u6700\u7ec8\u5b9e\u73b0\u81ea\u52a8\u5316\u4ea4\u6613\u3002<\/p>\n\n\n\n<p class=\"has-text-align-center has-cyan-bluish-gray-color has-text-color has-link-color wp-elements-bd402b7c146898dcf3d05749282e5860\"><strong>\u672c\u6587\u5185\u5bb9\u4ec5\u4ec5\u662f\u6280\u672f\u63a2\u8ba8\u548c\u5b66\u4e60\uff0c\u5e76\u4e0d\u6784\u6210\u4efb\u4f55\u6295\u8d44\u5efa\u8bae\u3002<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5199\u5728\u524d\u9762\u7684\u8bdd\uff1a\u76c8\u900f\u8bc1\u5238\uff0c\u82f1\u6587\u540d\u79f0Interacti&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/laoyulaoyu.com\/index.php\/2024\/07\/13\/%e6%89%8b%e6%8a%8a%e6%89%8b%e6%95%99%e4%bd%a0ai%e9%a1%be%e6%8a%95%ef%bc%9a%e5%88%a9%e7%94%a8%e7%9b%88%e9%80%8f-api-%e9%a9%b1%e5%8a%a8-ai-%e7%ad%96%e7%95%a5%e5%ae%9e%e7%8e%b0%e7%be%8e%e8%82%a1%e8%87%aa\/\">Continue reading<span class=\"screen-reader-text\">\u624b\u628a\u624b\u6559\u4f60ai\u987e\u6295\uff1a\u5229\u7528\u76c8\u900f API \u9a71\u52a8 AI \u7b56\u7565\u5b9e\u73b0\u7f8e\u80a1\u81ea\u52a8\u4ea4\u6613\uff08\u4e00\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":[5],"class_list":["post-176","post","type-post","status-publish","format-standard","hentry","category-aiinvest","tag-ai","entry"],"_links":{"self":[{"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts\/176","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/comments?post=176"}],"version-history":[{"count":0,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/posts\/176\/revisions"}],"wp:attachment":[{"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/media?parent=176"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/categories?post=176"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/laoyulaoyu.com\/index.php\/wp-json\/wp\/v2\/tags?post=176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}