From 8a685483df8403b9713e376b33dab8fd7484a511 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Tue, 20 Aug 2019 15:59:08 +0800 Subject: [PATCH] [Add] aroon indicator for ArrayManager --- vnpy/trader/utility.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vnpy/trader/utility.py b/vnpy/trader/utility.py index ceadb8c6..2c7f4b50 100644 --- a/vnpy/trader/utility.py +++ b/vnpy/trader/utility.py @@ -440,6 +440,16 @@ class ArrayManager(object): return up, down return up[-1], down[-1] + def aroon(self, n, array=False): + """ + Aroon indicator. + """ + aroon_up, aroon_down = talib.AROON(self.high, self.low, n) + + if array: + return aroon_up, aroon_down + return aroon_up[-1], aroon_down[-1] + def virtual(func: "callable"): """