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
print("Crossunders detected in Pandas DataFrame in the last 3 data points")
765
766
766
767
# If you want to use the result of a previous crossover calculation
767
-
if is_crossunder(pd_df, crossover_column="Crossunder_EMA", number_of_data_points=3):
768
+
if is_crossunder(pd_df, crossunder_column="Crossunder_EMA", number_of_data_points=3):
768
769
print("Crossunder detected in Pandas DataFrame in the last 3 data points")
769
770
```
770
771
@@ -851,3 +852,40 @@ pd_df = download(
851
852
print(is_up_trend(pl_df))
852
853
print(is_up_trend(pd_df))
853
854
```
855
+
856
+
#### has_any_lower_then_threshold
857
+
858
+
The `has_any_lower_then_threshold` function checks if any value in a given column is lower than a specified threshold within the last N data points. This is useful for detecting when an indicator or price falls below a critical level.
859
+
860
+
```python
861
+
defhas_any_lower_then_threshold(
862
+
data: Union[pd.DataFrame, pl.DataFrame],
863
+
column,
864
+
threshold,
865
+
strict=True,
866
+
number_of_data_points=1
867
+
) -> bool:
868
+
...
869
+
```
870
+
871
+
Example
872
+
873
+
```python
874
+
import pandas as pd
875
+
from pyindicators.indicators.utils import has_any_lower_then_threshold
In this chart, the red line represents the threshold, and the highlighted points are where the `Close` value is below the threshold in the last N data points.
0 commit comments