{"id":226904,"date":"2025-07-15T14:36:53","date_gmt":"2025-07-15T18:36:53","guid":{"rendered":"https:\/\/ibkrcampus.com\/campus\/?p=226904"},"modified":"2025-07-31T11:46:50","modified_gmt":"2025-07-31T15:46:50","slug":"shinybroker-part-i-hello-world","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/shinybroker-part-i-hello-world\/","title":{"rendered":"ShinyBroker Part I: Hello World"},"content":{"rendered":"\n<p><strong><em>The author of this article is not affiliated with Interactive Brokers. The software is in no way affiliated, endorsed, or approved by Interactive Brokers or any of its affiliates. It comes with absolutely no warranty and should not be used in actual trading unless the user can read and understand the source. The IBKR API team does not support this software.<\/em><\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/shinybroker.com\/\"><strong>ShinyBroker<\/strong><\/a>&nbsp;represents the independent scholarship of the authors\/creators and is not sponsored by or attributed to Duke University.&nbsp; ANY USE OF SHINYBROKER IS AT THE USER\u2019S SOLE RISK.&nbsp; In no event shall Duke University be liable to you, the user, or any other individual or entity, whether such liability is based on contract, negligence, strict liability in tort, warranty, or any other legal or equitable theory, for relieve arising out of or relating the use of ShinyBroker.&nbsp; Further, in no event shall Duke University be responsible or liable for any direct, indirect, special, incidental, or consequential damages or lost profits or other economic loss or damage with respect to ShinyBroker to you, the user, or any other individual or entity regardless of legal or equitable theory.&nbsp; Further, for more information, review the LICENSE agreement included with the package and posted online at <a href=\"https:\/\/shinybroker.com\/LICENSE.html\">https:\/\/shinybroker.com\/LICENSE.html<\/a>. Feature requests and bug reports are welcome on our <a href=\"https:\/\/github.com\/JakeVestal\/shinybroker\/issues\">GitHub Issues Page<\/a> as we continue build up a full-featured platform for use in and outside the classroom.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-shinybroker-lets-you-build-the-trading-system-you-want-in-shiny-and-connect-it-with-interactive-brokers\">ShinyBroker lets you build the trading system you want in Shiny and connect it with Interactive Brokers.<\/h2>\n\n\n\n<p>This &#8216;hello world&#8217; walkthrough shows you how to set up a good development environment, install the ShinyBroker package, connect it to a running instance of TraderWorkstation (TWS) or IB Gateway (IBG), explore a few of the default market data features, and use Shiny to create a functioning user interface. The next article in this series will explain how to fetch, process, and graphically display market data from IBKR.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-0-project-setup\">Step 0: Project Setup<\/h2>\n\n\n\n<p>The ShinyBroker package, and the examples in the documentation, were created with&nbsp;<a href=\"https:\/\/www.jetbrains.com\/pycharm\/download\/\">PyCharm<\/a>. You certainly&nbsp;<strong>do not<\/strong>&nbsp;have to use PyCharm, but it is used in this article series to make the material accessible to readers who aren&#8217;t old hands at dealing with environments, versions, and packages. If you follow this tutorial and use PyCharm, you will not have to worry about any of that; if you don&#8217;t, then it&#8217;s assumed you know what you&#8217;re doing and are comfortable with your own setup.<\/p>\n\n\n\n<p><strong>Use TWS unless you&#8217;re already comfortable with IBG.&nbsp;<\/strong>ShinyBroker will work fine with IB Gateway, but it&#8217;s recommended to start out with TraderWorkstation so that you can use its UI and menus to verify\/follow along with whatever you&#8217;re building in ShinyBroker.<\/p>\n\n\n\n<p><strong>Install the following<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Trader Workstation (TWS)<\/strong>&nbsp;You probably already have TWS installed if you&#8217;re reading this article but if not, install it from IBKR&#8217;s website. You may use the Demo account if you don&#8217;t own an account at IBKR.<\/li>\n\n\n\n<li><strong>Python<\/strong>: You&#8217;ll need Python, of course. Install the&nbsp;<a href=\"https:\/\/www.python.org\/downloads\/\">latest stable version<\/a>.<\/li>\n\n\n\n<li><strong>PyCharm<\/strong>: Download &amp; install from&nbsp;<a href=\"https:\/\/www.jetbrains.com\/pycharm\/download\/\">JetBrains<\/a>. The free community version is fine but if you are associated with a university, you might be interested in&nbsp;<a href=\"https:\/\/www.jetbrains.com\/academy\/student-pack\/\">JetBrain&#8217;s Student Pack&nbsp;<\/a>which gives you free access to PyCharm Pro and a lot of other interesting tools.<\/li>\n<\/ul>\n\n\n\n<p><strong>Create a new PyCharm Project<\/strong>: We&#8217;re going to set up a PyCharm project for this tutorial and instruct it to use one and only one dedicated installation of Python. This way, you don&#8217;t have to deal with all sorts of compatibility problems that may otherwise arise between different Python versions, libraries, and so on.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Open up PyCharm<\/strong>&nbsp;and create a new project. The &#8220;project&#8221; is simply a folder that stores all files related to this tutorial. You can name it whatever you want and store it in a convenient place on your computer. Give it a good, informative name that you like &#8212; it&#8217;s helpful.<\/li>\n\n\n\n<li><strong>Configure an Interpreter<\/strong>. You want to tell PyCharm to create a dedicated installation of Python only for use by this project, and you can do that by&nbsp;<em>configuring an interpreter<\/em>. You might have already created an environment for this project when you created a new project; if you did, then you&#8217;ll see a folder named &#8220;.venv&#8221; in your project directory, like in the screenshot below:<br><br><img decoding=\"async\" width=\"400\" height=\"333\" class=\"wp-image-227098 lazyload\" data-src=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/venv_success.jpg\" alt=\"ShinyBroker and API\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/venv_success.jpg 400w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/venv_success-300x250.jpg 300w\" data-sizes=\"(max-width: 400px) 100vw, 400px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 400px; aspect-ratio: 400\/333;\" \/><br><br>If your PyCharm project does&nbsp;<em>not<\/em>&nbsp;have an interpreter configured, then you will probably be prompted to create one via a clickable banner within PyCharm. If you can&#8217;t find the banner or if you closed it, you can use the&nbsp;<strong>interpreter settings<\/strong>&nbsp;menu found under File &gt; Settings. From the interpreter settings window,&nbsp;<strong>add a new local interpreter<\/strong>&nbsp;in your project folder. You should now see the &#8220;.venv&#8221; folder in your project directory like the one in the screenshot above.&nbsp;<strong>.venv<\/strong>&nbsp;contains the installation of Python that your project will use.<\/li>\n\n\n\n<li><strong>Verify that your project is using the correct interpreter<\/strong>. You can do that quickly by glancing at or mousing over the path that appears at the bottom right-hand corner of the PyCharm window &#8212; it should display the path to the .venv folder in your project directory.<br><\/li>\n<\/ol>\n\n\n\n<p><strong>Word of Advice<\/strong>: If you&#8217;ve followed these steps and are having trouble &#8212;&nbsp;<em>especially<\/em>&nbsp;if you&#8217;ve just installed everything and set up your project all in one go &#8212; then you might want to reboot your computer, or at least try exiting and restarting PyCharm.<\/p>\n\n\n\n<p>Once your development environment is set up, either by completing&nbsp;<strong>Step 0<\/strong>&nbsp;or your own project setup, you may proceed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-1-nbsp-install-shinybroker\"><strong>Step 1:&nbsp;<\/strong>Install ShinyBroker<\/h2>\n\n\n\n<p>Run the command&nbsp;<code>pip install shinybroker<\/code>&nbsp;in your project&#8217;s terminal.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"397\" height=\"241\" data-src=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/install_sb.jpg\" alt=\"ShinyBroker \" class=\"wp-image-226906 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/install_sb.jpg 397w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/install_sb-300x182.jpg 300w\" data-sizes=\"(max-width: 397px) 100vw, 397px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 397px; aspect-ratio: 397\/241;\" \/><\/figure>\n\n\n\n<p>You&#8217;ll know it installed correctly and in the right place because you&#8217;ll be able to find it in your .venv folder:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"492\" height=\"510\" data-src=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/sb_success.jpg\" alt=\"Install ShinyBroker\" class=\"wp-image-226907 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/sb_success.jpg 492w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/sb_success-300x311.jpg 300w\" data-sizes=\"(max-width: 492px) 100vw, 492px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 492px; aspect-ratio: 492\/510;\" \/><\/figure>\n\n\n\n<p>Now that ShinyBroker is installed, it&#8217;s time to make sure your TWS is set up to accept data connections from APIs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-2-nbsp-configure-tws\">Step 2:&nbsp;Configure TWS<\/h2>\n\n\n\n<p>You need to check a few settings in TWS to make sure it will permit a data connection with ShinyBroker.<\/p>\n\n\n\n<p>1. Launch TWS and sign in to your paper account (or use the demo)<\/p>\n\n\n\n<p>2. Open the API Configuration menu found at File &gt; Global Configuration &gt; API &gt; Settings.<\/p>\n\n\n\n<p>3. Check&nbsp;<strong>Enable ActiveX and Socket Clients<\/strong><\/p>\n\n\n\n<p>4. Un-check&nbsp;<strong>Read-only API<\/strong>&nbsp;to allow ShinyBroker to send orders to TWS. We won&#8217;t be using this in the current tutorial but subsequent articles will need it. Your settings menu should now look like the below:<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"500\" height=\"362\" data-src=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/api_config.jpg\" alt=\"ShinyBroker\" class=\"wp-image-227095 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/api_config.jpg 500w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/api_config-300x217.jpg 300w\" data-sizes=\"(max-width: 500px) 100vw, 500px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 500px; aspect-ratio: 500\/362;\" \/><\/figure>\n\n\n\n<p>5. Click &#8220;Apply&#8221; and &#8220;OK&#8221;<\/p>\n\n\n\n<p>6. <strong>Don&#8217;t close TWS<\/strong>. You&#8217;ll need it open and running or else ShinyBroker won&#8217;t have an IBKR connection to connect to!<\/p>\n\n\n\n<p>Next we&#8217;ll run a bare-bones ShinyBroker app to check that it runs and can connect with TWS. Reminder that&nbsp;<strong>TWS needs to be running<\/strong>&nbsp;in order for ShinyBroker to work, so if you shut it down after the previous step, you&#8217;ll need to launch it again before going on to the next.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-3-nbsp-shinybroker-test\"><strong>Step 3:&nbsp;<\/strong>ShinyBroker Test<\/h2>\n\n\n\n<p>1. Create a new Python script in PyCharm with File &gt; New, then select &#8220;Python File&#8221; and give it an informative name (the example uses &#8220;hello_world_1.py&#8221;).<\/p>\n\n\n\n<p>2. Paste the code below into your script:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import shinybroker as sb\n\n# Create an instance of a ShinyBroker App object using the default ui and server\napp = sb.sb_app(\n    host='127.0.0.1',  # localhost TWS is being served on your local machine\n    port=7497,         # make this match the port in your API Settings config\n    client_id=10742    # picked at random, choose another Client ID if preferred\n)\n\n# Run the app\napp.run()<\/pre>\n\n\n\n<p>3. <strong>Run your Python script<\/strong>. There are many ways to do so, but one quick and easy way is to highlight all of the code in your script with &#8220;select all&#8221;, right-click the selection, and choose &#8220;Execute Selection in Python Console&#8221;. It&#8217;s even faster with keyboard shortcuts, e.g., for a Mac: command-A to select all, then alt-shift-E to execute. You can find those commands, and their shortcuts, by right-clicking on highlighted code in PyCharm.<\/p>\n\n\n\n<p>4. After you execute the code PyCharm will launch a new Python console to run the code you told it to run. Your screen should look something like the below. You can see what the code you ran did: it created a ShinyBroker app object and told it where to find an IBKR connection by specifying&nbsp;<code>host<\/code>,&nbsp;<code>port<\/code>, and&nbsp;<code>client_id<\/code>. By itself, that&nbsp;<code>app<\/code>&nbsp;object does nothing but sit there in variable space; to make it run, you have to call its&nbsp;<code>run<\/code>&nbsp;method, which we did in the final line of the sample code when we called&nbsp;<code>app.run()<\/code>. That command is the one that started the continuously-running Python process that you see in your Console. That process serves your ShinyBroker app at the blue hyperlink appearing in the command line output. The app will continue to run until you tell it to stop (e.g., by clicking the red square in the Python Console in PyCharm).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"700\" height=\"729\" data-src=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/code_execution_success.jpg\" alt=\"ShinyBroker Lets You Build the Trading System You Want\" class=\"wp-image-227025 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/code_execution_success.jpg 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/code_execution_success-300x312.jpg 300w\" data-sizes=\"(max-width: 700px) 100vw, 700px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 700px; aspect-ratio: 700\/729;\" \/><\/figure>\n\n\n\n<p>5. To view your app,&nbsp;<strong>click the hyperlink in the command line output<\/strong>. Doing so will open your first ShinyBroker App in your default browser! You can also copy-paste the url into a browser of your choice. (And if you&#8217;re thinking&nbsp;<em>can I serve the app on one computer and access the app via browser from another computer\/phone in a different location<\/em>&nbsp;the answer is &#8220;yes, you can&#8221;, but that&#8217;s a later topic)<\/p>\n\n\n\n<p>Interact with the app and make note of a few important points.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-4-nbsp-explore-the-app\"><strong>Step 4:&nbsp;<\/strong>Explore the App<\/h2>\n\n\n\n<p>When you navigate a browser to the url at which your app is being served, you should be greeted with an app that looks something like the screen snip below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"700\" height=\"578\" data-src=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/sb_app_running.jpg\" alt=\"ShinyBroker Lets You Build the Trading System You Want\" class=\"wp-image-227028 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/sb_app_running.jpg 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/sb_app_running-300x248.jpg 300w\" data-sizes=\"(max-width: 700px) 100vw, 700px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 700px; aspect-ratio: 700\/578;\" \/><\/figure>\n\n\n\n<p>Take a few minutes to poke around in the app and try out some of the default tabs &amp; tools provided for tasks involving market data, contract matching, socket messages from IBKR, and so on.<\/p>\n\n\n\n<p><strong>Especially important to note<\/strong>&nbsp;is the section on the home page, which currently reads&nbsp;<code>no ui passed to sb_ui()<\/code>. That space is special &#8212; it is reserved for you, the trader, to put UI elements and controls for your trading system. Since no ui was specified when we created this simple app object in this hello world example, ShinyBroker is telling you that it&#8217;s empty.<\/p>\n\n\n\n<p>We&#8217;ll conclude this tutorial in the next step by injecting a little bit of ui into that space.<\/p>\n\n\n\n<p>When you&#8217;re finished exploring the app and ready to move on,&nbsp;<strong>stop<\/strong>&nbsp;the app from running by clicking the red square button in the console tab in PyCharm.<\/p>\n\n\n\n<p>You&#8217;re now ready for the final step in this tutorial in which you&#8217;ll add a bit of live, functional UI to your ShinyBroker app.<\/p>\n\n\n\n<p>If you&#8217;re new to Shiny and reactive programming it is very highly recommended that you brush up on the basics by reviewing some of the very accessible and informative videos that the team at Posit has created to teach this topic. The video tutorial below, by&nbsp;<a href=\"https:\/\/www.linkedin.com\/in\/winstonchang1\/\">Winston Chang<\/a>&nbsp;of&nbsp;<a href=\"https:\/\/posit.co\/\">Posit<\/a>, is an excellent place to start. As you watch, remember that&nbsp;<em>anything you can build in Shiny, you can use in ShinyBroker<\/em>.<\/p>\n\n\n\n<p><div class=\"videoWrapper\"><div class=\"videoWrapper\">\r\n            <div data-youtube-id=\"sG2dWWothoM\" class=\"yt-video-blocked video-overlay lazyload\"\r\n                 style=\"background-image:inherit;\" data-bg-image=\"url(&#039;https:\/\/img.youtube.com\/vi\/sG2dWWothoM\/hqdefault.jpg&#039;)\">\r\n                <div>\r\n                    <p class=\"text-large mb-4\">\r\n                        To watch this video you must accept functional cookies.\r\n                    <\/p>\r\n                    <button class=\"btn btn-primary w-50 manage-cookies\">\r\n                        Manage Cookies\r\n                    <\/button>\r\n                <\/div>\r\n            <\/div>\r\n        <\/div><\/div><p>\n\n\n\n<p>Now it&#8217;s time for the real learning &amp; takeaway part of this tutorial. Let&#8217;s take a minute to understand and appreciate that all user interfaces must necessarily operate on the same basic principle:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Some kind of new information becomes available as&nbsp;<strong>input<\/strong>; for example: user keystrokes, the market price of an asset changes, an order fills, etc. No matter what its form or purpose, the point is that some kind of&nbsp;<em>change&nbsp;<\/em>has taken place meaning that there is&nbsp;<em>new<\/em>, or, equivalently,&nbsp;<em>updated<\/em>&nbsp;data available that is of importance to you, the trader. Information like this shows up&nbsp;<em>asynchronously<\/em>, meaning that there is no way to tell when or if it will become available. Therefore a system like ShinyBroker must always be on the ball and ready to handle incoming data as it comes in from the brokerage connection.<\/li>\n\n\n\n<li>Incoming data is collected by a server function, whose job it is to&nbsp;<strong>process<\/strong>&nbsp;the data into a useful return value and pass that value to the appropriate place in your app. For example, the input data might be a time-indexed list containing the past hour&#8217;s prices for a stock at 1-minute intervals, and a server function&#8217;s job might be to accept that list as input and return the timestamp of the highest (or lowest, etc.) price during the period.<\/li>\n\n\n\n<li>The server function may pass its return value to just about anything the trader can dream up but its ultimate fate is to be displayed to the trader as some sort of&nbsp;<strong>output<\/strong>&nbsp;that is understandable to the trader; for example: a plot, an updated forecast calculation, or a text box.<\/li>\n<\/ol>\n\n\n\n<p>This tutorial culminates in the next step, which will show you how to implement this process using the magic of Shiny, which was written to&nbsp;<em>greatly<\/em>&nbsp;simplify the entire&nbsp;<strong>input<\/strong>&nbsp;-&gt;&nbsp;<strong>processing<\/strong>&nbsp;-&gt;&nbsp;<strong>output<\/strong>&nbsp;loop, making these kinds of systems much easier for the trader to build.<\/p>\n\n\n\n<p>Our newly added ui will cause the ShinyBroker app to operate as follows:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The user inputs a string to an input text box<\/li>\n\n\n\n<li>A server function watches the contents of the text box and when it changes, it appends the string &#8220;<strong>You entered &#8216;<\/strong>&#8221; to the beginning of the input&#8217;s text, and appends &#8220;<strong>&#8216;.<\/strong>&#8221; to the end; therefore, the resulting string is &#8220;<strong>You entered &#8216;{string that you entered}&#8217;.<\/strong>&#8220;.<\/li>\n\n\n\n<li>The return string is passed to an output text box where you, the trader, can read it.<\/li>\n<\/ol>\n\n\n\n<p>To accomplish this feat we&#8217;ll need to add 3 new elements to our ShinyBroker app:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>A&nbsp;<strong>text input box<\/strong>&nbsp;so that the user has something to type into<\/li>\n\n\n\n<li>A&nbsp;<strong>server function<\/strong>&nbsp;that performs the string appending steps<\/li>\n\n\n\n<li>A&nbsp;<strong>text output<\/strong>&nbsp;that displays the final string<\/li>\n<\/ol>\n\n\n\n<p><strong><u>You can build just about anything you want starting from this humble example<\/u><\/strong>&nbsp;simply by keeping the &#8220;input -&gt; processing -&gt; output&#8221; data flow in your mind and making intelligent use of the buttons, widgets, plots, and other Python tools that are readily available in Shiny and other Python packages.<\/p>\n\n\n\n<p>Please try the next step now.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-step-5-add-some-ui-to-the-app\"><strong>Step 5: Add some UI to the app<\/strong><\/h2>\n\n\n\n<p>First, we&#8217;ll need the two pieces of UI that will appear on the web page: an input for the user to type into, and an output to see the result. We&#8217;ll use the&nbsp;<code>input_text<\/code>&nbsp;and&nbsp;<code>output_code<\/code>&nbsp;objects made available by the&nbsp;<code>ui<\/code>&nbsp;object in Shiny, and store them together in a&nbsp;<code>div<\/code>, with the input on top of the output.&nbsp;<a href=\"https:\/\/shiny.posit.co\/py\/components\/\">All sorts of different components are available<\/a>&nbsp;both in Shiny and in other packages like&nbsp;<a href=\"https:\/\/shiny.posit.co\/py\/docs\/jupyter-widgets.html\">shinywidgets<\/a>, or you can&nbsp;<a href=\"https:\/\/shiny.posit.co\/py\/docs\/custom-components-pkg.html\">build your own<\/a>. In this example, however, we&#8217;ll only need two components:&nbsp;<code>input_text<\/code>&nbsp;and&nbsp;<code>output_code<\/code>. In the code below we use these components to create a new piece of ui and assign to it the appropriate name&nbsp;<code>a_piece_of_new_ui<\/code>.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from shiny import ui\n\n# Some UI to add to the app\na_piece_of_new_ui = ui.div(\n    ui.input_text(\n        id='sb_example_text_in',\n        label='Example Input. Type something!'\n    ),\n    ui.output_code('sb_example_text_out')\n)<\/pre>\n\n\n\n<p>Now we need some logic: a function that recognizes the input text box (which we named&nbsp;<code>sb_example_text_in<\/code>&nbsp;above) as an input that it needs to watch. It should also possess the additional properties such that, whenever the text in the input changes, the function executes, calculates the new string that we want for the text output, and sends that value to the output object that we named&nbsp;<code>sb_example_text_out<\/code>. ShinyBroker uses the Shiny framework (see the video above) to simplify of all the &#8216;watching and updating&#8217; tasks in order to make it easy to write a function that does the job.<\/p>\n\n\n\n<p>In Shiny-speak, what we want to write is called a&nbsp;<strong>rendering function<\/strong>, a special type of function that was created for exactly the kind of &#8216;watching and updating&#8217; functionality that we need. A suitable rendering function is provided below but if you&#8217;re new to Shiny, consider the following bullet points to help you understand rendering functions and why the code is written the way it is so that you can be better equipped to write your own.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Shiny takes into consideration the names you give to your server functions and uses them to figure out where the return values should be passed. In most use cases, including the current tutorial, that&#8217;s a lot simpler than it sounds because it boils down to:&nbsp;<em>when you write your function,&nbsp;<strong>just give it the same name as the output you want it to update<\/strong><\/em>. That simple &#8216;rule&#8217; will get you through 95% of your use cases. In our case, we want to update the output object named&nbsp;<code>sb_example_text_out<\/code>, so that&#8217;s the name we&#8217;ll assign to our function.<\/li>\n\n\n\n<li>We want the function to run every time the value of the input box&nbsp;<code>sb_example_text_in<\/code>&nbsp;changes, so somewhere within the function&#8217;s body we&#8217;ll need to call&nbsp;<code>input.sb_example_text_in()<\/code>&nbsp;to fetch the contents of the input box. Shiny handles the rest, which is extremely convenient because it allows you to treat&nbsp;<code>input .sb_example_text_in()<\/code>&nbsp;almost like a variable that you can always trust to contain &#8220;whatever is currently in the input box&#8221;. Note that calling an input function to get its value carries with it a computational expense, so if you find yourself making calls to the same input more than once within the same render function, it&#8217;s probably bad code. You&#8217;re most likely better off if you just make the call&nbsp;<em>once<\/em>, store the input&#8217;s value as a local variable, and then use that variable in the rest of your function code.<\/li>\n\n\n\n<li>Finally, we want to communicate to Shiny that our function is indeed a&nbsp;<a href=\"https:\/\/shiny.posit.co\/r\/getstarted\/build-an-app\/reactive-flow\/render-functions.html\">rendering function<\/a>, which we can do by decorating it with a&nbsp;<code>@render<\/code>&nbsp;decorator. All sorts of render decorators are available, and of course you can&nbsp;<a href=\"https:\/\/shiny.posit.co\/py\/api\/core\/Renderer.html\">write your own<\/a>, but we&#8217;ll be using&nbsp;<code>@render.code<\/code>&nbsp;so that the output text looks cool and monospaced-formatted like computer code. You can try stopping and re-running your app with other decorators like&nbsp;<code>@render.text<\/code>&nbsp;to see what happens with other sorts of decorators.<\/li>\n<\/ul>\n\n\n\n<p>Taking all that into account, a render function that suits our purposes might look like the one below:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">    @render.code\n    def sb_example_text_out():\n        return f\"You entered '{input.sb_example_text_in()}'.\"<\/pre>\n\n\n\n<p>All that&#8217;s left is to put that function into an app! Fortunately, ShinyBroker makes that easy. In practice, when making a real trading app, you will probably have tons of different functions required to make the app work, perhaps stored in different files, doing tasks like calculating your models, updating your charts, outputs, and so on. No matter how many you have, you can include all your functions in your&nbsp;<code>app<\/code>&nbsp;simply by wrapping them into one overall&nbsp;<strong>server function<\/strong>&nbsp;that you can pass to&nbsp;<code>sb.sb_app()<\/code>&nbsp;when you build your ShinyBroker app. It does not matter what you name your server function; the only requirement is that its signature contains the five parameters&nbsp;<code>input: Inputs, output: Outputs, session: Session, ib_socket, sb_rvs<\/code>. The part of your app that you, the trader, will write will not always, or even usually, make use all five parameters explicitly, but they need to be there in your server function so that ShinyBroker can keep track of session information in its internals.<\/p>\n\n\n\n<p>Below, we do exactly that: wrap the render function we just wrote into a new server function named&nbsp;<code>a_server_function<\/code>.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from shiny import Inputs, Outputs, Session, ui, render\n\n# Server to support the new UI\n# Signature must always contain the following five parameters:\n#   input, output, session, ib_socket, and sb_rvs\ndef a_server_function(\n        input: Inputs, output: Outputs, session: Session, ib_socket, sb_rvs\n):\n    @render.code\n    def sb_example_text_out():\n        return f\"You entered '{input.sb_example_text_in()}'.\"<\/pre>\n\n\n\n<p>And finally&#8230;&nbsp;<strong>here comes the magic of ShinyBroker<\/strong>. We can create a new ShinyBroker app by passing our ui and server functions as arguments to&nbsp;<code>sb_app<\/code>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import shinybroker as sb\n\n# Create a ShinyBroker app with the new ui and server\napp = sb.sb_app(\n    a_piece_of_new_ui,\n    a_server_function,\n    host='127.0.0.1',\n    port=7497,\n    client_id=10742\n)<\/pre>\n\n\n\n<p>And that&#8217;s it! Altogether, the fully completed code example, including&nbsp;<code>app.run()<\/code>, can be found below:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import shinybroker as sb\nfrom shiny import Inputs, Outputs, Session, ui, render\n\n\n# Some UI to add to the app\na_piece_of_new_ui = ui.div(\n    ui.input_text(\n        id='sb_example_text_in',\n        label='Example Input. Type something!'\n    ),\n    ui.output_code('sb_example_text_out')\n)\n\n\n# Server to support the new UI\n# Signature must always contain the following five parameters:\n#   input, output, session, ib_socket, and sb_rvs\ndef a_server_function(\n        input: Inputs, output: Outputs, session: Session, ib_socket, sb_rvs\n):\n    @render.code\n    def sb_example_text_out():\n        return f\"You entered '{input.sb_example_text_in()}'.\"\n\n\n# Create a ShinyBroker app with the new ui and server\napp = sb.sb_app(\n    a_piece_of_new_ui,\n    a_server_function,\n    host='127.0.0.1',\n    port=7497,\n    client_id=10742\n)\n\napp.run()<\/pre>\n\n\n\n<p>Run your app and view it in a browser like you did in Step 4. You should see something like the below in your Home tab, and the output should update with whatever you type into the input:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"733\" height=\"231\" data-src=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/hello_world_2.jpg\" alt=\"ShinyBroker Lets You Build the Trading System You Want in Shiny\" class=\"wp-image-227031 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/hello_world_2.jpg 733w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/hello_world_2-700x221.jpg 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/hello_world_2-300x95.jpg 300w\" data-sizes=\"(max-width: 733px) 100vw, 733px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 733px; aspect-ratio: 733\/231;\" \/><\/figure>\n\n\n\n<p>This concludes the first ShinyBroker Tutorial! To recap, we:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Performed our installation and setup<\/li>\n\n\n\n<li>Ran a test app<\/li>\n\n\n\n<li>Demonstrated how the UI and Server functions that you write in your Shiny apps can be very easily integrated into IBKR&#8217;s trading system with ShinyBroker<\/li>\n<\/ol>\n\n\n\n<p>In the next installment, we&#8217;ll be fetching, analyzing, and charting market data.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ShinyBroker is an ongoing development project at the Duke University FinTech Masters Program and is available for public use on paper accounts.<\/p>\n","protected":false},"author":1651,"featured_media":227271,"comment_status":"open","ping_status":"closed","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":true,"footnotes":""},"categories":[339,343,349,338,341],"tags":[851,806,20307,575,11708,595,20305,3456],"contributors-categories":[20294],"class_list":{"0":"post-226904","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-data-science","8":"category-programing-languages","9":"category-python-development","10":"category-ibkr-quant-news","11":"category-quant-development","12":"tag-algo-trading","13":"tag-data-science","14":"tag-duke-university-fintech-masters-program","15":"tag-ibkr-api","16":"tag-pycharm","17":"tag-python","18":"tag-shinybroker","19":"tag-trader-workstation","20":"contributors-categories-https-masters-pratt-duke-edu-fintech"},"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>ShinyBroker Part I: Hello World | IBKR Quant<\/title>\n<meta name=\"description\" content=\"ShinyBroker is an ongoing development project at the Duke University FinTech Masters Program and is available for public use on paper accounts.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/226904\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ShinyBroker Part I: Hello World\" \/>\n<meta property=\"og:description\" content=\"ShinyBroker is an ongoing development project at the Duke University FinTech Masters Program and is available for public use on paper accounts.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/shinybroker-part-i-hello-world\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-15T18:36:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T15:46:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/shinybroker-install.png\" \/>\n\t<meta property=\"og:image:width\" content=\"700\" \/>\n\t<meta property=\"og:image:height\" content=\"394\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Jacob Vestal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jacob Vestal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"16 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\n\t    \"@context\": \"https:\\\/\\\/schema.org\",\n\t    \"@graph\": [\n\t        {\n\t            \"@type\": \"NewsArticle\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/shinybroker-part-i-hello-world\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/shinybroker-part-i-hello-world\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Jacob Vestal\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/acce88c42210ff8479586fce8c83c032\"\n\t            },\n\t            \"headline\": \"ShinyBroker Part I: Hello World\",\n\t            \"datePublished\": \"2025-07-15T18:36:53+00:00\",\n\t            \"dateModified\": \"2025-07-31T15:46:50+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/shinybroker-part-i-hello-world\\\/\"\n\t            },\n\t            \"wordCount\": 3377,\n\t            \"commentCount\": 1,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/shinybroker-part-i-hello-world\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2025\\\/07\\\/shinybroker-install.png\",\n\t            \"keywords\": [\n\t                \"Algo Trading\",\n\t                \"Data Science\",\n\t                \"Duke University FinTech Masters Program\",\n\t                \"IBKR API\",\n\t                \"PyCharm\",\n\t                \"Python\",\n\t                \"ShinyBroker\",\n\t                \"Trader Workstation\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Programming Languages\",\n\t                \"Python Development\",\n\t                \"Quant\",\n\t                \"Quant Development\"\n\t            ],\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"CommentAction\",\n\t                    \"name\": \"Comment\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/shinybroker-part-i-hello-world\\\/#respond\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/shinybroker-part-i-hello-world\\\/\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/shinybroker-part-i-hello-world\\\/\",\n\t            \"name\": \"ShinyBroker Part I: Hello World | IBKR Campus US\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\"\n\t            },\n\t            \"primaryImageOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/shinybroker-part-i-hello-world\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/shinybroker-part-i-hello-world\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2025\\\/07\\\/shinybroker-install.png\",\n\t            \"datePublished\": \"2025-07-15T18:36:53+00:00\",\n\t            \"dateModified\": \"2025-07-31T15:46:50+00:00\",\n\t            \"description\": \"ShinyBroker is an ongoing development project at the Duke University FinTech Masters Program and is available for public use on paper accounts.\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/shinybroker-part-i-hello-world\\\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"ImageObject\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/shinybroker-part-i-hello-world\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2025\\\/07\\\/shinybroker-install.png\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2025\\\/07\\\/shinybroker-install.png\",\n\t            \"width\": 700,\n\t            \"height\": 394,\n\t            \"caption\": \"ShinyBroker\"\n\t        },\n\t        {\n\t            \"@type\": \"WebSite\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"name\": \"IBKR Campus US\",\n\t            \"description\": \"Financial Education from Interactive Brokers\",\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"SearchAction\",\n\t                    \"target\": {\n\t                        \"@type\": \"EntryPoint\",\n\t                        \"urlTemplate\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/?s={search_term_string}\"\n\t                    },\n\t                    \"query-input\": {\n\t                        \"@type\": \"PropertyValueSpecification\",\n\t                        \"valueRequired\": true,\n\t                        \"valueName\": \"search_term_string\"\n\t                    }\n\t                }\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"Organization\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\",\n\t            \"name\": \"Interactive Brokers\",\n\t            \"alternateName\": \"IBKR\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"logo\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\",\n\t                \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"width\": 669,\n\t                \"height\": 669,\n\t                \"caption\": \"Interactive Brokers\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\"\n\t            },\n\t            \"publishingPrinciples\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/about-ibkr-campus\\\/\",\n\t            \"ethicsPolicy\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/cyber-security-notice\\\/\"\n\t        },\n\t        {\n\t            \"@type\": \"Person\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/acce88c42210ff8479586fce8c83c032\",\n\t            \"name\": \"Jacob Vestal\",\n\t            \"description\": \"As an Executive in Residence at the Duke University FinTech Masters Program, I guide students and professionals in applying cutting-edge technology to complex challenges in global financial markets. With extensive software design expertise, I have delivered innovative solutions for government agencies, leveraging my deep knowledge of system architecture and development. My trading experience informs my work, notably through creating ShinyBroker, a tool originally created to empower my students to build interactive, visual trading applications in Python which is now available to the public. Additionally, I provide consulting, research, and development services on an ad hoc basis, helping organizations navigate technological and strategic advancements. My interdisciplinary approach bridges academia, industry, and innovation. https:\\\/\\\/masters.pratt.duke.edu\\\/fintech\\\/\",\n\t            \"sameAs\": [\n\t                \"https:\\\/\\\/shiny.posit.co\\\/\"\n\t            ],\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/jacobvestal\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"ShinyBroker Part I: Hello World | IBKR Quant","description":"ShinyBroker is an ongoing development project at the Duke University FinTech Masters Program and is available for public use on paper accounts.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/226904\/","og_locale":"en_US","og_type":"article","og_title":"ShinyBroker Part I: Hello World","og_description":"ShinyBroker is an ongoing development project at the Duke University FinTech Masters Program and is available for public use on paper accounts.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/shinybroker-part-i-hello-world\/","og_site_name":"IBKR Campus US","article_published_time":"2025-07-15T18:36:53+00:00","article_modified_time":"2025-07-31T15:46:50+00:00","og_image":[{"width":700,"height":394,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/shinybroker-install.png","type":"image\/png"}],"author":"Jacob Vestal","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jacob Vestal","Est. reading time":"16 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/shinybroker-part-i-hello-world\/#article","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/shinybroker-part-i-hello-world\/"},"author":{"name":"Jacob Vestal","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/acce88c42210ff8479586fce8c83c032"},"headline":"ShinyBroker Part I: Hello World","datePublished":"2025-07-15T18:36:53+00:00","dateModified":"2025-07-31T15:46:50+00:00","mainEntityOfPage":{"@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/shinybroker-part-i-hello-world\/"},"wordCount":3377,"commentCount":1,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/shinybroker-part-i-hello-world\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/shinybroker-install.png","keywords":["Algo Trading","Data Science","Duke University FinTech Masters Program","IBKR API","PyCharm","Python","ShinyBroker","Trader Workstation"],"articleSection":["Data Science","Programming Languages","Python Development","Quant","Quant Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/shinybroker-part-i-hello-world\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/shinybroker-part-i-hello-world\/","url":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/shinybroker-part-i-hello-world\/","name":"ShinyBroker Part I: Hello World | IBKR Campus US","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/shinybroker-part-i-hello-world\/#primaryimage"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/shinybroker-part-i-hello-world\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/shinybroker-install.png","datePublished":"2025-07-15T18:36:53+00:00","dateModified":"2025-07-31T15:46:50+00:00","description":"ShinyBroker is an ongoing development project at the Duke University FinTech Masters Program and is available for public use on paper accounts.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/shinybroker-part-i-hello-world\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/shinybroker-part-i-hello-world\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/shinybroker-install.png","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/shinybroker-install.png","width":700,"height":394,"caption":"ShinyBroker"},{"@type":"WebSite","@id":"https:\/\/ibkrcampus.com\/campus\/#website","url":"https:\/\/ibkrcampus.com\/campus\/","name":"IBKR Campus US","description":"Financial Education from Interactive Brokers","publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ibkrcampus.com\/campus\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ibkrcampus.com\/campus\/#organization","name":"Interactive Brokers","alternateName":"IBKR","url":"https:\/\/ibkrcampus.com\/campus\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","width":669,"height":669,"caption":"Interactive Brokers"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/"},"publishingPrinciples":"https:\/\/www.interactivebrokers.com\/campus\/about-ibkr-campus\/","ethicsPolicy":"https:\/\/www.interactivebrokers.com\/campus\/cyber-security-notice\/"},{"@type":"Person","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/acce88c42210ff8479586fce8c83c032","name":"Jacob Vestal","description":"As an Executive in Residence at the Duke University FinTech Masters Program, I guide students and professionals in applying cutting-edge technology to complex challenges in global financial markets. With extensive software design expertise, I have delivered innovative solutions for government agencies, leveraging my deep knowledge of system architecture and development. My trading experience informs my work, notably through creating ShinyBroker, a tool originally created to empower my students to build interactive, visual trading applications in Python which is now available to the public. Additionally, I provide consulting, research, and development services on an ad hoc basis, helping organizations navigate technological and strategic advancements. My interdisciplinary approach bridges academia, industry, and innovation. https:\/\/masters.pratt.duke.edu\/fintech\/","sameAs":["https:\/\/shiny.posit.co\/"],"url":"https:\/\/www.interactivebrokers.com\/campus\/author\/jacobvestal\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2025\/07\/shinybroker-install.png","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/226904","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/users\/1651"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=226904"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/226904\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/227271"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=226904"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=226904"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=226904"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=226904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}