py-alpha-lib 0.1.1__cp314-abi3-win_amd64.whl → 0.1.2__cp314-abi3-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
alpha/algo/_algo.pyd CHANGED
Binary file
alpha/algo/algo_gen.py CHANGED
@@ -586,6 +586,23 @@ def SUMIF(
586
586
  _algo.sumif(r, input, condition, periods)
587
587
  return r
588
588
 
589
+ def TS_CORR(
590
+ input: np.ndarray | list[np.ndarray], periods: int
591
+ ) -> np.ndarray | list[np.ndarray]:
592
+ """
593
+ Time Series Correlation
594
+
595
+ Calculates the correlation coefficient between the input series and the time index.
596
+ """
597
+ if isinstance(input, list):
598
+ r = [np.empty_like(x) for x in input]
599
+ _algo.ts_corr(r, input, periods)
600
+ return r
601
+ else:
602
+ r = np.empty_like(input)
603
+ _algo.ts_corr(r, input, periods)
604
+ return r
605
+
589
606
  def TS_RANK(
590
607
  input: np.ndarray | list[np.ndarray], periods: int
591
608
  ) -> np.ndarray | list[np.ndarray]:
alpha/algo.md CHANGED
@@ -34,5 +34,6 @@ the `np.ndarray` is `ndarray` type in `numpy` package
34
34
  - SUM(input: np.ndarray[float], periods: int): Calculate sum of values in preceding `periods` window If periods is 0, it calculates the cumulative sum from the first valid value.
35
35
  - SUMBARS(input: np.ndarray[float], amount: float): Calculate number of periods (bars) backwards until the sum of values is greater than or equal to `amount`
36
36
  - SUMIF(input: np.ndarray[float], condition: np.ndarray[bool], periods: int): Calculate sum of values in preceding `periods` window where `condition` is true
37
+ - TS_CORR(input: np.ndarray[float], periods: int): Time Series Correlation Calculates the correlation coefficient between the input series and the time index.
37
38
  - TS_RANK(input: np.ndarray[float], periods: int): Calculate rank in a sliding window with size `periods`
38
39
  - VAR(input: np.ndarray[float], periods: int): Calculate Variance over a moving window Variance = (SumSq - (Sum^2)/N) / (N - 1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: py-alpha-lib
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -1,15 +1,15 @@
1
1
  alpha\__init__.py,sha256=it34OBlXnf1KxXsG3S7gOTo7VUf_29NjYrf5HkyTiBQ,253
2
2
  alpha\algo\__init__.py,sha256=AwglMcMEn0P_Stdlr9oUYwFNVDtJ7JRh48LCHnZNRA8,158
3
- alpha\algo\_algo.pyd,sha256=Mk7q09s63T1J_aL7dTw28n34WXuz0qZUD-m3Y95scQc,2494464
3
+ alpha\algo\_algo.pyd,sha256=YO_gU7DmqUE_jQnw7W6byJJLth2HN2kcq8nZsBiRGvE,2564608
4
4
  alpha\algo\algo.py,sha256=48jGJGSypFgGnih-XgIxW2QUnzGsTWq00TGNuDxKHE4,684
5
- alpha\algo\algo_gen.py,sha256=KlMKCnTZH9jotIW3wmsx2dXWRCejMWeJ6nd-vlzyhG8,17287
6
- alpha\algo.md,sha256=jh8-TXh5moTmnexFQWKfrtS4xy5oe3n40CXfdGyCX38,5115
5
+ alpha\algo\algo_gen.py,sha256=56nZ89h_P_F8JLAcp5v0CSwuR1lAXzVfhOSk1ZzmSVA,17726
6
+ alpha\algo.md,sha256=NNxc7A87r70gpvArcB2tUDxM7qot0oY9RoD_893HMno,5275
7
7
  alpha\lang\__init__.py,sha256=2dLimPixRh5vF3PvgF-aJ8DBZ0SuDaHrrkQecmBTC_4,132
8
8
  alpha\lang\__main__.py,sha256=wa5DHGSmhL8dswN3v160RXs1qG6_dIr0W1qe_u4b3C8,572
9
9
  alpha\lang\alpha.lark,sha256=qqMXJ--F3ErYikNdRs1vwHGKoJe_aRUeNmpo87NaTXs,1046
10
10
  alpha\lang\parser.py,sha256=WBpwEUYzGJ1nM7iUh_mEimGLhHzVZXS8BAzF58ZRagU,156846
11
11
  alpha\lang\to_python.py,sha256=4i8km91EejlzrIt5QxHrZWtq-A3zlDwRJwlAUew54-8,6563
12
- py_alpha_lib-0.1.1.dist-info\METADATA,sha256=5Mgzjgy9wEQQVexGOZrmjpAXaUouWlZAW5W152XoFCY,16272
13
- py_alpha_lib-0.1.1.dist-info\WHEEL,sha256=dsg5IA1tFdLNsJihRQJCX59s7GKfDG9N_2EOwwysnks,96
14
- py_alpha_lib-0.1.1.dist-info\licenses\LICENSE,sha256=3D2Y67XRAnMSiByf02r4DaFv92CdDLw5U6xHyUVkdI4,1289
15
- py_alpha_lib-0.1.1.dist-info\RECORD,,
12
+ py_alpha_lib-0.1.2.dist-info\METADATA,sha256=9VEien3NMEJKb6nDOz2Jb7Dbi9U5INER2E8qCjUwDTI,16272
13
+ py_alpha_lib-0.1.2.dist-info\WHEEL,sha256=dsg5IA1tFdLNsJihRQJCX59s7GKfDG9N_2EOwwysnks,96
14
+ py_alpha_lib-0.1.2.dist-info\licenses\LICENSE,sha256=3D2Y67XRAnMSiByf02r4DaFv92CdDLw5U6xHyUVkdI4,1289
15
+ py_alpha_lib-0.1.2.dist-info\RECORD,,