Skip to content

Commit 23352c8

Browse files
Added params to technical indicators (#550)
* Added params to technical indicators * Fix lint
1 parent a69c26c commit 23352c8

16 files changed

+120
-16
lines changed

examples/rest/crypto-technical_indicators_ema.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,11 @@
77
# client = RESTClient("XXXXXX") # hardcoded api_key is used
88
client = RESTClient() # POLYGON_API_KEY environment variable is used
99

10-
ema = client.get_ema("X:BTCUSD")
10+
ema = client.get_ema(
11+
ticker="X:BTCUSD",
12+
timespan="day",
13+
window=50,
14+
series_type="close",
15+
)
16+
1117
print(ema)

examples/rest/crypto-technical_indicators_macd.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,13 @@
77
# client = RESTClient("XXXXXX") # hardcoded api_key is used
88
client = RESTClient() # POLYGON_API_KEY environment variable is used
99

10-
macd = client.get_macd("X:BTCUSD")
10+
macd = client.get_macd(
11+
ticker="X:BTCUSD",
12+
timespan="day",
13+
short_window=12,
14+
long_window=26,
15+
signal_window=9,
16+
series_type="close",
17+
)
18+
1119
print(macd)

examples/rest/crypto-technical_indicators_rsi.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,11 @@
77
# client = RESTClient("XXXXXX") # hardcoded api_key is used
88
client = RESTClient() # POLYGON_API_KEY environment variable is used
99

10-
rsi = client.get_rsi("X:BTCUSD")
10+
rsi = client.get_rsi(
11+
ticker="X:BTCUSD",
12+
timespan="day",
13+
window=14,
14+
series_type="close",
15+
)
16+
1117
print(rsi)

examples/rest/crypto-technical_indicators_sma.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,11 @@
77
# client = RESTClient("XXXXXX") # hardcoded api_key is used
88
client = RESTClient() # POLYGON_API_KEY environment variable is used
99

10-
sma = client.get_sma("X:BTCUSD")
10+
sma = client.get_sma(
11+
ticker="X:BTCUSD",
12+
timespan="day",
13+
window=50,
14+
series_type="close",
15+
)
16+
1117
print(sma)

examples/rest/forex-technical_indicators_ema.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,11 @@
77
# client = RESTClient("XXXXXX") # hardcoded api_key is used
88
client = RESTClient() # POLYGON_API_KEY environment variable is used
99

10-
ema = client.get_ema("C:EURUSD")
10+
ema = client.get_ema(
11+
ticker="C:EURUSD",
12+
timespan="day",
13+
window=50,
14+
series_type="close",
15+
)
16+
1117
print(ema)

examples/rest/forex-technical_indicators_macd.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,13 @@
77
# client = RESTClient("XXXXXX") # hardcoded api_key is used
88
client = RESTClient() # POLYGON_API_KEY environment variable is used
99

10-
macd = client.get_macd("C:EURUSD")
10+
macd = client.get_macd(
11+
ticker="C:EURUSD",
12+
timespan="day",
13+
short_window=12,
14+
long_window=26,
15+
signal_window=9,
16+
series_type="close",
17+
)
18+
1119
print(macd)

examples/rest/forex-technical_indicators_rsi.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,11 @@
77
# client = RESTClient("XXXXXX") # hardcoded api_key is used
88
client = RESTClient() # POLYGON_API_KEY environment variable is used
99

10-
rsi = client.get_rsi("C:EURUSD")
10+
rsi = client.get_rsi(
11+
ticker="C:EURUSD",
12+
timespan="day",
13+
window=14,
14+
series_type="close",
15+
)
16+
1117
print(rsi)

examples/rest/forex-technical_indicators_sma.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,11 @@
77
# client = RESTClient("XXXXXX") # hardcoded api_key is used
88
client = RESTClient() # POLYGON_API_KEY environment variable is used
99

10-
sma = client.get_sma("C:EURUSD")
10+
sma = client.get_sma(
11+
ticker="C:EURUSD",
12+
timespan="day",
13+
window=50,
14+
series_type="close",
15+
)
16+
1117
print(sma)

examples/rest/indices-technical_indicators_ema.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,11 @@
77
# client = RESTClient("XXXXXX") # hardcoded api_key is used
88
client = RESTClient() # POLYGON_API_KEY environment variable is used
99

10-
ema = client.get_ema("I:SPX")
10+
ema = client.get_ema(
11+
ticker="I:SPX",
12+
timespan="day",
13+
window=50,
14+
series_type="close",
15+
)
16+
1117
print(ema)

examples/rest/indices-technical_indicators_macd.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,13 @@
77
# client = RESTClient("XXXXXX") # hardcoded api_key is used
88
client = RESTClient() # POLYGON_API_KEY environment variable is used
99

10-
macd = client.get_macd("I:SPX")
10+
macd = client.get_macd(
11+
ticker="I:SPX",
12+
timespan="day",
13+
short_window=12,
14+
long_window=26,
15+
signal_window=9,
16+
series_type="close",
17+
)
18+
1119
print(macd)

0 commit comments

Comments
 (0)