-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
normalized bollinger bands width implemented
- Loading branch information
Showing
3 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import requests | ||
from legitindicators import bollinger_bands_width_normalized | ||
|
||
BINANCE_URL = "https://api.binance.com/api/v3/klines" | ||
SYMBOL = "BTCUSDT" | ||
INTERVAL = "1d" | ||
PARAMS = {"symbol": SYMBOL, "interval": INTERVAL} | ||
|
||
|
||
def test_bollinger_bands_width_normalized(): | ||
response = requests.get(url=BINANCE_URL, params=PARAMS) | ||
data = response.json() | ||
close = [float(d[4]) for d in data] | ||
bbwn = bollinger_bands_width_normalized(close, 20, 2) | ||
print(bbwn) | ||
assert len(bbwn) == len(close) |