TAYU Academy course material · Machine Learning for Trading
Course Notes
1. Understand the core idea of “The reality of ML in trading” and explain it in your own words
2. Master this module's focus: LSTM experiment
3. Complete the assignment on your own and check it against the reference answer
Financial ML faces challenges in distribution shifts, small sample sizes, costs, and label noise. Predicting directionality does not necessarily translate to profitable trading. The magnitude, fees, and frequency all impact the net result.
LSTM is suitable for handling sequential data, with an input shape generally of (number of samples, time steps, feature number). Financial data is noisy and has a small number of samples, making deep models prone to overfitting. It should be compared with simple baseline models (such as logistic regression or random guessing).
For example, if the out-of-sample performance of a 30-step LSTM trained with 5 features does not outperform logistic regression, there is no reason to adopt a more complex model.
Separate classification output from execution rules → List costs and turnover → Check probability calibration → Set up failure monitoring → Clearly define market validation not yet done.
Predicting correctly earns $1 per trade, predicting incorrectly loses $3 per trade, with a win rate of 70%. What is the expected value without fees? Why could a high win rate still be ineffective?
0.7 \times 1 - 0.3 \times 3 = -0.2. Asymmetric amplitude leads to negative expected value even with a high win rate, and adding costs makes it worse; classification reports cannot replace the assessment of trading gains.
Assuming 32 samples, each with 20 steps, and 3 features per step, the shape is (32, 20, 3); hidden dimension is 8, and a single-layer output is (32, 20, 8), resulting in (32, 8) for the final moment, followed by a classification head outputting 32 logits. Labels cannot mimic future directions within a window by pretending to be the last known direction.
A good fit on a synthetic series is not price-forecasting ability; never use final test results to choose network size.
Install the dependencies listed for this lab in the README first. If a dependency or platform is unavailable, mark the lab as not run; downloading the source is not evidence of running it.
python lstm_lab.py1. Mind the input shape
2. Compare against a simple baseline model
3. More complex is not better
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.