{"id":541,"date":"2018-09-09T01:52:11","date_gmt":"2018-09-08T23:52:11","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=541"},"modified":"2020-11-21T22:22:51","modified_gmt":"2020-11-21T21:22:51","slug":"automatic-trading-with-e-trade","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2018\/09\/09\/automatic-trading-with-e-trade\/","title":{"rendered":"Investor &#8211; Automatic Trading with E-Trade"},"content":{"rendered":"<p>Hurray &#8211; Today I finally managed to finish the implementation of the integration into E-Trade. Unfortunately it turned out to be a little bit more complicated then initially thought and there were quite a few stumbling blocks around the topic of &#8220;authentication&#8221;.<\/p>\n<p><a href=\"https:\/\/www.pschatzmann.ch\/home\/2018\/09\/04\/running-automatic-trading-bot\/\">I have aleady demonstrated how to do trading with actual data.<\/a><br \/>\nIn this document I want to show how to do automatic trading with E-Trade. Information on how to request to access E-Trade can be found in <a href=\"https:\/\/developer.etrade.com\/ctnt\/dev-portal\/getArticleByCategory?category=Documentation\">the official documentation<\/a><\/p>\n<h3>Setup<\/h3>\n<p>First &#8211; as always &#8211; we add the necessary jars and import all relevant packages:<\/p>\n<pre><code class=\"Scala\">%classpath config resolver maven http:\/\/192.168.1.10:8081\/repository\/maven-public\/\n%classpath add mvn ch.pschatzmann investor 0.9-SNAPSHOT\n%classpath add mvn ch.pschatzmann investor-etrade 0.0.1-SNAPSHOT\n%classpath add mvn ch.pschatzmann jupyter-jdk-extensions 0.0.1-SNAPSHOT\n\n\/\/ our investor framwork\nimport ch.pschatzmann.dates._\nimport ch.pschatzmann.stocks._\nimport ch.pschatzmann.stocks.data.universe._\nimport ch.pschatzmann.stocks.input._\nimport ch.pschatzmann.stocks.accounting._\nimport ch.pschatzmann.stocks.accounting.kpi._\nimport ch.pschatzmann.stocks.execution._\nimport ch.pschatzmann.stocks.execution.fees._\nimport ch.pschatzmann.stocks.execution.price._\nimport ch.pschatzmann.stocks.parameters._\nimport ch.pschatzmann.stocks.strategy._\nimport ch.pschatzmann.stocks.strategy.optimization._\nimport ch.pschatzmann.stocks.strategy.allocation._\nimport ch.pschatzmann.stocks.strategy.selection._\nimport ch.pschatzmann.stocks.integration._\nimport ch.pschatzmann.stocks.integration.ChartData.FieldName._\nimport ch.pschatzmann.stocks.strategy.OptimizedStrategy.Schedule._\n\n\/\/ e-trade\nimport ch.pschatzmann.investor.etrade._\n\n\/\/ java\nimport java.util.stream.Collectors\nimport java.util._\nimport java.lang._\nimport java.util.function.Consumer\nimport scala.collection.JavaConverters\n\n\/\/\/ jupyter custom displayer\nimport ch.pschatzmann.display._\n\n<\/code><\/pre>\n<pre><code>Added new repo: maven\n\n\nimport ch.pschatzmann.dates._\nimport ch.pschatzmann.stocks._\nimport ch.pschatzmann.stocks.data.universe._\nimport ch.pschatzmann.stocks.input._\nimport ch.pschatzmann.stocks.accounting._\nimport ch.pschatzmann.stocks.accounting.kpi._\nimport ch.pschatzmann.stocks.execution._\nimport ch.pschatzmann.stocks.execution.fees._\nimport ch.pschatzmann.stocks.execution.price._\nimport ch.pschatzmann.stocks.parameters._\nimport ch.pschatzmann.stocks.strategy._\nimport ch.pschatzmann.stocks.strategy.optimization._\nimport ch.pschatzmann.stocks.strategy.allocation._\nimport ch.pschatzmann.stocks.strategy.selection._\nimport ch.pschatzmann.stocks.integration._\nimport ch.pschatzmann.stocks.integration.ChartData.FieldName._\nimport ch.pschatzmann.stocks.strategy.OptimizedStrategy.Schedule._\nimport ch.pschatzmann.i...\n<\/code><\/pre>\n<h3>Output<\/h3>\n<p>Unfortunatly the functionality provided by e-trade is printing information to System.out and therfore this will appear in our Notebook.<\/p>\n<p>We switch this off by setting the standard output to the NullPrintScream:<\/p>\n<pre><code class=\"Scala\">System.setOut(new NullPrintStream())\n\n<\/code><\/pre>\n<pre><code>null\n<\/code><\/pre>\n<h3>Authentication \/ Login<\/h3>\n<p>In order to be able to login we need to have the following input defined in the &#8216;investor.properties&#8217; file:<br \/>\n&#8211; EtradeUser<br \/>\n&#8211; EtradePassword<br \/>\n&#8211; EtradeConsumerKey<br \/>\n&#8211; EtradeConsumerSecret<br \/>\n&#8211; EtradeConsumerKeySandbox<br \/>\n&#8211; EtradeConsumerSecretSandbox<\/p>\n<p>The user and password is the same information which is used to login to e-trade via the web-gui. The consumer_key and consumer_secret need to be requested from e-trade separatly.<\/p>\n<p>The ETradeLogin class provides an authenicated clientRequest which has a valid access token associated with it. In the constructor we can indicated if we want to access the Production environemnt.<br \/>\nETradeLogin is needed as input which goes into the ETradeTrader class.<\/p>\n<p>After we are done we can revoke the access again.<\/p>\n<pre><code class=\"Scala\">\/\/ login to the Sandobx\nvar login = new ETradeLogin(false)\n\/\/ list all available sandbox accounts\nvar accounts = login.getAccounts()\nlogin.logoff()\n\naccounts\n<\/code><\/pre>\n<pre><code>[30049872, 83405188, 83405553, 83405557, 83406373, 83412346, 83412345, 83491757]\n<\/code><\/pre>\n<h3>Trading with E-Trade<\/h3>\n<p>Instead of the PaperTrader we just use the ETradeTrader which makes sure that transactions are sent to e-trade and we monitor the the execution by e-trade so that we can update the status of our orders.<\/p>\n<p>Here is a complete example:<\/p>\n<pre><code class=\"Scala\"> class MyScheduledExecutor() extends ScheduledExecutor() {\n    var currentYear:Integer = null;\n\n    override def getExecutor: StrategyExecutor = {\n        var year = Context.getYear(new Date())\n        var executor = super.getExecutor()\n        if (year!=currentYear) {\n            System.out.println(\"Defining new executor\");\n            var periods = Context.getDateRanges((year-2)+\"-01-01\",(year-1)+\"-01-01\");\n            var account = new ManagedAccount(\"30049872\", \"USD\", 0.00, Context.date(\"2010-01-01\"), new ETradeFees())\n            var login = new ETradeLogin(false)\n            var etradeTrader = new ETradeTrader(login, account);            \n            var allocationStrategy = new DistributedAllocationStrategy(etradeTrader);\n            executor = new StrategyExecutor(etradeTrader, allocationStrategy);\n            var portfolioUniverse =  new EdgarUniverse(year-2, Arrays.asList(0.2, 0.5, 0.8, 1.0), 10, Arrays.asList(\"NetIncomeLoss\"), true)                                \n            var strategies = TradingStrategyFactory.list()\n            var strategySelector = new StrategySelector(account, strategies, periods.get(0), KPI.AbsoluteReturn)\n            var stockSelector = new StockSelector(strategySelector)\n            var reader = new YahooReader() \n            var result = stockSelector.getSelection(10, portfolioUniverse, reader)\n            executor.setStrategies(result.getStrategies(reader));\n            setExecutor(executor)\n            currentYear = year\n        }\n        return executor\n    }\n }\n\n\/\/ schedule the execution every day at 9am\nvar scheduledExecutor = new MyScheduledExecutor()\nscheduledExecutor.schedule(\"0 0 9 * * ?\"); \n\n<\/code><\/pre>\n<pre><code>null\n<\/code><\/pre>\n<h3>Synronization of E-Trade Information<\/h3>\n<pre><code class=\"Scala\">var account = new ManagedAccount(\"83412345\", \"USD\", 0.0, Context.date(\"2010-01-01\"), new ETradeFees())\nvar login = new ETradeLogin(false)\nvar etradeTrader = new ETradeTrader(login, account);            \n\nDisplayers.display(account.getTransactions())\n<\/code><\/pre>\n<table>\n<tr>\n<th>stockID<\/th>\n<th>date<\/th>\n<th>quantity<\/th>\n<th>requestedPrice<\/th>\n<th>filledPrice<\/th>\n<th>fees<\/th>\n<th>comment<\/th>\n<th>id<\/th>\n<th>status<\/th>\n<th>requestedPriceType<\/th>\n<th>buyOrSell<\/th>\n<th>impactOnCash<\/th>\n<th>active<\/th>\n<\/tr>\n<tr>\n<td>\n<table >\n<tr>\n<th>Key<\/th>\n<th>Value<\/th>\n<\/tr>\n<tr>\n<td>ticker<\/td>\n<td>CSCO<\/td>\n<\/tr>\n<tr>\n<td>exchange<\/td>\n<td><\/td>\n<\/tr>\n<\/table>\n<\/td>\n<td>2010-03-04<\/td>\n<td>1<\/td>\n<td>0<\/td>\n<td>24.84<\/td>\n<td>5<\/td>\n<td>reconcile transaction from e-trade<\/td>\n<td>208-1<\/td>\n<td>Filled<\/td>\n<td>Market<\/td>\n<td>Buy<\/td>\n<td>-29.84<\/td>\n<td>true<\/td>\n<\/tr>\n<tr>\n<td>\n<table >\n<tr>\n<th>Key<\/th>\n<th>Value<\/th>\n<\/tr>\n<tr>\n<td>ticker<\/td>\n<td>GOOG<\/td>\n<\/tr>\n<tr>\n<td>exchange<\/td>\n<td><\/td>\n<\/tr>\n<\/table>\n<\/td>\n<td>2018-09-09<\/td>\n<td>2<\/td>\n<td>0<\/td>\n<td>1<\/td>\n<td>0<\/td>\n<td>reconcile difference with e-trade LONG<\/td>\n<td>297788537448172<\/td>\n<td>Filled<\/td>\n<td>Market<\/td>\n<td>Buy<\/td>\n<td>-2<\/td>\n<td>true<\/td>\n<\/tr>\n<tr>\n<td>\n<table >\n<tr>\n<th>Key<\/th>\n<th>Value<\/th>\n<\/tr>\n<tr>\n<td>ticker<\/td>\n<td>A<\/td>\n<\/tr>\n<tr>\n<td>exchange<\/td>\n<td><\/td>\n<\/tr>\n<\/table>\n<\/td>\n<td>2018-09-09<\/td>\n<td>2<\/td>\n<td>0<\/td>\n<td>1<\/td>\n<td>0<\/td>\n<td>reconcile difference with e-trade LONG<\/td>\n<td>297788537605530<\/td>\n<td>Filled<\/td>\n<td>Market<\/td>\n<td>Buy<\/td>\n<td>-2<\/td>\n<td>true<\/td>\n<\/tr>\n<tr>\n<td>\n<table >\n<tr>\n<th>Key<\/th>\n<th>Value<\/th>\n<\/tr>\n<tr>\n<td>ticker<\/td>\n<td>HP<\/td>\n<\/tr>\n<tr>\n<td>exchange<\/td>\n<td><\/td>\n<\/tr>\n<\/table>\n<\/td>\n<td>2018-09-09<\/td>\n<td>1<\/td>\n<td>0<\/td>\n<td>1<\/td>\n<td>0<\/td>\n<td>reconcile difference with e-trade LONG<\/td>\n<td>297788537730338<\/td>\n<td>Filled<\/td>\n<td>Market<\/td>\n<td>Buy<\/td>\n<td>-1<\/td>\n<td>true<\/td>\n<\/tr>\n<tr>\n<td>\n<table >\n<tr>\n<th>Key<\/th>\n<th>Value<\/th>\n<\/tr>\n<tr>\n<td>ticker<\/td>\n<td>IBM<\/td>\n<\/tr>\n<tr>\n<td>exchange<\/td>\n<td><\/td>\n<\/tr>\n<\/table>\n<\/td>\n<td>2018-09-09<\/td>\n<td>75<\/td>\n<td>0<\/td>\n<td>1<\/td>\n<td>0<\/td>\n<td>reconcile difference with e-trade LONG<\/td>\n<td>297788537859358<\/td>\n<td>Filled<\/td>\n<td>Market<\/td>\n<td>Buy<\/td>\n<td>-75<\/td>\n<td>true<\/td>\n<\/tr>\n<tr>\n<td>\n<table >\n<tr>\n<th>Key<\/th>\n<th>Value<\/th>\n<\/tr>\n<tr>\n<td>ticker<\/td>\n<td>INTC<\/td>\n<\/tr>\n<tr>\n<td>exchange<\/td>\n<td><\/td>\n<\/tr>\n<\/table>\n<\/td>\n<td>2018-09-09<\/td>\n<td>100<\/td>\n<td>0<\/td>\n<td>1<\/td>\n<td>0<\/td>\n<td>reconcile difference with e-trade LONG<\/td>\n<td>297788537979151<\/td>\n<td>Filled<\/td>\n<td>Market<\/td>\n<td>Buy<\/td>\n<td>-100<\/td>\n<td>true<\/td>\n<\/tr>\n<tr>\n<td>\n<table >\n<tr>\n<th>Key<\/th>\n<th>Value<\/th>\n<\/tr>\n<tr>\n<td>ticker<\/td>\n<td>MSFT<\/td>\n<\/tr>\n<tr>\n<td>exchange<\/td>\n<td><\/td>\n<\/tr>\n<\/table>\n<\/td>\n<td>2018-09-09<\/td>\n<td>2<\/td>\n<td>0<\/td>\n<td>1<\/td>\n<td>0<\/td>\n<td>reconcile difference with e-trade LONG<\/td>\n<td>297788538103743<\/td>\n<td>Filled<\/td>\n<td>Market<\/td>\n<td>Buy<\/td>\n<td>-2<\/td>\n<td>true<\/td>\n<\/tr>\n<tr>\n<td>\n<table >\n<tr>\n<th>Key<\/th>\n<th>Value<\/th>\n<\/tr>\n<tr>\n<td>ticker<\/td>\n<td>Cash<\/td>\n<\/tr>\n<tr>\n<td>exchange<\/td>\n<td>Account<\/td>\n<\/tr>\n<\/table>\n<\/td>\n<td>2018-09-09<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>reconcile cash from e-trade<\/td>\n<td>297788538232706<\/td>\n<td>Planned<\/td>\n<td>CashTransfer<\/td>\n<td>NA<\/td>\n<td>100100029.84<\/td>\n<td>true<\/td>\n<\/tr>\n<\/table>\n<h4>Synronization of Account<\/h4>\n<p>If we indicate no starting amount in the account, the system automatically synchronizes the account information with<br \/>\ne-trade in order to set up the actual as is information.<\/p>\n<p>We can also explicitly request this by calling trader.synchronizeAccount() or schedule a automatic synchronization<br \/>\nby calling trader.scheduleSynchronizeAccount(cronExpression).<\/p>\n<p>Any long stock which is available in the e-trade account will be replicated into our local account but it will not be considered by the trader.<\/p>\n<p>We can easly achieve this by adding the missing stocks into the portfilioUniverse:<\/p>\n<pre><code>\/\/ synronize account to get the stocks from e-trade\netradeTrader.synchronizeAccount()\n\/\/ build combined universe\nvar universe =  new ListUniverse()\nuniverse.add(new AccountUniverse(account))\nuniverse.add(new EdgarUniverse(year-2, Arrays.asList(0.2, 0.5, 0.8, 1.0), 10, Arrays.asList(\"NetIncomeLoss\"), true))\n<\/code><\/pre>\n<p>Or we could just add it with a predefined fixed strategy<\/p>\n<pre><code>\/\/ synronize account to get the stocks from e-trade\netradeTrader.synchronizeAccount()\nvar fixedStrategies = Context.getStrategies(new AccountUniverse(account).getList(), reader, \"BuyAndHoldStrategy\")\nexecutor.setStrategies(result.getStrategies(reader), fixedStrategies);\n<\/code><\/pre>\n<h4>Synronization of Transactions<\/h4>\n<p>The default setup is automatically synchronizing the orders with the transactions every full hour.<br \/>\nThe synchonization is implementing the following logic:<br \/>\n&#8211; If we find an executed order but there is no corresponsing transaction -> we create the missing transaction<br \/>\n&#8211; If for a transaction the order has been completed -> we complete the transaction<br \/>\n&#8211; If for a transaction the order has been rejected, cancelled or expired -> we cancel the transaction<\/p>\n<p>We can explicity define a schedule in the constructor<\/p>\n<pre><code>var etradeTrader = new new ETradeTrader(account, Environment.SANDBOX, \"key\", \"secret\", cronSchedule);            \n<\/code><\/pre>\n<p>or we can just reschedule by calling<\/p>\n<pre><code>etradeTrader.scheduleSynchronizeTransactions(cronSchedule)\n<\/code><\/pre>\n<p>The scheduling can be canelled by passing an empty schedule.<\/p>\n<h4>Cron Syntax<\/h4>\n<p>The detailed description of the quartz cron syntax can be found at http:\/\/www.quartz-scheduler.org\/documentation\/quartz-2.x\/tutorials\/crontrigger.html. E.g. ff we an it to run every 10 minutes we would specify &#8220;0 0\/10 * * * ?&#8221;<\/p>\n<h3>Result<\/h3>\n<p>The latest updated account information can be found in the &#8216;accounts&#8217; directory.<br \/>\nWe can also determine the trasactions from the account which is available in the executor:<\/p>\n<pre><code class=\"Scala\">var account = new ManagedAccount(\"30049872\", \"USD\", 0.00, Context.date(\"2010-01-01\"), new ETradeFees())\nDisplayers.display(account.getTransactions())\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Hurray &#8211; Today I finally managed to finish the implementation of the integration into E-Trade. Unfortunately it turned out to be a little bit more complicated then initially thought and there were quite a few stumbling blocks around the topic of &#8220;authentication&#8221;. I have aleady demonstrated how to do trading [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":546,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[13],"tags":[],"class_list":["post-541","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-quantitative-trading"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Investor - Automatic Trading with E-Trade - Phil Schatzmann<\/title>\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.pschatzmann.ch\/home\/2018\/09\/09\/automatic-trading-with-e-trade\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Investor - Automatic Trading with E-Trade - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"Hurray &#8211; Today I finally managed to finish the implementation of the integration into E-Trade. Unfortunately it turned out to be a little bit more complicated then initially thought and there were quite a few stumbling blocks around the topic of &#8220;authentication&#8221;. I have aleady demonstrated how to do trading [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2018\/09\/09\/automatic-trading-with-e-trade\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2018-09-08T23:52:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-11-21T21:22:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2018\/09\/etrade-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"574\" \/>\n\t<meta property=\"og:image:height\" content=\"473\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"pschatzmann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"pschatzmann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/09\\\/09\\\/automatic-trading-with-e-trade\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/09\\\/09\\\/automatic-trading-with-e-trade\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"Investor &#8211; Automatic Trading with E-Trade\",\"datePublished\":\"2018-09-08T23:52:11+00:00\",\"dateModified\":\"2020-11-21T21:22:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/09\\\/09\\\/automatic-trading-with-e-trade\\\/\"},\"wordCount\":717,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/09\\\/09\\\/automatic-trading-with-e-trade\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2018\\\/09\\\/etrade-2.png\",\"articleSection\":[\"Quantitative Trading\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/09\\\/09\\\/automatic-trading-with-e-trade\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/09\\\/09\\\/automatic-trading-with-e-trade\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/09\\\/09\\\/automatic-trading-with-e-trade\\\/\",\"name\":\"Investor - Automatic Trading with E-Trade - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/09\\\/09\\\/automatic-trading-with-e-trade\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/09\\\/09\\\/automatic-trading-with-e-trade\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2018\\\/09\\\/etrade-2.png\",\"datePublished\":\"2018-09-08T23:52:11+00:00\",\"dateModified\":\"2020-11-21T21:22:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/09\\\/09\\\/automatic-trading-with-e-trade\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/09\\\/09\\\/automatic-trading-with-e-trade\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/09\\\/09\\\/automatic-trading-with-e-trade\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2018\\\/09\\\/etrade-2.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2018\\\/09\\\/etrade-2.png\",\"width\":574,\"height\":473},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/09\\\/09\\\/automatic-trading-with-e-trade\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Investor &#8211; Automatic Trading with E-Trade\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\",\"name\":\"Phil Schatzmann Consulting\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\",\"name\":\"pschatzmann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"width\":305,\"height\":305,\"caption\":\"pschatzmann\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Investor - Automatic Trading with E-Trade - Phil Schatzmann","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.pschatzmann.ch\/home\/2018\/09\/09\/automatic-trading-with-e-trade\/","og_locale":"en_US","og_type":"article","og_title":"Investor - Automatic Trading with E-Trade - Phil Schatzmann","og_description":"Hurray &#8211; Today I finally managed to finish the implementation of the integration into E-Trade. Unfortunately it turned out to be a little bit more complicated then initially thought and there were quite a few stumbling blocks around the topic of &#8220;authentication&#8221;. I have aleady demonstrated how to do trading [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2018\/09\/09\/automatic-trading-with-e-trade\/","og_site_name":"Phil Schatzmann","article_published_time":"2018-09-08T23:52:11+00:00","article_modified_time":"2020-11-21T21:22:51+00:00","og_image":[{"width":574,"height":473,"url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2018\/09\/etrade-2.png","type":"image\/png"}],"author":"pschatzmann","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pschatzmann","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/09\/09\/automatic-trading-with-e-trade\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/09\/09\/automatic-trading-with-e-trade\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"Investor &#8211; Automatic Trading with E-Trade","datePublished":"2018-09-08T23:52:11+00:00","dateModified":"2020-11-21T21:22:51+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/09\/09\/automatic-trading-with-e-trade\/"},"wordCount":717,"commentCount":0,"publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/09\/09\/automatic-trading-with-e-trade\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2018\/09\/etrade-2.png","articleSection":["Quantitative Trading"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pschatzmann.ch\/home\/2018\/09\/09\/automatic-trading-with-e-trade\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/09\/09\/automatic-trading-with-e-trade\/","url":"https:\/\/www.pschatzmann.ch\/home\/2018\/09\/09\/automatic-trading-with-e-trade\/","name":"Investor - Automatic Trading with E-Trade - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/09\/09\/automatic-trading-with-e-trade\/#primaryimage"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/09\/09\/automatic-trading-with-e-trade\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2018\/09\/etrade-2.png","datePublished":"2018-09-08T23:52:11+00:00","dateModified":"2020-11-21T21:22:51+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/09\/09\/automatic-trading-with-e-trade\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2018\/09\/09\/automatic-trading-with-e-trade\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/09\/09\/automatic-trading-with-e-trade\/#primaryimage","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2018\/09\/etrade-2.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2018\/09\/etrade-2.png","width":574,"height":473},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/09\/09\/automatic-trading-with-e-trade\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"Investor &#8211; Automatic Trading with E-Trade"}]},{"@type":"WebSite","@id":"https:\/\/www.pschatzmann.ch\/home\/#website","url":"https:\/\/www.pschatzmann.ch\/home\/","name":"Phil Schatzmann Consulting","description":"","publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pschatzmann.ch\/home\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1","name":"pschatzmann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","width":305,"height":305,"caption":"pschatzmann"},"logo":{"@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png"}}]}},"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/541","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/comments?post=541"}],"version-history":[{"count":1,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/541\/revisions"}],"predecessor-version":[{"id":2223,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/541\/revisions\/2223"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media\/546"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=541"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=541"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}