Other

This page details various smaller projects and technical endeavors, ranging from AWS backend development to algorithmic trading systems.

Automated Work-Shift Scheduler (2023)

Built an AWS backend and event-driven notification/SMS system for scheduling work-shifts. It was part of a broader product where the Admin and Client functionalities were handled by other teammates. It was a side project done with a 3-person team, and my deliveries was the entire backend, DB, and related business logic. Project was shelved after MVP due to the team moving on to other projects.

Stack

AWS SAM, Lambda, Aurora DB, AWS EventBridge, AWS SNS, Prisma ORM, TypeScript, and Twilio

Bli Med Oss (2019)

A web-based 3D game for reporting indoor climate, developed as part of my Research Assistant role at NTNU. You can interact with the project here.

Stack

React, Three.js, HTML, CSS, JavaScript, Squarespace, and CAD

As an investor, I have periodically utilized algorithmic order execution and backtesting. Done part-time over several years as a way to understand the underlying logic behind investing better. I use data from multiple sources, and Interactive Brokers due to the maturity of its commonly available software integrations.

Broker Stack

IB GW through this project, TWS, ib_insync, Python

For regular joe investing, I use Nordnet since it’s reporting fits well with my approach and they provide Norway specific accounts.

Backtesting

As part of both swing trading, options-trading, ETF allocation, and general ideation, I usually run some backtests before committing to a strategy. Usually as simple as a single Python script taking in data from both yfinance, IBKR, DataBento depending on the type of instrument and its availability to do some transformations and plot it out.

My general risk metrics are historical drawdown and drawdown correlation between holdings. My general performance metrics are backtested returns (using Sortino) against the benchmark index across favorable and unfavorable market regimes. The approach is very simple and flawed, but allows for direct comparison against commonly available ETF and mutual fund data.

Backtesting Stack:

Python, pandas, yfinance, numpy, and seaborn

Trade Executor

Initially built to algorithmically handle order entries and exits, such as staggered stock buys with multiple limits, or a sell order if some non-price condition is met. It was later expanded to do both buy, sells, and monitoring the state of each strategy within an event loop.

The rough architecture was entry and exit strategies implementing a BaseStrategy and wrapping listeners and order submissions around ib_insync, all ran by a top-level worker process. Additionally, at the top level, there are separate strategy-dependent data feeds (usually just fetching the price) and handling of per-step conditionals to move the worker state from entry through exit. The system has been tested with paper-trades as part of backtesting and been used live twice. It has not been stress-tested at scale.

Portfolio System Stack:

Python, AsyncIO, ib_insync

Full Portfolio System

There have been attempts at a broader top-down portfolio/rebalancing/order scheduling system. Versions of this system have only ever been used for paper trading.

Rough Design:

Applying a fully automated system to real trades is hard to justify as opposed to ad-hoc trades, when most API-accessible brokers exist outside the Norwegian deferred-tax account regime. A prior would also be for the executor to be properly field-tested.

Portfolio System Stack: Python, Docker, FastAPI, AsyncIO