diff --git a/_config.yml b/_config.yml index 2fbbf02..39a2fb9 100644 --- a/_config.yml +++ b/_config.yml @@ -8,47 +8,47 @@ # Basic Site Settings locale : "en-US" -title : "Your Name / Site Title" -title_separator : "-" -name : &name "Your Name" -description : &description "personal description" -url : https://academicpages.github.io # the base hostname & protocol for your site e.g. "https://mmistakes.github.io" +title : "Robert Bach" +title_separator : "" +name : &name "Robert Bach" +description : &description "Robert's personal website" +url : https://baobach.github.io # the base hostname & protocol for your site e.g. "https://mmistakes.github.io" baseurl : "" # the subpath of your site, e.g. "/blog" -repository : "academicpages/academicpages.github.io" +repository : "baobach/baobach.github.io" # Site Author - The following control what appear as part of the author content on the side bar. # If a field is blank the icon and link will not appear, otherwise it will be shown. # Additional customization can be done by editing /_includes/author-profile.html author: # Biographic information - avatar : "profile.png" - name : "Your Sidebar Name" + avatar : "profile_picture.jpg" + name : "Robert Bach" pronouns : # example: "she/her" - bio : "Short biography for the left-hand sidebar" - location : "Earth" - employer : "Red Brick University" + bio : "My name is Robert and I am pursuing a career in Quantitative Finance. I want to apply my mathematical skills in machine learning algorithm development, portfolio return optimization, and trading derivatives. I am seeking opportunities to contribute expertise in quantitative finance, data analysis, and computational skills to drive innovative strategies in the financial domain." + location : "Bangkok City" + employer : uri : # URL - email : "none@example.org" + email : "robert@quantfin.net" # Academic websites arxiv : # URL - Update with the correct link to your profile - googlescholar : "https://scholar.google.com/citations?user=PS_CX0AAAAAJ" + googlescholar : #"https://scholar.google.com/citations?user=PS_CX0AAAAAJ" impactstory : # URL - orcid : "http://orcid.org/yourorcidurl" + orcid : #"http://orcid.org/yourorcidurl" semantic : # URL - pubmed : "https://www.ncbi.nlm.nih.gov/pubmed/?term=john+snow" + pubmed : #"https://www.ncbi.nlm.nih.gov/pubmed/?term=john+snow" researchgate : # URL # Repositories and software development bitbucket : # Username - Update with your username on the site codepen : # Username dribbble : # Username - github : "academicpages" + github : "baobach" kaggle : # Username stackoverflow : # User number or user number and name (i.e., use "1" or "1/jeff-atwood") # Social media - bluesky : "bsky.app" # Replace this with you Bluesky username + bluesky : #"bsky.app" # Replace this with you Bluesky username facebook : # Username flickr : # Username foursquare : # Username @@ -57,7 +57,7 @@ author: keybase : # Username instagram : # Username lastfm : # Username - linkedin : # Username + linkedin : "robertbachvan" mastodon : # URL medium : # URL pinterest : # Username @@ -76,11 +76,11 @@ author: # Publication Category - The following the list of publication categories and their headings publication_category: books: - title: 'Books' + title: #'Books' manuscripts: - title: 'Journal Articles' + title: #'Journal Articles' conferences: - title: 'Conference Papers' + title: #'Conference Papers' # Site Settings teaser : # filename of teaser fallback teaser image placed in /images/, .e.g. "500x300.png" diff --git a/_data/navigation.yml b/_data/navigation.yml index 5959f58..93026e7 100644 --- a/_data/navigation.yml +++ b/_data/navigation.yml @@ -5,23 +5,10 @@ # prevent it from being included in the site. main: - - title: "Publications" - url: /publications/ - - - title: "Talks" - url: /talks/ - - - title: "Teaching" - url: /teaching/ - - - title: "Portfolio" - url: /portfolio/ - title: "Blog Posts" url: /year-archive/ - title: "CV" url: /cv/ - - - title: "Guide" - url: /markdown/ + diff --git a/_pages/about.md b/_pages/about.md index 4978873..d1f298c 100644 --- a/_pages/about.md +++ b/_pages/about.md @@ -1,49 +1,52 @@ --- permalink: / -title: "Academic Pages is a ready-to-fork GitHub Pages template for academic personal websites" +title: "Who is this Robert guy?" author_profile: true redirect_from: - /about/ - /about.html --- -This is the front page of a website that is powered by the [Academic Pages template](https://github.com/academicpages/academicpages.github.io) and hosted on GitHub pages. [GitHub pages](https://pages.github.com) is a free service in which websites are built and hosted from code and data stored in a GitHub repository, automatically updating when a new commit is made to the respository. This template was forked from the [Minimal Mistakes Jekyll Theme](https://mmistakes.github.io/minimal-mistakes/) created by Michael Rose, and then extended to support the kinds of content that academics have: publications, talks, teaching, a portfolio, blog posts, and a dynamically-generated CV. You can fork [this repository](https://github.com/academicpages/academicpages.github.io) right now, modify the configuration and markdown files, add your own PDFs and other content, and have your own site for free, with no ads! An older version of this template powers my own personal website at [stuartgeiger.com](http://stuartgeiger.com), which uses [this Github repository](https://github.com/staeiou/staeiou.github.io). - -A data-driven personal website -====== -Like many other Jekyll-based GitHub Pages templates, Academic Pages makes you separate the website's content from its form. The content & metadata of your website are in structured markdown files, while various other files constitute the theme, specifying how to transform that content & metadata into HTML pages. You keep these various markdown (.md), YAML (.yml), HTML, and CSS files in a public GitHub repository. Each time you commit and push an update to the repository, the [GitHub pages](https://pages.github.com/) service creates static HTML pages based on these files, which are hosted on GitHub's servers free of charge. - -Many of the features of dynamic content management systems (like Wordpress) can be achieved in this fashion, using a fraction of the computational resources and with far less vulnerability to hacking and DDoSing. You can also modify the theme to your heart's content without touching the content of your site. If you get to a point where you've broken something in Jekyll/HTML/CSS beyond repair, your markdown files describing your talks, publications, etc. are safe. You can rollback the changes or even delete the repository and start over -- just be sure to save the markdown files! Finally, you can also write scripts that process the structured data on the site, such as [this one](https://github.com/academicpages/academicpages.github.io/blob/master/talkmap.ipynb) that analyzes metadata in pages about talks to display [a map of every location you've given a talk](https://academicpages.github.io/talkmap.html). - -Getting started -====== -1. Register a GitHub account if you don't have one and confirm your e-mail (required!) -1. Fork [this repository](https://github.com/academicpages/academicpages.github.io) by clicking the "fork" button in the top right. -1. Go to the repository's settings (rightmost item in the tabs that start with "Code", should be below "Unwatch"). Rename the repository "[your GitHub username].github.io", which will also be your website's URL. -1. Set site-wide configuration and create content & metadata (see below -- also see [this set of diffs](http://archive.is/3TPas) showing what files were changed to set up [an example site](https://getorg-testacct.github.io) for a user with the username "getorg-testacct") -1. Upload any files (like PDFs, .zip files, etc.) to the files/ directory. They will appear at https://[your GitHub username].github.io/files/example.pdf. -1. Check status by going to the repository settings, in the "GitHub pages" section - -Site-wide configuration ------- -The main configuration file for the site is in the base directory in [_config.yml](https://github.com/academicpages/academicpages.github.io/blob/master/_config.yml), which defines the content in the sidebars and other site-wide features. You will need to replace the default variables with ones about yourself and your site's github repository. The configuration file for the top menu is in [_data/navigation.yml](https://github.com/academicpages/academicpages.github.io/blob/master/_data/navigation.yml). For example, if you don't have a portfolio or blog posts, you can remove those items from that navigation.yml file to remove them from the header. - -Create content & metadata ------- -For site content, there is one markdown file for each type of content, which are stored in directories like _publications, _talks, _posts, _teaching, or _pages. For example, each talk is a markdown file in the [_talks directory](https://github.com/academicpages/academicpages.github.io/tree/master/_talks). At the top of each markdown file is structured data in YAML about the talk, which the theme will parse to do lots of cool stuff. The same structured data about a talk is used to generate the list of talks on the [Talks page](https://academicpages.github.io/talks), each [individual page](https://academicpages.github.io/talks/2012-03-01-talk-1) for specific talks, the talks section for the [CV page](https://academicpages.github.io/cv), and the [map of places you've given a talk](https://academicpages.github.io/talkmap.html) (if you run this [python file](https://github.com/academicpages/academicpages.github.io/blob/master/talkmap.py) or [Jupyter notebook](https://github.com/academicpages/academicpages.github.io/blob/master/talkmap.ipynb), which creates the HTML for the map based on the contents of the _talks directory). - -**Markdown generator** - -I have also created [a set of Jupyter notebooks](https://github.com/academicpages/academicpages.github.io/tree/master/markdown_generator -) that converts a CSV containing structured data about talks or presentations into individual markdown files that will be properly formatted for the Academic Pages template. The sample CSVs in that directory are the ones I used to create my own personal website at stuartgeiger.com. My usual workflow is that I keep a spreadsheet of my publications and talks, then run the code in these notebooks to generate the markdown files, then commit and push them to the GitHub repository. - -How to edit your site's GitHub repository ------- -Many people use a git client to create files on their local computer and then push them to GitHub's servers. If you are not familiar with git, you can directly edit these configuration and markdown files directly in the github.com interface. Navigate to a file (like [this one](https://github.com/academicpages/academicpages.github.io/blob/master/_talks/2012-03-01-talk-1.md) and click the pencil icon in the top right of the content preview (to the right of the "Raw | Blame | History" buttons). You can delete a file by clicking the trashcan icon to the right of the pencil icon. You can also create new files or upload files by navigating to a directory and clicking the "Create new file" or "Upload files" buttons. - -Example: editing a markdown file for a talk -![Editing a markdown file for a talk](/images/editing-talk.png) - -For more info ------- -More info about configuring Academic Pages can be found in [the guide](https://academicpages.github.io/markdown/). The [guides for the Minimal Mistakes theme](https://mmistakes.github.io/minimal-mistakes/docs/configuration/) (which this theme was forked from) might also be helpful. +## Hi  ðŸ‘‹ + +My name is Robert and I am pursuing a career in Quantitative Finance. I want to apply my mathematical skills in machine learning algorithm development, portfolio return optimization, and trading derivatives. I am seeking opportunities to contribute expertise in quantitative finance, data analysis, and computational skills to drive innovative strategies in the financial domain. + +Reach me at: + +## Key Skills & Tools  ðŸ§° + +![Python](https://img.shields.io/badge/-Python-0D1117?style=flat-square&logo=python) +![C#](https://img.shields.io/badge/C%23-%23239120.svg?logo=csharp&logoColor=white) +![Bash](https://img.shields.io/badge/-Bash-0D1117?style=flat-square&logo=gnu-bash) +![Git](https://img.shields.io/badge/-Git-0D1117?style=flat-square&logo=git) +![Docker](https://img.shields.io/badge/-Docker-0D1117?style=flat-square&logo=docker) +![VS Code](https://img.shields.io/badge/-VSCode-0D1117?style=flat-square&logo=visualstudiocode) +![PostgreSQL](https://img.shields.io/badge/-PostgreSQL-0D1117?style=flat-square&logo=postgresql) +![Anaconda](https://img.shields.io/badge/-Anaconda-0D1117?style=flat-square&logo=anaconda) +![NumPy](https://img.shields.io/badge/-NumPy-0D1117?style=flat-square&logo=numpy) +![Pandas](https://img.shields.io/badge/-Pandas-0D1117?style=flat-square&logo=pandas) +![Plotly](https://img.shields.io/badge/-Plotly-0D1117?style=flat-square&logo=plotly) +![SciPy](https://img.shields.io/badge/-SciPy-0D1117?style=flat-square&logo=scipy) +![Scikit Learn](https://img.shields.io/badge/-Scikit_Learn-0D1117?style=flat-square&logo=scikitlearn) +![Tensorflow](https://img.shields.io/badge/-Tensorflow-0D1117?style=flat-square&logo=tensorflow) +![Keras](https://img.shields.io/badge/-Keras-0D1117?style=flat-square&logo=keras) +![MongoDB](https://img.shields.io/badge/-MongoDB-0D1117?style=flat-square&logo=mongodb) +![Django](https://img.shields.io/badge/-Django-0D1117?style=flat-square&logo=django) +![Ethereum](https://img.shields.io/badge/-Ethereum-0D1117?style=flat-square&logo=ethereum) + +* Quant skills: Probability theory, Stochastic Calculus, Montecarlo Method, Risk Modeling, Portfolio Optimization, Algorithmic Trading Strategy; +* $\LaTeX$: various documents and custom templates; +* Agile project management methodology. + +## Work Experience  ðŸ‘” + +| Position | Company | Field | Time Period | +| --------------------------- | ------------------------- | ------------------------------- | -------------------- | +| Algorithmic Trading Dev | Free Lance | Algorithmic Trading | 01/2024 — Present | +| Quant Researcher | Riot Investment Strategy | Backtesting Engine | 01/2024 — Present | +| Growth Manager | Incognito.org | Growth Consulting - Blockchain | 12/2021 — 02/2023 | + +## Education  ðŸŽ“ + +Certificate in Quantitative Finance, CQF\ +**FitchLearning, London** diff --git a/_portfolio/portfolio-1.md b/_portfolio/bl-portfolio.md similarity index 100% rename from _portfolio/portfolio-1.md rename to _portfolio/bl-portfolio.md diff --git a/_portfolio/portfolio-2.html b/_portfolio/portfolio-2.html deleted file mode 100644 index 8a0c6eb..0000000 --- a/_portfolio/portfolio-2.html +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: "Portfolio item number 2" -excerpt: "Short description of portfolio item number 2
" -collection: portfolio ---- - -This is an item in your portfolio. It can be have images or nice text. If you name the file .md, it will be parsed as markdown. If you name the file .html, it will be parsed as HTML. diff --git a/_posts/2012-08-14-blog-post-1.md b/_posts/2012-08-14-blog-post-1.md deleted file mode 100644 index 8d4819a..0000000 --- a/_posts/2012-08-14-blog-post-1.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: 'Blog Post number 1' -date: 2012-08-14 -permalink: /posts/2012/08/blog-post-1/ -tags: - - cool posts - - category1 - - category2 ---- - -This is a sample blog post. Lorem ipsum I can't remember the rest of lorem ipsum and don't have an internet connection right now. Testing testing testing this blog post. Blog posts are cool. - -Headings are cool -====== - -You can have many headings -====== - -Aren't headings cool? ------- \ No newline at end of file diff --git a/_posts/2013-08-14-blog-post-2.md b/_posts/2013-08-14-blog-post-2.md deleted file mode 100644 index f5c960d..0000000 --- a/_posts/2013-08-14-blog-post-2.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: 'Blog Post number 2' -date: 2013-08-14 -permalink: /posts/2013/08/blog-post-2/ -tags: - - cool posts - - category1 - - category2 ---- - -This is a sample blog post. Lorem ipsum I can't remember the rest of lorem ipsum and don't have an internet connection right now. Testing testing testing this blog post. Blog posts are cool. - -Headings are cool -====== - -You can have many headings -====== - -Aren't headings cool? ------- \ No newline at end of file diff --git a/_posts/2014-08-14-blog-post-3.md b/_posts/2014-08-14-blog-post-3.md deleted file mode 100644 index 83175c7..0000000 --- a/_posts/2014-08-14-blog-post-3.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: 'Blog Post number 3' -date: 2014-08-14 -permalink: /posts/2014/08/blog-post-3/ -tags: - - cool posts - - category1 - - category2 ---- - -This is a sample blog post. Lorem ipsum I can't remember the rest of lorem ipsum and don't have an internet connection right now. Testing testing testing this blog post. Blog posts are cool. - -Headings are cool -====== - -You can have many headings -====== - -Aren't headings cool? ------- \ No newline at end of file diff --git a/_posts/2015-08-14-blog-post-4.md b/_posts/2015-08-14-blog-post-4.md deleted file mode 100644 index 9e882e6..0000000 --- a/_posts/2015-08-14-blog-post-4.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: 'Blog Post number 4' -date: 2015-08-14 -permalink: /posts/2012/08/blog-post-4/ -tags: - - cool posts - - category1 - - category2 ---- - -This is a sample blog post. Lorem ipsum I can't remember the rest of lorem ipsum and don't have an internet connection right now. Testing testing testing this blog post. Blog posts are cool. - -Headings are cool -====== - -You can have many headings -====== - -Aren't headings cool? ------- \ No newline at end of file diff --git a/_posts/2024-08-29-ohlc-resampling.md b/_posts/2024-08-29-ohlc-resampling.md new file mode 100644 index 0000000..b83ac12 --- /dev/null +++ b/_posts/2024-08-29-ohlc-resampling.md @@ -0,0 +1,90 @@ +--- +title: 'Enhancing Algorithmic Trading Backtesting with Custom OHLC Resampling' +date: 2012-08-14 +permalink: /posts/2012/08/blog-post-1/ +tags: + - cool posts + - category1 + - category2 +--- + +In algorithmic trading, the accuracy of backtesting can make or break a strategy. The ability to simulate how your trading algorithm would have performed historically is crucial for refining and optimizing your approach. A key aspect of this process is how time series data, particularly OHLC (Open, High, Low, Close) data, is handled. While pandas provides a built-in method for resampling, it often falls short when dealing with the unique demands of financial data. In this post, we’ll explore a custom OHLC resampling function that offers greater precision, allowing for more reliable backtesting results. + +The Limitations of Pandas’ OHLC Resampling +====== + +Pandas is a powerful tool for data manipulation, widely used in the data science community. However, its built-in `resample()` method, while convenient, can be problematic when dealing with financial data. Traditional resampling methods may not correctly capture the nuances of OHLC data, particularly when dealing with irregular time intervals, missing data, or the specific needs of different timeframes (e.g., hourly vs. daily). These limitations can lead to inaccurate calculations of open, high, low, and close values, which in turn can skew backtesting results. + +Introducing the Custom OHLC Resampling Function +====== + +To overcome these limitations, I’ve developed a custom resampling function tailored specifically for OHLC data. This function is designed to respect the intricacies of financial time series, ensuring that each resampled interval accurately reflects the market’s behavior during that period. Here’s the function: + +```python +# Custom OHLC Resampling Function +def resample_ohlc(dataframe, time_delta): + # Make a copy of the DataFrame to avoid modifying the original data + dataframe = dataframe.copy() + + # Define the resampling rule + if time_delta == '1h': + step = pd.Timedelta(hours=1) + elif time_delta == '1d': + step = pd.Timedelta(hours=23, minutes=59) + elif time_delta == '1w': + step = pd.Timedelta(weeks=1) + else: + raise ValueError('Invalid time delta') + + # Initialize an empty DataFrame to store the resampled data + resampled_data = pd.DataFrame(columns=['open', 'high', 'low', 'close']) + + # Iterate over the rows of the DataFrame with a step size corresponding to the time delta + start = dataframe.index[0] + while start < dataframe.index[-1]: + end = start + step + + # Select the slice of the DataFrame from the current index to the next point in the time delta + slice = dataframe.loc[start:end] + + # Check if the slice is empty + if slice.empty: + # Move to the next point in the time delta + start = end + continue + + # Calculate the open, high, low, and close values for this slice + open = slice.open.iloc[0] + high = slice[['open', 'high', 'low', 'close']].max().max() + low = slice[['open', 'high', 'low', 'close']].min().min() + close = slice.close.iloc[-1] + + # Append these values to the resampled DataFrame + resampled_data.loc[start] = [open, high, low, close] + + # Move to the next point in the time delta + start = end + + return resampled_data +``` + +Why This Approach Is Superior +====== + +Unlike the default pandas resampling method, this custom function directly addresses the issues commonly encountered with financial data. Here’s how: + +- **Precision in Time Intervals**: The function uses pandas’ `Timedelta` to ensure that each time interval is handled accurately, whether you’re resampling by hour, day, or week. + +- **Accurate OHLC Calculation**: By manually selecting the open, high, low, and close values for each resampled period, this method avoids the pitfalls of aggregation methods that may miss critical data points or misrepresent the data. + +- **Handling Edge Cases**: The function intelligently handles empty slices (e.g., periods with no trading activity) and moves to the next interval without skewing the data. + +These enhancements ensure that your backtesting process is based on data that truly reflects market conditions, leading to more reliable and actionable insights. + +To see the impact of this function, imagine backtesting a strategy on daily OHLC data. Using pandas’ built-in method might miss subtle but significant market movements, leading to a distorted view of your strategy’s performance. With the custom resampling function, however, every tick is accounted for, ensuring that the backtest accurately represents what would have happened in a real trading environment. This level of precision is invaluable for refining your strategies and gaining confidence before deploying them in live markets. + +Conclusion +====== + +In the high-stakes world of algorithmic trading, precision is key. The custom OHLC resampling function provided here offers a more accurate and reliable way to handle time series data, enabling more trustworthy backtesting results. By replacing the standard pandas method with this tailored approach, you can ensure that your strategies are tested against data that truly reflects market realities. As you refine your trading algorithms, this tool will be an invaluable asset in your pursuit of success. +------ diff --git a/_posts/2199-01-01-future-post.md b/_posts/2199-01-01-future-post.md deleted file mode 100644 index e96eb5e..0000000 --- a/_posts/2199-01-01-future-post.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: 'Future Blog Post' -date: 2199-01-01 -permalink: /posts/2012/08/blog-post-4/ -tags: - - cool posts - - category1 - - category2 ---- - -This post will show up by default. To disable scheduling of future posts, edit `config.yml` and set `future: false`. diff --git a/images/blogs/bl-construct.png b/images/blogs/bl-construct.png new file mode 100644 index 0000000..63fa595 Binary files /dev/null and b/images/blogs/bl-construct.png differ diff --git a/images/profile_picture.jpg b/images/profile_picture.jpg new file mode 100644 index 0000000..c4ef22c Binary files /dev/null and b/images/profile_picture.jpg differ