- Use CUSUM techniques to trade securities
- SPY,SPYV,SPYG,HSI daily adj. close from Yahoo Finance
- Step1: Download SPY,SPYV,SPYG,HSI daily adj. close
- Step2: Plot time series, cumulative, and kde of log-return
- Step3: Calculate basic statistics of log-return
- Step1: Set length of the rolling window, trading period, cusum threshold
- Step2: Get the today's data and the last window-length data
- Step3: Calibrate parameters of the distribution functions
- Step4: Calculate cusum statistics
- Step5: Determine positions based on cusum statistics relative to the threshold
- Step6: Calculate the cumulative return
- Step7: Plot cusum statistics and cumulative return marked with trading signals
- Step8: Compare results of SPY vs HSI
- Step9: Compare results of SPYG vs SPYV






