Skip to content

Commit

Permalink
Integration tests for etf/ta (#4450)
Browse files Browse the repository at this point in the history
* some adjustments and added int tests for etf/ta

* ruff
  • Loading branch information
hjoaquim authored Mar 10, 2023
1 parent fea616e commit 740152b
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
1 change: 0 additions & 1 deletion openbb_terminal/etf/etf_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ def call_load(self, other_args: List[str]):

console.print(
f"Loading Daily data for {self.etf_name} with starting period {ns_parser.start.strftime('%Y-%m-%d')}.",
"\n",
)

@log_start_end(log=logger)
Expand Down
3 changes: 2 additions & 1 deletion openbb_terminal/etf/technical_analysis/ta_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
EXPORT_ONLY_FIGURES_ALLOWED,
check_non_negative,
check_positive,
check_positive_float,
check_positive_list,
valid_date,
)
Expand Down Expand Up @@ -980,7 +981,7 @@ def call_bbands(self, other_args: List[str]):
"--std",
action="store",
dest="n_std",
type=check_positive,
type=check_positive_float,
default=2,
help="std",
choices=np.arange(0.0, 10, 0.25).tolist(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,51 @@ etf
load spy
ta
ema
ema --length 10 --offset 3
sma
sma --length 2 --offset 1
wma
wma --length 99 --offset 4
hma
hma --length 1 --offset 95
zlma
zlma --length 1 --offset 1
vwap
# vwap --offset 2 --start 2022-01-01 --end 2023-01-01
cci
cci --length 2 --scalar 10
macd
macd --fast 13 --slow 99 --signal 15
rsi
rsi --length 2 --scalar 10 --drift 7
stoch
stoch --fastkperiod 2 --slowdperiod 1
fisher
fisher --length 2
cg
cg --length 95
clenow
clenow --period 120
demark
demark --min 5
adx
adx --length 4 --scalar 10 --drift 2
aroon
aroon --length 2 --scalar 11
bbands
bbands --length 2 --std 0.25 --mamode zlma
donchian
donchian
donchian --length_upper 2 --length_lower 1
kc
kc --length 2 --scalar 1 --mamode ema --offset 4
atr
atr --length 10 --mamode sma --offset 33
ad
ad --open
adosc
adosc --open --fast 2 --slow 1
obv
fib
fib --period 30 --start 2021-01-01 --end 2023-01-01
exit

0 comments on commit 740152b

Please sign in to comment.