TAYU Academy course material · Python Quant Trading Lab
Text walkthrough
Local data adapter and API boundary
A self-paced text walkthrough, without video or audio. See the article below for worked examples and materials.
Course Notes
1. Understand the core idea of “Local data adapter and API boundary” and explain it in your own words
2. Master this module's focus: Research engine and interface boundary
3. Complete the assignment on your own and check it against the reference answer
Local adapter converts CSV fields to research engine input. External APIs also involve authentication, frequency, retries, and time zone; the code for this course does not require keys and does not connect to real services.
From research to execution, layers need to be defined: data adapter, signal, risk control, and execution. Data is passed between these layers through clear interfaces. This course only conducts offline research and does not connect to real accounts; any automated trading requires additional risk control approval and simulation validation.
Example: The signal module outputs "EURUSD target position 0.2 lot", and the risk control module checks the total exposure and daily loss limit before passing it to the execution module; in this lesson, the execution module only logs and does not place orders.
Declaration of input schema → column-by-column validation → monotonic/uniqueness check of time → invalid input returns clear error → engine accepts only validated records.
For `timestamp`, `open`, `high`, `low`, `close`, and `volume`, set minimum constraints. Explain how to handle missing `close` values and expired timestamps.
Rejected due to missing data; time is parseable and in UTC, OHLC valid, values limited, and volume non-negative; expired inputs are marked and related requests are paused without pretending new quotes with the last price.
Local engine reads the same synthetic CSV file, first generating past window features, then lagging the signal by one period for studying yield in the next timeframe. It also adds cost calculation based on turnover, outputting the equity before and after costs and drawdown. Changing the terminal to a simulated matching engine should not alter the feature calculation.
Keys should not be outputted in the browser or notebook; successful offline does not prove a real platform connection or successful trades.
The script covers data cleaning, a traceable next-open simulation, and equity and risk arithmetic. It is not a production trading engine; the hand calculations and report tasks for this lesson still have to be done independently.
python research_lab.py --self-test
python research_lab.py --output academy-results1. Separate research, risk control and execution
2. Clear interfaces make testing easier
3. This lesson does not connect to a real account
Risk warning: leveraged trading in forex, precious metals and similar products carries a high level of risk and you may lose all of your capital, or more. This course is for education only. It is not investment advice and does not promise any return. Example prices and contract specifications are teaching assumptions; always use what your own platform discloses. Past performance and backtests do not indicate future results.
All values, prices, accounts and cases in this course are teaching assumptions; the fixed materials can be reproduced offline. Marking a lesson complete only records your study. It is not a certification, a service approval or a promise of returns. Workbooks and answer files are currently provided in Chinese.
Key Takeaways
Completion records your own study, not verified competence. Exercises use fictional data; no real account or deposit is required.