Registration
Submit your algorithm
Upload one Python file. It runs one trading day at a time on market data since 2016 and never sees tomorrow. Its trades then go through the eight Trials. Any algorithm works: rules, statistics or machine learning.
How to write it
Your file needs two things:
UNIVERSE = ["SPY", "AAPL", "TLT"] # 1–20 US stocks or ETFs
def decide(history, state):
...
return {"SPY": 1, "AAPL": -0.5} # tomorrow's position per symbol
- history
- A dict of pandas DataFrames, one per symbol, with columns
open high low close volumeand a date index. Each holds every trading day up to and including today, never tomorrow, split- and dividend-adjusted. A symbol listed after 2016 starts on its first trading day. - state
- A dict that stays alive across days. Use it to keep a trained model, refit it every month, count trades, or anything else. Starts empty.
- return
- Your target position for each symbol from the next day's open, between
-1(fully short) and1(fully long). Fractions size the position. Leave a symbol out, or return0, to be flat. Out-of-range values are clipped. - how it trades
- Positions change at the next open, after a 20 bp round-trip cost (0.20%) on every change. Trial 3 checks the result also survives double that.
- libraries
- numpy, pandas, scipy, scikit-learn, statsmodels, xgboost, lightgbm, PyTorch (CPU), plus Python's standard maths, statistics, collections, datetime, json and re modules. Nothing else can be imported.
- limits
- About 2 minutes of total CPU for the whole history, 4 GB of memory, and a 200 KB file. Randomness is seeded, so the same file gives the same result.
- not allowed
- No internet, no reading or writing files, and no other programs. Your code runs in an isolated sandbox. All data it can use arrives through
history. - speed tip
decideruns about 2,700 times. Compute rolling features ontail(n), not the whole history, and cache anything expensive instate.
What happens next
HashYour file is fingerprinted before it runs. Change one character and it is a new attempt.
RunOne trading day at a time in the sandbox. Each day's prices arrive only after it has decided the day before.
TrialsIts trades are tested against random timing and time-shifted copies of themselves, after costs, deflated by ideas tried.
VerdictUsually a few minutes. Pass or fail, it goes on the Wall. If your code crashes, you get the exact line, and nothing counts against you. A pass still faces 90 days of new data.