请问以下为什么参数是 1 / self.am.high、1 / self.am.low、1 / self.am.close,难道不应该是self.am.high、self.am.low、self.am.close吗?没看明白,请哪位高手指点一下吧
atr_risk = talib.ATR(
1 / self.am.high,
1 / self.am.low,
1 / self.am.close,
self.atr_window
)
请问以下为什么参数是 1 / self.am.high、1 / self.am.low、1 / self.am.close,难道不应该是self.am.high、self.am.low、self.am.close吗?没看明白,请哪位高手指点一下吧
atr_risk = talib.ATR(
1 / self.am.high,
1 / self.am.low,
1 / self.am.close,
self.atr_window
)
请具体查阅代码:trader\utility.py\ArrayManager:
def atr(self, n: int, array: bool = False) -> Union[float, np.ndarray]:
"""
Average True Range (ATR).
"""
result = talib.ATR(self.high, self.low, self.close, n)
if array:
return result
return result[-1]
kingmo888 wrote:
请具体查阅代码:trader\utility.py\ArrayManager:
def atr(self, n: int, array: bool = False) -> Union[float, np.ndarray]: """ Average True Range (ATR). """ result = talib.ATR(self.high, self.low, self.close, n) if array: return result return result[-1]好的,谢谢!