Skip to content

Commit 3332df0

Browse files
authored
V1.0.3 (#36)
* update version * added gain_ratio to predictor losers_to_gainers * update dependencies * pytest.ini * pytest.ini
1 parent 1c9a6f1 commit 3332df0

File tree

4 files changed

+33
-19
lines changed

4 files changed

+33
-19
lines changed

poetry.lock

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

py_alpaca_api/src/predictor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def generate_forecast(model, future_periods=14):
9292

9393
return round(two_week_forecast, 2)
9494

95-
def get_losers_to_gainers(self, losers_to_scan: int = 200) -> list:
95+
def get_losers_to_gainers(self, gain_ratio: float = 0.1, losers_to_scan: int = 200) -> list:
9696
"""
9797
Retrieves a list of future gainers by predicting stock prices using Prophet.
9898
@@ -116,7 +116,7 @@ def get_losers_to_gainers(self, losers_to_scan: int = 200) -> list:
116116
symbol_model = self.train_prophet_model(symbol_data)
117117
symbol_forecast = self.generate_forecast(symbol_model)
118118
previous_price = previous_day_losers[previous_day_losers["symbol"] == ticker].iloc[0]["price"]
119-
if symbol_forecast > previous_price:
119+
if symbol_forecast > previous_price * (1 + gain_ratio):
120120
future_gainers.append(ticker)
121121
except Exception as e:
122122
logger.error(f"Error predicting {ticker}: {e}")

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[tool.poetry]
22
name = "py-alpaca-api"
3-
version = "1.0.2"
3+
version = "1.0.3"
44
description = "Python package, for communicating with Alpaca Markets REST API."
55
authors = ["TexasCoding <[email protected]>"]
66
license = "MIT"
77
readme = "README.md"
8-
homepage = "https://github.com/TexasCoding/py-alpaca-api"
8+
homepage = "https://pypi.org/project/py-alpaca-api/"
99
repository = "https://github.com/TexasCoding/py-alpaca-api"
1010
documentation = "https://py-alpaca-api.readthedocs.io/en/latest/"
1111
keywords = ["alpaca", "python"]

pytest.ini

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[pytest]
2+
filterwarnings =
3+
ignore::DeprecationWarning
4+
ignore::PendingDeprecationWarning
5+
ignore::UserWarning
6+
ignore::RuntimeWarning
7+
ignore::ResourceWarning
8+
ignore::ImportWarning
9+
ignore::FutureWarning
10+
ignore::SyntaxWarning
11+
ignore::Warning
12+
ignore::pytest.PytestUnknownMarkWarning
13+
ignore::pytest.PytestUnhandledCoroutineWarning
14+
ignore::pytest.PytestCollectionWarning

0 commit comments

Comments
 (0)