File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -493,6 +493,13 @@ stock['ma:5']
493493stock[' ma:10,open' ]
494494```
495495
496+ Advanced usage
497+
498+ ``` py
499+ # The 5-period moving average for the upper bollinger band
500+ stock[' ma:5,(boll.upper:21,2)' ]
501+ ```
502+
496503### ` ema ` , Exponential Moving Average
497504
498505```
Original file line number Diff line number Diff line change @@ -88,6 +88,10 @@ def test_boll(stock):
8888 assert stock ['column:open > boll.u' ]['2020-01-14' ]
8989 assert stock ['column:close > boll' ]['2020-02-05' ]
9090
91+ boll = stock ['boll.upper' ]
92+ maboll = stock ['ma:2,boll.upper' ]
93+ assert maboll .iloc [- 1 ] == (boll .iloc [- 1 ] + boll .iloc [- 2 ]) / 2
94+
9195
9296def test_donchian (stock ):
9397 assert stock ['donchian.upper:20' ].equals (stock ['hhv:20' ])
You can’t perform that action at this time.
0 commit comments