Skip to content

Commit

Permalink
test_polars: adding a test
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Feb 14, 2024
1 parent e2fe79c commit 2cd97db
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_polars.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,19 @@ def test_TEVA():
assert_array_equal(inputs[column].to_numpy(), df[column].to_numpy())

assert_array_equal(tema1.to_numpy(), tema2.to_numpy())

def test_AVR():
size = 50
df = pl.DataFrame(
{
"open": np.random.uniform(low=0.0, high=100.0, size=size).astype("float32"),
"high": np.random.uniform(low=0.0, high=100.0, size=size).astype("float32"),
"low": np.random.uniform(low=0.0, high=100.0, size=size).astype("float32"),
"close": np.random.uniform(low=0.0, high=100.0, size=size).astype("float32"),
"volume": np.random.uniform(low=0.0, high=100.0, size=size).astype("float32")
}
)
high = df['high']
low = df['low']
close = df['close']
atr = talib.ATR(high, low, close, timeperiod=14)

0 comments on commit 2cd97db

Please sign in to comment.