Fama-French Three Factors Model Plus KDJ Indicator Long-term Trading Strategy
1. Theory Model
1.1 Fama-French Three Factors Model
According to Fama-French Three Factors Model, stock return is determined by three factors, market risk, the outperformance of small cap versus large cap stock, and the outperformance of high book value to price ratio.

E(Rit) −Rft= βi[E(Rmt−Rft)] +siE(SMBt) +hiE(HMIt)

1.2 KDJ Indicator
In technical analysis of securities trading, the stochastic oscillator is a momentum indicator that uses support and resistance levels. The idea behind this indicator is that prices tend to close near the extremes of the recent range before turning points.
The 9-period stochastic oscillator is defined as follows.

%K = (Price - L9)/(H9 - L9) %D = 100*((K1+K2+K3)/3)

The signal for buy-in is when K-line cross D-line from bottom and the value of D stays low. The signal for sell-out is when K-line cross D-line from top and the value of D stays high.

1. Building Strategy
The trading logic is this. First, I use Fama-French Three Factors Model to find the right stocks pitch and build the portfolio. In the code, I calculate the following formula, take out values below zero, and get 100 smallest value to form the stock pool.

Then, I calculate each stock’s KDJ indicator. Most importantly, I need to get the value of K and D. The formula has mentioned above. Using KDJ parameters of 9,3,3, I use 3 for-loops and history data of 120 days to get the value.

Next, I need to find out which stock will highly trigger the KDJ signal for buy-in. And it is a long-only strategy.

Given the portfolio, I assign weights equally to each stock. Buy stocks at the beginning of every month. The next month, I sell all old stocks, choose new stocks and buy.

80
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
 Returns 1 Month 3 Month 6 Month 12 Month
 Alpha 1 Month 3 Month 6 Month 12 Month
 Beta 1 Month 3 Month 6 Month 12 Month
 Sharpe 1 Month 3 Month 6 Month 12 Month
 Sortino 1 Month 3 Month 6 Month 12 Month
 Volatility 1 Month 3 Month 6 Month 12 Month
 Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 59b7fa77a5e1cb5076f93fcf
There was a runtime error.