You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+66-1Lines changed: 66 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ pip install pyindicators
24
24
25
25
* Native Python implementation, no external dependencies needed except for Polars or Pandas
26
26
* Dataframe first approach, with support for both pandas dataframes and polars dataframes
27
-
* Supports python version 3.9 and above.
27
+
* Supports python version 3.10 and above.
28
28
*[Trend indicators](#trend-indicators)
29
29
*[Weighted Moving Average (WMA)](#weighted-moving-average-wma)
30
30
*[Simple Moving Average (SMA)](#simple-moving-average-sma)
@@ -40,6 +40,8 @@ pip install pyindicators
40
40
*[Is Crossover](#is-crossover)
41
41
*[Crossunder](#crossunder)
42
42
*[Is Crossunder](#is-crossunder)
43
+
*[Is Downtrend](#is-downtrend)
44
+
*[Is Uptrend](#is-uptrend)
43
45
44
46
## Indicators
45
47
@@ -615,3 +617,66 @@ if is_crossunder(
615
617
if is_crossunder(pd_df, crossover_column="Crossunder_EMA", number_of_data_points=3):
616
618
print("Crossunder detected in Pandas DataFrame in the last 3 data points")
617
619
```
620
+
621
+
#### Is Downtrend
622
+
623
+
The is_downtrend function is used to determine if a downtrend occurred in the last N data points. It returns a boolean value indicating if a downtrend occurred in the last N data points. The function can be used to check for downtrends in a DataFrame that was previously calculated using the crossover function.
624
+
625
+
```python
626
+
627
+
defis_down_trend(
628
+
data: Union[PdDataFrame, PlDataFrame],
629
+
use_death_cross: bool=True,
630
+
) -> bool:
631
+
```
632
+
633
+
Example
634
+
635
+
```python
636
+
from polars import DataFrame as plDataFrame
637
+
from pandas import DataFrame as pdDataFrame
638
+
639
+
from investing_algorithm_framework import CSVOHLCVMarketDataSource
640
+
from pyindicators import is_down_trend
641
+
642
+
# For this example the investing algorithm framework is used for dataframe creation,
The is_up_trend function is used to determine if an uptrend occurred in the last N data points. It returns a boolean value indicating if an uptrend occurred in the last N data points. The function can be used to check for uptrends in a DataFrame that was previously calculated using the crossover function.
656
+
657
+
```python
658
+
defis_up_trend(
659
+
data: Union[PdDataFrame, PlDataFrame],
660
+
use_golden_cross: bool=True,
661
+
) -> bool:
662
+
```
663
+
664
+
Example
665
+
666
+
```python
667
+
from polars import DataFrame as plDataFrame
668
+
from pandas import DataFrame as pdDataFrame
669
+
670
+
from investing_algorithm_framework import CSVOHLCVMarketDataSource
671
+
from pyindicators import is_up_trend
672
+
673
+
# For this example the investing algorithm framework is used for dataframe creation,
0 commit comments