FinTech Homework

Roger Jang


Due date: 2024/10/22 23:59:59

Trading Strategies Using Technical Indicators

Homework website

In this homework, you need to design a stock trading strategy to maximize the return over a given period of time.

Your design flowchart should be like this:
  1. Determine the TI you want to use, or any indicators designed by yourself.
  2. Define the trading strategy using the indicators, with some modifiable parameters for optimizing the return.
  3. Optimzie the return using the historical price data.
  4. Use the obtained parameters for trading over a longer period of time.

For instance, in the the example code of bestParamViaExhaustiveSearch.py, we use MA (moving average) as the TI, with the parameters of window size, alpha, beta. Then we maximize the return rate on "price3000open.csv" by exhaustive search with the command:

python bestParamByExhaustiveSearch.py price3000open.csv It will take a while to obtain the best settings with the maximum return rate: Best settings: windowSize=19, alpha=1, beta=2 ==> returnRate=2.540205 Then you can put these best parameters into the program myStrategy.py ", and try the trading strategy on the same dataset by typing python rrEstimate.py price3000open.csv The result is as expected: rr=254.020465% Other notes: