(self)
| 77 | level = 70 |
| 78 | |
| 79 | def init(self): |
| 80 | # Compute moving averages the strategy demands |
| 81 | self.ma10 = self.I(SMA, self.data.Close, 10) |
| 82 | self.ma20 = self.I(SMA, self.data.Close, 20) |
| 83 | self.ma50 = self.I(SMA, self.data.Close, 50) |
| 84 | self.ma100 = self.I(SMA, self.data.Close, 100) |
| 85 | |
| 86 | # Compute daily RSI(30) |
| 87 | self.daily_rsi = self.I(RSI, self.data.Close, self.d_rsi) |
| 88 | |
| 89 | # To construct weekly RSI, we can use `resample_apply()` |
| 90 | # helper function from the library |
| 91 | self.weekly_rsi = resample_apply( |
| 92 | 'W-FRI', RSI, self.data.Close, self.w_rsi) |
| 93 | |
| 94 | |
| 95 | def next(self): |
nothing calls this directly
no test coverage detected