{"id":108841,"date":"2021-10-27T10:53:53","date_gmt":"2021-10-27T14:53:53","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=108841"},"modified":"2022-11-21T09:48:46","modified_gmt":"2022-11-21T14:48:46","slug":"optimising-the-rsims-package-for-fast-backtesting-in-r-part-i","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\/","title":{"rendered":"Optimising the rsims package for Fast Backtesting in R &#8211; Part I"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><code>rsims<\/code>&nbsp;is a new package for fast, quasi event-driven backtesting in R. You can find the source on&nbsp;<a href=\"https:\/\/github.com\/Robot-Wealth\/rsims\">GitHub<\/a>, docs&nbsp;<a href=\"https:\/\/robot-wealth.github.io\/rsims\/\">here<\/a>, and an introductory blog post&nbsp;<a href=\"https:\/\/robotwealth.com\/exploring-the-rsims-package-for-fast-backtesting-in-r\/\">here<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Our use case for&nbsp;<code>rsims<\/code>&nbsp;was accurate but fast simulation of trading strategies. I\u2019ve had a few questions about how I made the backtester as fast as it is \u2013 after all, it uses a giant&nbsp;<code>for<\/code>&nbsp;loop, and R is notoriously slow for such operations \u2013 so here\u2019s a post about how I optimised&nbsp;<code>rsims<\/code>&nbsp;for speed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-approach\">Approach<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I firstly wrote the backtester with a focus on ease of understanding. I wanted something that worked as expected, and that I could think about without too much effort. At this stage, I wasn\u2019t thinking much about speed or efficiency.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once I had that working, I focused on finding bottlenecks with&nbsp;<code>profvis<\/code>. It\u2019s a good idea to resist the urge to optimise before you know where you\u2019ll get the most bang for your buck (speaking from experience here).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then I simply tackled those bottlenecks one at a time until I reached a point of diminishing returns (which is a little subjective and dependent on one\u2019s use case).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There\u2019s one thing I\u2019d do differently if I were starting over: write the tests first, rather than after the fact. In hindsight, this would have saved a ton of time. To be honest, it\u2019s something that I say after every little development effort, but this time I\u2019ve&nbsp;<em>really<\/em>&nbsp;learned my lesson.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-profiling-with-profvis\">Profiling with profvis<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The original code looked a lot different from the current version. It had lots of data frames and&nbsp;<code>dplyr<\/code>&nbsp;pipelines for operating on data:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>positions_from_no_trade_buffer &lt;- function(current_positions, current_prices, current_theo_weights, cap_equity, num_assets, trade_buffer) {\n  current_weights &lt;- current_positions*current_prices\/cap_equity\n  target_positions &lt;- current_positions\n  for(j in 1:num_assets) {\n    if(is.na(current_theo_weights&#91;j]) || current_theo_weights&#91;j] == 0) {\n      target_positions&#91;j] &lt;- 0\n      next\n    }\n    # note: we haven't truncated to nearest whole coin, as coins are divisible (unlike shares)\n    if(current_weights&#91;j] &lt; current_theo_weights&#91;j] - trade_buffer) {\n      target_positions&#91;j] &lt;- (current_theo_weights&#91;j] - trade_buffer)*cap_equity\/current_prices&#91;j]\n    } else if(current_weights&#91;j] &gt; current_theo_weights&#91;j] + trade_buffer) {\n      target_positions&#91;j] &lt;- (current_theo_weights&#91;j] + trade_buffer)*cap_equity\/current_prices&#91;j]\n    }\n  }\n  unlist(target_positions)\n}\ncash_backtest_original &lt;- function(backtest_df_long, trade_buffer = 0., initial_cash = 10000, commission_pct = 0, capitalise_profits = FALSE) {\n  # Create wide data frames \n  wide_prices &lt;- backtest_df_long %&gt;%\n    pivot_wider(date, names_from = 'ticker', values_from = 'price')\n  wide_theo_weights &lt;- backtest_df_long %&gt;%\n    pivot_wider(date, names_from = 'ticker', values_from = 'theo_weight')\n  # get tickers for later\n  tickers &lt;- colnames(wide_prices)&#91;-1]\n  # initial state\n  num_assets &lt;- ncol(wide_prices) - 1  # -1 for date column\n  current_positions &lt;- rep(0, num_assets)\n  previous_theo_weights &lt;- rep(0, num_assets)\n  row_list &lt;- list() \n  cash &lt;- initial_cash\n  # backtest loop\n  for(i in 1:nrow(wide_prices)) {\n    current_date &lt;- wide_prices&#91;i, 1] %&gt;% pull() %&gt;% as.Date()\n    current_prices &lt;- wide_prices&#91;i, -1] %&gt;% as.numeric()\n    current_theo_weights &lt;- wide_theo_weights&#91;i, -1] %&gt;% as.numeric()\n    # update equity\n    equity &lt;- sum(current_positions * current_prices, na.rm = TRUE) + cash\n    cap_equity &lt;- ifelse(capitalise_profits, equity, min(initial_cash, equity))  # min reflects assumption that we don't top up strategy equity if in drawdown\n    # update positions based on no-trade buffer\n    target_positions &lt;- positions_from_no_trade_buffer(current_positions, current_prices, current_theo_weights, cap_equity, num_assets, trade_buffer)\n    # calculate position deltas, trade values and commissions\n    trades &lt;- target_positions - current_positions\n    trade_value &lt;- trades * current_prices\n    commissions &lt;- abs(trade_value) * commission_pct\n    # adjust cash by value of trades\n    cash &lt;- cash - sum(trade_value, na.rm = TRUE) - sum(commissions, na.rm = TRUE)\n    current_positions &lt;- target_positions\n    position_value &lt;- current_positions * current_prices\n    equity &lt;- sum(position_value, na.rm = TRUE) + cash\n    # Create data frame and add to list\n    row_df &lt;- data.frame(\n       Ticker = c('Cash', tickers),\n       Date = rep(current_date, num_assets + 1),\n       Close = c(0, current_prices),\n       Position = c(0, current_positions),\n       Value = c(cash, position_value),\n       Trades = c(-sum(trade_value), trades),\n       TradeValue = c(-sum(trade_value), trade_value),\n       Commission = c(0, commissions)\n    )\n    row_list&#91;&#91;i]] &lt;- row_df\n    previous_theo_weights &lt;- current_theo_weights\n  }\n  # Combine list into dataframe\n  bind_rows(row_list)\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Stay tuned for the next part in which Kris will demonstrate how to make a data frame of randomly generated prices and weights.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Visit Robot Wealth to download the complete R script: <a href=\"https:\/\/robotwealth.com\/optimising-the-rsims-package-for-fast-backtesting-in-r\/\">https:\/\/robotwealth.com\/optimising-the-rsims-package-for-fast-backtesting-in-r\/<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Kris Longmore demonstrates profiling with the R package profvis.<\/p>\n","protected":false},"author":271,"featured_media":90176,"comment_status":"closed","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[339,343,338,350,341,344,342],"tags":[4873,806,487,10561,508],"contributors-categories":[13676],"class_list":["post-108841","post","type-post","status-publish","format-standard","has-post-thumbnail","category-data-science","category-programing-languages","category-ibkr-quant-news","category-quant-asia-pacific","category-quant-development","category-quant-regions","category-r-development","tag-backtesting","tag-data-science","tag-r","tag-rsims","tag-rstudio","contributors-categories-robot-wealth"],"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 v28.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Optimising the rsims package for Fast Backtesting in R &#8211; Part I<\/title>\n<meta name=\"description\" content=\"Kris Longmore demonstrates profiling with the R package profvis.\" \/>\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\/108841\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Optimising the rsims package for Fast Backtesting in R - Part I | IBKR Quant Blog\" \/>\n<meta property=\"og:description\" content=\"Kris Longmore demonstrates profiling with the R package profvis.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2021-10-27T14:53:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-21T14:48:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/06\/quant-charts.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"563\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Kris Longmore\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kris Longmore\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 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:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Kris Longmore\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/79c2a2775a70a4da1accf0068d731933\"\n\t            },\n\t            \"headline\": \"Optimising the rsims package for Fast Backtesting in R &#8211; Part I\",\n\t            \"datePublished\": \"2021-10-27T14:53:53+00:00\",\n\t            \"dateModified\": \"2022-11-21T14:48:46+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\\\/\"\n\t            },\n\t            \"wordCount\": 336,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2021\\\/06\\\/quant-charts.jpg\",\n\t            \"keywords\": [\n\t                \"backtesting\",\n\t                \"Data Science\",\n\t                \"R\",\n\t                \"rsims\",\n\t                \"RStudio\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Programming Languages\",\n\t                \"Quant\",\n\t                \"Quant Asia Pacific\",\n\t                \"Quant Development\",\n\t                \"Quant Regions\",\n\t                \"R Development\"\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\\\/\",\n\t            \"name\": \"Optimising the rsims package for Fast Backtesting in R - Part I | IBKR Quant Blog\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\"\n\t            },\n\t            \"primaryImageOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2021\\\/06\\\/quant-charts.jpg\",\n\t            \"datePublished\": \"2021-10-27T14:53:53+00:00\",\n\t            \"dateModified\": \"2022-11-21T14:48:46+00:00\",\n\t            \"description\": \"Kris Longmore demonstrates profiling with the R package profvis.\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\\\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"ImageObject\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2021\\\/06\\\/quant-charts.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2021\\\/06\\\/quant-charts.jpg\",\n\t            \"width\": 1000,\n\t            \"height\": 563,\n\t            \"caption\": \"Quant\"\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\\\/79c2a2775a70a4da1accf0068d731933\",\n\t            \"name\": \"Kris Longmore\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/krislongmore\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Optimising the rsims package for Fast Backtesting in R &#8211; Part I","description":"Kris Longmore demonstrates profiling with the R package profvis.","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\/108841\/","og_locale":"en_US","og_type":"article","og_title":"Optimising the rsims package for Fast Backtesting in R - Part I | IBKR Quant Blog","og_description":"Kris Longmore demonstrates profiling with the R package profvis.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\/","og_site_name":"IBKR Campus US","article_published_time":"2021-10-27T14:53:53+00:00","article_modified_time":"2022-11-21T14:48:46+00:00","og_image":[{"width":1000,"height":563,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/06\/quant-charts.jpg","type":"image\/jpeg"}],"author":"Kris Longmore","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kris Longmore","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\/"},"author":{"name":"Kris Longmore","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/79c2a2775a70a4da1accf0068d731933"},"headline":"Optimising the rsims package for Fast Backtesting in R &#8211; Part I","datePublished":"2021-10-27T14:53:53+00:00","dateModified":"2022-11-21T14:48:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\/"},"wordCount":336,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/06\/quant-charts.jpg","keywords":["backtesting","Data Science","R","rsims","RStudio"],"articleSection":["Data Science","Programming Languages","Quant","Quant Asia Pacific","Quant Development","Quant Regions","R Development"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\/","name":"Optimising the rsims package for Fast Backtesting in R - Part I | IBKR Quant Blog","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\/#primaryimage"},"image":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/06\/quant-charts.jpg","datePublished":"2021-10-27T14:53:53+00:00","dateModified":"2022-11-21T14:48:46+00:00","description":"Kris Longmore demonstrates profiling with the R package profvis.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/optimising-the-rsims-package-for-fast-backtesting-in-r-part-i\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/06\/quant-charts.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/06\/quant-charts.jpg","width":1000,"height":563,"caption":"Quant"},{"@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\/79c2a2775a70a4da1accf0068d731933","name":"Kris Longmore","url":"https:\/\/www.interactivebrokers.com\/campus\/author\/krislongmore\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/06\/quant-charts.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/108841","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\/271"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=108841"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/108841\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/90176"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=108841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=108841"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=108841"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=108841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}