Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
edtechre committed Jun 23, 2024
2 parents 5cb6354 + 169ed68 commit ac9db13
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 72 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
nitpick_ignore = [("py:class", "type")]

project = "PyBroker"
copyright = "2023, Edward West"
copyright = "2024, Edward West"
author = "Edward West"
release = "1.0"

Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ pytest-cov>=4.0.0
pytest-instafail>=0.4.2
pytest-randomly>=3.12.0
pytest-xdist>=3.0.2
ruff>=0.3.4
scikit-learn>=1.2.1
Sphinx>=5.3.0
sphinx_rtd_theme>=2.0.0
sphinx-intl>=2.1.0
yahooquery>=2.3.7
yfinance>=0.1.84
ruff>=0.3.4
12 changes: 6 additions & 6 deletions src/pybroker/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ class BarData:
def __init__(
self,
date: NDArray[np.datetime64],
open: NDArray[np.float_],
high: NDArray[np.float_],
low: NDArray[np.float_],
close: NDArray[np.float_],
volume: Optional[NDArray[np.float_]],
vwap: Optional[NDArray[np.float_]],
open: NDArray[np.float64],
high: NDArray[np.float64],
low: NDArray[np.float64],
close: NDArray[np.float64],
volume: Optional[NDArray[np.float64]],
vwap: Optional[NDArray[np.float64]],
**kwargs,
):
self.date = date
Expand Down
16 changes: 8 additions & 8 deletions src/pybroker/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def model(self, name: str, symbol: str) -> Any:
raise ValueError(f"Model {name!r} not found for {symbol}.")
return self._models[model_sym].instance

def indicator(self, name: str, symbol: str) -> NDArray[np.float_]:
def indicator(self, name: str, symbol: str) -> NDArray[np.float64]:
r"""Returns indicator data.
Args:
Expand Down Expand Up @@ -704,7 +704,7 @@ def date(self) -> NDArray[np.datetime64]:
)

@property
def open(self) -> NDArray[np.float_]:
def open(self) -> NDArray[np.float64]:
"""Current bar's open price."""
self._verify_symbol()
return self._col_scope.fetch( # type: ignore[return-value]
Expand All @@ -714,7 +714,7 @@ def open(self) -> NDArray[np.float_]:
)

@property
def high(self) -> NDArray[np.float_]:
def high(self) -> NDArray[np.float64]:
"""Current bar's high price."""
self._verify_symbol()
return self._col_scope.fetch( # type: ignore[return-value]
Expand All @@ -724,7 +724,7 @@ def high(self) -> NDArray[np.float_]:
)

@property
def low(self) -> NDArray[np.float_]:
def low(self) -> NDArray[np.float64]:
"""Current bar's low price."""
self._verify_symbol()
return self._col_scope.fetch( # type: ignore[return-value]
Expand All @@ -734,7 +734,7 @@ def low(self) -> NDArray[np.float_]:
)

@property
def close(self) -> NDArray[np.float_]:
def close(self) -> NDArray[np.float64]:
"""Current bar's close price."""
self._verify_symbol()
return self._col_scope.fetch( # type: ignore[return-value]
Expand All @@ -744,7 +744,7 @@ def close(self) -> NDArray[np.float_]:
)

@property
def volume(self) -> Optional[NDArray[np.float_]]:
def volume(self) -> Optional[NDArray[np.float64]]:
"""Current bar's volume."""
self._verify_symbol()
return self._col_scope.fetch( # type: ignore[return-value]
Expand All @@ -754,7 +754,7 @@ def volume(self) -> Optional[NDArray[np.float_]]:
)

@property
def vwap(self) -> Optional[NDArray[np.float_]]:
def vwap(self) -> Optional[NDArray[np.float64]]:
"""Current bar's volume-weighted average price (VWAP)."""
self._verify_symbol()
return self._col_scope.fetch( # type: ignore[return-value]
Expand Down Expand Up @@ -887,7 +887,7 @@ def model(self, name: str, symbol: Optional[str] = None) -> Any:

def indicator(
self, name: str, symbol: Optional[str] = None
) -> NDArray[np.float_]:
) -> NDArray[np.float64]:
r"""Returns indicator data.
Args:
Expand Down
Loading

0 comments on commit ac9db13

Please sign in to comment.