Skip to content

Instantly share code, notes, and snippets.

dtoma / emacs.el
Created April 20, 2023 15:10
Emacs defaults
(delete-selection-mode 1)
(require 'ido)
(ido-mode t)
# Code quality
## Level 0
Typically a script that is ran once or occasionally. Defining characteristics include:
- No functions, code is copy-pasted rather than factored out
- No logging
- Values are hardcoded, eg. write `3.14` all over the place instead of using `PI = 3.14`
- `assert` isn't used anywhere
import asyncio
from collections import defaultdict
import numpy as np
TSDB = defaultdict(np.array)
class Server:
import time
import requests
from bs4 import BeautifulSoup
latex_template = r"""\documentclass[imperial, twoside, 12pt]{octavo}
\centering{\large %s }
dtoma / gist:bf10ee39ee0e2652de83ddb966f96f2a
Created January 7, 2020 08:59
The Man Who Solved The Market
- Hiring smart people and letting them tinker
- Trial & error
- Internally: open and share
- Copious amounts of good data (good = cleaned up, accurate, long history)
- Short signals seems to bring most of the performance, the longer-term fund isn't performing as well. Because more people have time to hop on long term signals? They are easier to find (data more accessible)?
- statistical significance > having an explanation for the phenomenon
dtoma /
Last active January 3, 2020 03:27
Good and bad

Everything can be good or bad

State Machines

Design Patterns

Interpreted Languages


dtoma /
Last active January 31, 2020 13:39
Into the Black Box

Notes from "Inside the Black Box: a Simple Guide to Quantitative and High-Frequency Trading"

Chapter 5 - Transaction cost models

  • commissions & fees (brokers)
    • clearing: reporting, monitoring, taxes...
    • settlement: deliver of securities in exchange for payment in full
    • transaction costs
  • slippage [1]
  • market moves between the decision & the execution
dtoma /
Created December 29, 2019 07:16
Python exception handling
# ...
exception (KeyError, ValueError):'Attempted to call x with invalid input', exc_info=True)
raise InvalidDataCustomError('Invalid data used to call X') from None
dtoma /
Last active December 30, 2019 06:03
Workout ideas

Wall squats

  1. Stand facing a wall with your nose and toes against it. Your feet should be slightly wider than shoulder width with your feet angled out very slightly.

  2. Squat down as far as possible with your arms hanging between your legs. (I prefer this to the variation where the arms are kept high.) With each rep, you should be able to drop a little farther.