How shubhamanandjain/imc-prosperity-2023-stanford-cardinal works
Project Type and Purpose
• It’s an algorithmic trading system built for high-frequency, competitive market environments.
• The README indicates that the system had to handle multiple instruments (e.g., pearls, bananas, berries, diving gear, picnic baskets) and incorporate various strategies with different data inputs and outputs.
• The core purpose is to decide and execute trades—both manually (as hinted by the “manual trading” rounds) and algorithmically (with backtesting and live market order management).
Key Components
a. Trading Strategy Engine:
– Break this component into sub-modules or functions, possibly each targeting a distinct market or asset (e.g., pearls, bananas, berries, and picnic baskets).
– Indicate that within trader.py, logic handles conditional trading strategies and market signals. It might be useful to conceptually separate “Market-Making”, “Market-Taking”, “Pair-Trading”, “Regression-based Prediction”, and “Momentum-based” strategies.
b. Market Data Intake and Signal Processing:
– Even if not explicitly shown in multiple files, the design should highlight that the algorithm receives and processes market data (e.g., price feeds, order book data, and trades).
– Signals from price trends (like linear regression for bananas or signals from Olivia for ukuleles) should be represented.
c. Backtesting Module:
– The README describes an in-house backtester that lets the team test strategies via a “run” function. Conceptually isolate this module to show it receives historical data and outputs simulated PnL.
d. Order Execution and Risk Management:
– Illustrate a component that takes the outputs from the trading strategy engine and sends orders to the market. Also include a risk management layer that may compute positions and capital allocation (e.g., calculating the optimal investment percentage as described).
e. Logging/Monitoring/Analytics:
– Although there is no separate file for this, it’s always good to include a monitoring/logging component to capture trade results, performance metrics, and error logs (especially given the mention of AWS Lambda errors).
Relationships and Interactions
• Data flows from a Market Data Source (which could be an external provider) into the Signal Processing module. Processed data flows to the Trading Strategy Engine where multiple strategies (for different rounds or tickers) decide on trading actions.
• Decisions are passed to the Order Execution component, and the outcomes (trades, PnL, etc.) are fed back into the Logging/Analytics system.
• The Backtester can simulate this flow by replacing live market data with historical feeds, feeding into the same strategy engine, and comparing predicted versus actual outcomes.
Important Architectural Patterns
• Even though the code is consolidated in a single file (trader.py), the conceptual separation into modular components is key. Think in terms of a layered architecture:
• Data Input and Preprocessing Layer
• Trading Strategies (decision-making) Layer
• Execution and Risk Management Layer
• Testing and Analytics Layer
• The approach is pragmatic, given the time-critical trading environment; hence, the system is iterative with components that can be tweaked and tested independently (i.e., backtester versus live order execution).