Daemon Goldsmith - Order Flow Trading For Fun And Profit.pdf -
if flow == 1: # Aggressive buyer hits our ask cash += ask_limit inventory -= 1 elif flow == -1: # Aggressive seller hits our bid cash -= bid_limit inventory += 1
import numpy as np import pandas as pd spread = 0.05 half_spread = spread / 2 mid_price = 100.00 inventory = 0 cash = 10000 num_trades = 1000 Daemon's limit prices bid_limit = mid_price - 0.02 ask_limit = mid_price + 0.07 daemon goldsmith - order flow trading for fun and profit.pdf
Typical output (varies by random seed):