TAYU Academy course material · Quant Risk Framework
Course Notes
1. Understand the core idea of “Pre-trade risk checks” and explain it in your own words
2. Master this module's focus: Expected shortfall (ES) and drawdown limits
3. Complete the assignment on your own and check it against the reference answer
Pre-trade checks validate data, quantities, and single and aggregate limits before requesting entry into the execution layer. They check actual and potential risks, not just the format of the request parameters.
Expected Shortfall (ES) is the average loss when exceeding Value at Risk (VaR), better reflecting tail risks. Drawdown constraints can be set as tiered rules: reducing risk when a certain drawdown is reached, and stopping trading when a larger drawdown is reached.
Worst 5% average daily loss is 2.6%, i.e., ES=2.6%; risk is reduced when the drawdown reaches 6%, and trading is stopped when it reaches 10%.
Validate integers and non-negative numbers → Check quote time → Check single transaction → Add inventory/in-transit → Reject and provide reason → Only submit qualified paper requests to the next layer.
Limit 250, existing 180, new request 90; another request has a NaN size. Give two different rejection reasons.
The former is `aggregate_limit`, and the latter is `invalid_numeric`. `NaN` comparisons are likely to be `false` all the time, and it must be checked for finiteness first to ensure it does not pass because it has not exceeded a threshold.
Fictional limit: total size ≤ 1000 units, existing 600, new order 500, total 1100, so it should be rejected; a stale quote time is also an independent reason to reject. Checking only that each 500 order is below 1000 is not enough. A NaN risk input must not be treated as 0 and let through.
Fail-open treats an unknown state as safe; after a restart, restore or re-verify the risk baseline instead of resetting it to zero.
This dependency-free script contains small labs for rank correlation, time folds, inventory valuation, covariance risk and rejection paths. The grid part only models buy-on-the-way-down inventory, with no sell-side recycling or real fills; the risk-parity part only demonstrates a given covariance and is not a general optimiser. Work from the report, and do not treat a small lab as a complete production strategy.
python strategy_labs.py1. ES adds a view of tail risk
2. Drawdown limits should be tiered
3. Rules must be written in advance
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.