-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpandas_ta_utils.py
33 lines (26 loc) · 942 Bytes
/
pandas_ta_utils.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import pandas_ta as ta
import pandas as pd
import vectorbt as vbt
# List of all indicators
def list_ind():
df = pd.DataFrame()
indicators = ta.AnalysisIndicators(df).indicators(as_list=True)
return indicators
# cac = pd.read_csv("data.csv", index_col=0, parse_dates=True)
# # abb = ta.aberration(cac["High"], cac["Low"], cac["Close"])
# # print(abb)
# df = pd.DataFrame()
# TA = vbt.IndicatorFactory.from_pandas_ta("aberration")
# abb = TA.run(cac["High"], cac["Low"], cac["Close"])
# print(abb.output_names)
# abb = ta.atr(cac["High"], cac["Low"], cac["Close"])
# print(abb)
# TA = vbt.IndicatorFactory.from_pandas_ta("atr")
# atr = TA.run(cac["High"], cac["Low"], cac["Close"], short_name="atr")
# print(dir(atr))
# TA = vbt.IndicatorFactory.from_pandas_ta("psl")
# psl = TA.run(cac["Close"], cac["Open"])
# print(dir(psl))
# TA = vbt.IndicatorFactory.from_pandas_ta("rsi")
# rsi = TA.run(cac["Close"])
# print(dir(rsi))