You are browsing as a guest. Sign up (or log in) to start making projects!

3h 59m 9s logged

Devlog 08

hi :D.

Before writing out the Streamlit code, I decided to setup the actual pipeline to connect the frontend to the backtesting engine. bridge.py now handles the transfer of UI control outputs to commands in the engine.

All the streamlit app has to do now is pass input parameters into CortexBridge and receive a payload. This makes sure the web client and backend stay completely seperate.

Bridge features:

  • BacktestPayload is the dataclass that returns everything Streamlit will need. This includes the formatted metrics (Total return, Sharpe, etc.), the equity curve df, the trade history table, and execution logs.
  • looks for local sqlite databases, falls back to local csv files, or generates synthetic data if the ticker data isn’t available
  • signals are delayed by 1 bar so that the strategy can’t cheat by knowing the future prices, and trading costs like fees and slippage are also factored into every executed trade
  • bunch of error handling and logging

Whats next?

Next up is building the full Streamlit layout and hooking it up to the bridge.

0
14

Comments 0

No comments yet. Be the first!