minor fix
This commit is contained in:
@ -13,7 +13,7 @@ Example usage:
|
|||||||
```python
|
```python
|
||||||
from ttools import AnchoredIndicator
|
from ttools import AnchoredIndicator
|
||||||
|
|
||||||
mom_standard = vbt.indicator("talib:MOM").run(t1data.data["BAC"].close)
|
mom = vbt.indicator("talib:MOM").run(t1data.data["BAC"].close, timeperiod=10, skipna=True) #standard indicator
|
||||||
mom_anchored_d = AnchoredIndicator("talib:MOM", anchor='D').run(t1data.data["BAC"].close)
|
mom_anch_d = AnchoredIndicator("talib:MOM", anchor='D').run(t1data.data["BAC"].close, timeperiod=10, skipna=True) #anchored to D
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
2
setup.py
2
setup.py
@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='ttools',
|
name='ttools',
|
||||||
version='0.1.2',
|
version='0.1.3',
|
||||||
packages=['ttools'],
|
packages=['ttools'],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'vectorbtpro',
|
'vectorbtpro',
|
||||||
|
|||||||
@ -11,8 +11,8 @@ class AnchoredIndicator:
|
|||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
- indicator_name: str, the name of the vectorbt indicator.
|
- indicator_name: str, the name of the vectorbt indicator.
|
||||||
- anchor: str, 'D' for day, 'H' for hour, 'T' for minute (default is 'D').
|
- anchor: str, 'D' for day, 'h' for hour, 'min' for minute (default is 'D').
|
||||||
Any valid frequency string ('D', 'H', 'T', 'W', etc.). can be used as it uses pd.Grouper(freq=anchor)
|
Any valid frequency string ('D', 'h', 'min', 'W', etc.). can be used as it uses pd.Grouper(freq=anchor)
|
||||||
see https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases
|
see https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases
|
||||||
"""
|
"""
|
||||||
self.indicator_name = indicator_name
|
self.indicator_name = indicator_name
|
||||||
@ -26,8 +26,8 @@ class AnchoredIndicator:
|
|||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
- data: pd.Series or pd.DataFrame, the input data series or dataframe (e.g., close prices).
|
- data: pd.Series or pd.DataFrame, the input data series or dataframe (e.g., close prices).
|
||||||
- anchor: str, 'D' for day, 'H' for hour, 'T' for minute (default is 'D'). Override for anchor on the instance.
|
- anchor: str, 'D' for day, 'h' for hour, 'min' for minute (default is 'D'). Override for anchor on the instance.
|
||||||
Any valid frequency string ('D', 'H', 'T', 'W', etc.). can be used as it uses pd.Grouper(freq=anchor)
|
Any valid frequency string ('D', 'h', 'min', 'W', etc.). can be used as it uses pd.Grouper(freq=anchor)
|
||||||
see https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases
|
see https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases
|
||||||
- *args, **kwargs: Arguments and keyword arguments passed to the indicator.
|
- *args, **kwargs: Arguments and keyword arguments passed to the indicator.
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user