TAYU Academy course material · Trading Data Analysis
Course Notes
1. Understand the core idea of “Data cleaning exercise” and explain it in your own words
2. Master this module's focus: Cleaning trading data
3. Complete the assignment on your own and check it against the reference answer
Data cleaning deliverables must retain both the original and the cleaned versions, and be able to trace each excluded record. Aligning counts to "no missing values" is more important.
Here are the steps for cleaning the trading records exported from the platform: deduplication, uniform time zone, complete the cost fields, and separate the records of opening positions from closing positions.
In the report exported from MT5, if the same order appears twice (partially filled), it should be merged by order number, and commissions and overnight interest should be included in the floating P/L.
Run data checks in research_lab → create an anomaly table → manually verify inputs: valid + duplicates + isolated → provide two manual review suggestions.
Submit OHLCV cleaning for counts of 240/1/3, then apply the duplicate key rule to the trading dirty table records; why can't we remove duplicates based on the amount of profit?
Equal profits from different trades can come from the same amount, and removing duplicates based on amount will delete true records. The OHLCV schema and the trading schema should be checked separately. One cannot count the transactions in one schema as valid based on evidence from the other schema.
The file trades-dirty.csv contains duplicate trades, invalid timestamps, and missing prices. Remove duplicates by unique trade ID and isolate invalid rows, providing the reason; do not delete loss rows as anomalies. Aggregate net profit/loss as gross profit + signed commission + signed overnight fee.
The same time does not mean a duplicate fill; de-duplicating by timestamp alone can delete legitimate partial fills.
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. Remove duplicates and unify time zones
2. All costs must be included
3. Merge records by order number
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.
Data cleaning deliverables must retain both the original and the cleaned versions, and be able to trace each excluded record. Aligning counts to "no missing values" is more important.
Record your work and compare the reference result. Self-checks are not verified competence.
Completion records your own study, not verified competence. Exercises use fictional data; no real account or deposit is required.