Do the following pack test
Required conditions
profit return rate of a portfolio consisting of the top 30 stocks by stock momentum
Considering 3 month, 6 month, and 12 month profit returns at the same time
Neutralize by sector
Calculate firm’s performance indicators
option conditions
Truncation or Windsorizing may or may not be required
Transaction costs can also be considered
You can use the bt package or use other methods.