| 108 | return rsi |
| 109 | |
| 110 | def plot(self, widget): |
| 111 | textsize = 9 |
| 112 | widget.plot(self.value, color=self.fillcolor, lw=2) |
| 113 | widget.axhline(70, color=self.fillcolor, linestyle='-') |
| 114 | widget.axhline(30, color=self.fillcolor, linestyle='-') |
| 115 | widget.fill_between(self.value, 70, where=(self.value>=70), |
| 116 | facecolor=self.fillcolor, edgecolor=self.fillcolor) |
| 117 | widget.fill_between(self.value, 30, where=(self.value<=30), |
| 118 | facecolor=self.fillcolor, edgecolor=self.fillcolor) |
| 119 | widget.text(0.6, 0.9, '>70 = overbought', va='top', transform=widget.transAxes, fontsize=textsize, color = 'k') |
| 120 | widget.text(0.6, 0.1, '<30 = oversold', transform=widget.transAxes, fontsize=textsize, color = 'k') |
| 121 | widget.set_ylim(0, 100) |
| 122 | widget.set_yticks([30,70]) |
| 123 | widget.text(0.025, 0.95, 'rsi (14)', va='top', transform=widget.transAxes, fontsize=textsize) |
| 124 | |
| 125 | |
| 126 | class MACD(IndicatorBase): |