TAYU Academy course material · Quant Risk Framework
Text walkthrough
Drawdown calculation
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 “Drawdown calculation” 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
Drawdown algorithm maintains historical peak equity level by points, comparing ratios rather than absolute differences. Initial peak, non-positive equity, cash flow, and missing value all need to be defined.
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 equity sequence → Update running max → Calculate 1−equity/peak → Take maximum → Record peak and valley points → Adjust cash flow separately.
Equity 100/120/108/126/113.4: find the two trough drawdowns and the maximum.
108/120 corresponds to 10%, and 113.4/126 also corresponds to 10%. The maximum is 10%. It cannot use the initial value of 100 as the denominator for all. It also cannot delete the previous old drawdown before the new high in the subsequent periods.
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.