{"id":630,"date":"2016-11-12T15:02:55","date_gmt":"2016-11-12T14:02:55","guid":{"rendered":"http:\/\/script-trading.com\/en\/?p=630"},"modified":"2024-01-28T19:09:33","modified_gmt":"2024-01-28T18:09:33","slug":"installation-ibcontroller-for-automatic-24h-stock-trading-part-2","status":"publish","type":"post","link":"https:\/\/script-trading.com\/en\/installation-ibcontroller-for-automatic-24h-stock-trading-part-2\/","title":{"rendered":"Installation IBController for automatic 24h stock trading (part 2)"},"content":{"rendered":"<p><img decoding=\"async\" class=\"aligncenter size-medium wp-image-359\" src=\"http:\/\/script-trading.com\/wp-content\/uploads\/2016\/10\/tradingtech_tws_001-300x166.png\" alt=\"tradingtech_tws_001\" width=\"300\" height=\"166\" srcset=\"https:\/\/script-trading.com\/wp-content\/uploads\/2016\/10\/tradingtech_tws_001-300x166.png 300w, https:\/\/script-trading.com\/wp-content\/uploads\/2016\/10\/tradingtech_tws_001-230x127.png 230w, https:\/\/script-trading.com\/wp-content\/uploads\/2016\/10\/tradingtech_tws_001-350x193.png 350w, https:\/\/script-trading.com\/wp-content\/uploads\/2016\/10\/tradingtech_tws_001-480x265.png 480w, https:\/\/script-trading.com\/wp-content\/uploads\/2016\/10\/tradingtech_tws_001.png 650w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><a href=\"http:\/\/script-trading.com\/en\/installation-ibcontroller-for-automatic-24h-stock-trading-part-1\/\">In the first part of this article, &#8220;Installation IBController for automatic 24h stock trading (part 1)&#8221;<\/a>, we have downloaded\u00a0and installed all\u00a0important programs. In this\u00a0second part we would like to complete\u00a0the initial configuration of IBController to enable you a 24\/7 continuous operation on stock trading.<\/p>\n<h2>Windows vs. Linux vs. Macintosh<\/h2>\n<p>TWS is based on the programming language <em>Java<\/em> which is a platform-independent language and <strong>can be used on any operating system<\/strong>. The following description is basically for all Windows users, but it can also be used for other platforms such as Linux or Macintosh.<\/p>\n<h2>Installation IBController<\/h2>\n<p>Locate your TWS installation directory. You should usually\u00a0find this directory in directory JTS on your hard drive C.<\/p>\n<p>[pastacode lang=&#8221;bash&#8221; manual=&#8221;C%3A%5CJts&#8221; message=&#8221;&#8221; highlight=&#8221;&#8221; provider=&#8221;manual&#8221;\/]<\/p>\n<p>We see a subfolder for each version (e.g. Generic, 952, 958, 960) of the TWS in the JTS directory. We currently have only one TWS version installed on our system and therefore we do\u00a0see only one subfolder with the version number 960 in our Windows Explorer.<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-654\" src=\"http:\/\/script-trading.com\/wp-content\/uploads\/2016\/12\/jts.png\" alt=\"jts\" width=\"634\" height=\"431\" srcset=\"https:\/\/script-trading.com\/wp-content\/uploads\/2016\/12\/jts.png 634w, https:\/\/script-trading.com\/wp-content\/uploads\/2016\/12\/jts-300x204.png 300w, https:\/\/script-trading.com\/wp-content\/uploads\/2016\/12\/jts-230x156.png 230w, https:\/\/script-trading.com\/wp-content\/uploads\/2016\/12\/jts-350x238.png 350w, https:\/\/script-trading.com\/wp-content\/uploads\/2016\/12\/jts-480x326.png 480w\" sizes=\"(max-width: 634px) 100vw, 634px\" \/><\/p>\n<p>IBController does not have\u00a0a sophisticated\u00a0installation procedure because you are able to install it by coping the data into the target folder.\u00a0Now move the content of the IBController *.zip file into a new directory on your hard drive C.<\/p>\n<p>[pastacode lang=&#8221;bash&#8221; manual=&#8221;C%3A%5CIBController&#8221; message=&#8221;&#8221; highlight=&#8221;&#8221; provider=&#8221;manual&#8221;\/]<\/p>\n<p>Open with a text editor the two *.bat files <strong>IBControllerStart.bat and IBControllerGatewayStart.bat in the IBController directory<\/strong> and update the <strong>TWS version number<\/strong> you are using. We use 960, so we change this version number one time in\u00a0both\u00a0*.bat files to this version number, save the files and close the editor.<\/p>\n<p>[pastacode lang=&#8221;bash&#8221; manual=&#8221;set%20TWS_MAJOR_VRSN%3D960&#8243; message=&#8221;&#8221; highlight=&#8221;&#8221; provider=&#8221;manual&#8221;\/]<\/p>\n<p>The *.sh files are &#8220;shell scripts&#8221; and are required for Linux and Macintosh. If you are using\u00a0these operating systems you should\u00a0update the *.sh files instead of the *.bat files.<\/p>\n<h2>Configuration\u00a0IBController<\/h2>\n<p>The configuration of IBController is done\u00a0via the\u00a0<em>INIT file<\/em> with the name <strong>IBController.ini<\/strong>. The file is delivered in the *.zip file.<\/p>\n<p>Now create another IBController Folder <strong>in your personal user\u00a0directory<\/strong>.<\/p>\n<p>[pastacode lang=&#8221;bash&#8221; manual=&#8221;C%3A%5CUsers%5CSimon%5CDocuments%5CIBController&#8221; message=&#8221;&#8221; highlight=&#8221;&#8221; provider=&#8221;manual&#8221;\/]<\/p>\n<p>Move the <em>INIT file<\/em> from above from the IBController installation directory to your newly created directory in your user directory.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-664\" src=\"http:\/\/script-trading.com\/wp-content\/uploads\/2016\/12\/init_file.png\" alt=\"init_file\" width=\"632\" height=\"102\" srcset=\"https:\/\/script-trading.com\/wp-content\/uploads\/2016\/12\/init_file.png 632w, https:\/\/script-trading.com\/wp-content\/uploads\/2016\/12\/init_file-300x48.png 300w, https:\/\/script-trading.com\/wp-content\/uploads\/2016\/12\/init_file-230x37.png 230w, https:\/\/script-trading.com\/wp-content\/uploads\/2016\/12\/init_file-350x56.png 350w, https:\/\/script-trading.com\/wp-content\/uploads\/2016\/12\/init_file-480x77.png 480w\" sizes=\"(max-width: 632px) 100vw, 632px\" \/><\/p>\n<div class=\"\">In this <em>INIT file<\/em> in your user directory, we will now make all configurations. Open the <em>INIT file<\/em>\u00a0in an editor and scroll down to the <strong>IB API Authentication Settings<\/strong> area. In this area you should enter your login data for your broker (Interactive Broker or Captrader). Login data is\u00a0required to allow IBController the\u00a0automatically log in to your broker.<\/div>\n<div class=\"\"><\/div>\n<div class=\"\">Scroll down to\u00a0<strong>IbAutoClosedown (area 4)<\/strong> and set this to <strong>IbAutoClosedown=no<\/strong>.\u00a0This setting allows us to trade an automatic 24\/7 stock trading because TWS is no longer automatically closed.<\/div>\n<div class=\"\"><\/div>\n<div class=\"\">In addition, the following items should be\u00a0adapted in the <em>INIT file<\/em>:<\/div>\n<ul>\n<li><strong>LogToConsole=yes (area\u00a01)<\/strong><br \/>\nFrom our point of view, this setting is an advantage because\u00a0the more logging data is generated, the easier is it to\u00a0search for errors.<\/li>\n<li><strong>ClosedownAt=Saturday 21:00 (area 5)<\/strong><br \/>\nIt is recommended to restart the TWS in regular intervals. This setting would shut down the TWS every Saturday night.<br \/>\nIf you have installed the german version of JAVA\u00a0you should format\u00a0this text in german language:\u00a0<strong>Samstag\u00a021:00<\/strong>. More information about localization and date objects\u00a0please have a look in the java docs:\u00a0<a href=\"http:\/\/docs.oracle.com\/javase\/6\/docs\/api\/java\/text\/SimpleDateFormat.html#text\">http:\/\/docs.oracle.com\/javase\/6\/docs\/api\/java\/text\/SimpleDateFormat.html#text<\/a><\/li>\n<\/ul>\n<div>After we have saved and closed the <em>INIT file<\/em>, the configuration is ready and we are able to\u00a0start our IBController by double-clicking the start file <strong>IBControllerStart.bat<\/strong>.<\/div>\n<div>\n<div>\n<h2>Autostart TWS using Task Scheduler<\/h2>\n<\/div>\n<div>Basically\u00a0the TWS is able to\u00a0work in 24\/7 operation when we start the IBController via the * .bat file. There is an additional possibility for automation using task scheduler.\u00a0In this case TWS would automatically start in 24\/7 mode each time the computer was started.<\/div>\n<div><\/div>\n<\/div>\n<div>Have fun with 24\/7 trading of financial products using TWS!<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In the first part of this article, &#8220;Installation IBController for automatic 24h stock trading (part 1)&#8221;, we have downloaded\u00a0and installed all\u00a0important programs. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":359,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"categories":[62,31,32],"tags":[26,23,25,24],"class_list":["post-630","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-english","category-tws-en","category-tws","tag-captrader","tag-github","tag-interactive-broker","tag-tws"],"_links":{"self":[{"href":"https:\/\/script-trading.com\/en\/wp-json\/wp\/v2\/posts\/630","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/script-trading.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/script-trading.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/script-trading.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/script-trading.com\/en\/wp-json\/wp\/v2\/comments?post=630"}],"version-history":[{"count":42,"href":"https:\/\/script-trading.com\/en\/wp-json\/wp\/v2\/posts\/630\/revisions"}],"predecessor-version":[{"id":738,"href":"https:\/\/script-trading.com\/en\/wp-json\/wp\/v2\/posts\/630\/revisions\/738"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/script-trading.com\/en\/wp-json\/wp\/v2\/media\/359"}],"wp:attachment":[{"href":"https:\/\/script-trading.com\/en\/wp-json\/wp\/v2\/media?parent=630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/script-trading.com\/en\/wp-json\/wp\/v2\/categories?post=630"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/script-trading.com\/en\/wp-json\/wp\/v2\/tags?post=630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}