Skip to content

🐺 NOCTURNA Trading System

NOCTURNA Trading System: a wolf under a crescent moon beside rising candlestick charts

A trading robot that refuses to fool you.
Connect a free Alpaca paper account β†’ it trades a calm stocks-and-bonds portfolio behind hard safety limits β†’ you watch it from your phone, and no "clever" strategy gets a cent until it survives a gauntlet of tests built to catch lucky backtests.

Paper trading only, on purpose

Live trading is switched off in the code: the app won't start unless TRADING_MODE=PAPER and it points at Alpaca's paper API. No strategy here has passed out-of-sample validation, so none should be trusted with real money.

πŸ€” What is this?

Most trading bots you find online come with a gorgeous backtest: a line that goes up and to the right forever. Then they meet the real market. πŸ“‰ The backtest was luck, tuned until it looked good.

NOCTURNA is built the other way round. It's a self-hosted robot for one person that trades US ETFs through Alpaca, and it's paranoid by design:

  • πŸ›‘οΈ Safety first. Every order, from the robot or from you, passes one risk gate. If the account falls 10% below its peak, trading halts and every position is closed.
  • πŸ§ͺ No strategy on faith. A new idea must survive walk-forward testing, a deflated Sharpe ratio, an overfitting test and triple trading costs before it may trade.
  • πŸ’΅ Idle cash works. Whatever the safety rules leave unused sits in T-bills (BIL).
  • πŸŽ›οΈ You choose what trades. Pick strategies and their shares, tune the risk limits inside hard bounds, and backtest or validate a mix in the dashboard's strategy lab first.
  • πŸ“± It lives in your pocket. A phone-first dashboard in a night theme, and a Telegram bot.
  • 🏠 It runs at home, 24/7. One setup script, Docker, daily backups, alerts and a dead man's switch.

πŸš€ Where to start

I want to… Read this
set it up on a home server, step by step Home server
look after it once it runs: alerts, upgrades, incidents, backups Runbook
know every setting, the API and the safety limits in full Technical reference
understand how the engine, risk gate and validation fit together Architecture
see the plan and why each decision was made Roadmap
see every strategy idea tested, with its sources and its result Strategy shortlist

πŸ–ΌοΈ The dashboard

The dashboard on a desktop: the controls, the account, the equity curve, the strategy mix and the positions

The moonlit sign-in page with the Nocturna wolf Editing the strategy mix on a phone The emergency stop dialog

A backtest in the strategy lab

Screenshots from the built-in simulator, with made-up prices, not a real account.

πŸ“œ License

MIT: free to use, change and share. The code lives at github.com/Yog-Sotho/Nocturna-Trading-System.

Trading involves a substantial risk of loss. Nothing on this site is investment advice.