Update ml_engine/indicators.py
Browse files- ml_engine/indicators.py +5 -6
ml_engine/indicators.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# ml_engine/indicators.py (V10.
|
| 2 |
import pandas as pd
|
| 3 |
import pandas_ta as ta
|
| 4 |
import numpy as np
|
|
@@ -8,7 +8,8 @@ try:
|
|
| 8 |
from hurst import compute_Hc
|
| 9 |
HURST_AVAILABLE = True
|
| 10 |
except ImportError:
|
| 11 |
-
|
|
|
|
| 12 |
print(" -> قم بتثبيتها: pip install hurst")
|
| 13 |
HURST_AVAILABLE = False
|
| 14 |
|
|
@@ -24,7 +25,7 @@ class AdvancedTechnicalAnalyzer:
|
|
| 24 |
'cycle': ['hull_ma', 'supertrend', 'zigzag', 'fisher_transform']
|
| 25 |
}
|
| 26 |
|
| 27 |
-
# 🔴 ---
|
| 28 |
def calculate_v9_smart_features(self, dataframe: pd.DataFrame) -> Dict[str, float]:
|
| 29 |
"""
|
| 30 |
(محدث V10.0) - (العقل الحسابي لنموذج V9.8)
|
|
@@ -117,8 +118,6 @@ class AdvancedTechnicalAnalyzer:
|
|
| 117 |
if value is not None and np.isfinite(value): final_features[key] = float(value)
|
| 118 |
else: final_features[key] = 0.0
|
| 119 |
return final_features
|
| 120 |
-
# 🔴 --- END OF UPDATED FUNCTION (V10.0) --- 🔴
|
| 121 |
-
|
| 122 |
|
| 123 |
# -----------------------------------------------------------------
|
| 124 |
# --- (الدوال القديمة تبقى كما هي للاستخدامات الأخرى مثل Sentry 1m) ---
|
|
@@ -385,4 +384,4 @@ class AdvancedTechnicalAnalyzer:
|
|
| 385 |
|
| 386 |
return {key: value for key, value in cycle.items() if value is not None and not np.isnan(value)}
|
| 387 |
|
| 388 |
-
print("✅ ML Module: Technical Indicators loaded (V10.
|
|
|
|
| 1 |
+
# ml_engine/indicators.py (V10.1 - SyntaxError FIX)
|
| 2 |
import pandas as pd
|
| 3 |
import pandas_ta as ta
|
| 4 |
import numpy as np
|
|
|
|
| 8 |
from hurst import compute_Hc
|
| 9 |
HURST_AVAILABLE = True
|
| 10 |
except ImportError:
|
| 11 |
+
# 🔴 --- (V10.1 - تم إصلاح الخطأ النحوي هنا) --- 🔴
|
| 12 |
+
print("⚠️ مكتبة 'hurst' غير موجودة. ميزة 'مفتاح النظام' ستكون معطلة.")
|
| 13 |
print(" -> قم بتثبيتها: pip install hurst")
|
| 14 |
HURST_AVAILABLE = False
|
| 15 |
|
|
|
|
| 25 |
'cycle': ['hull_ma', 'supertrend', 'zigzag', 'fisher_transform']
|
| 26 |
}
|
| 27 |
|
| 28 |
+
# 🔴 --- (V10.0 - العقل الفائق) --- 🔴
|
| 29 |
def calculate_v9_smart_features(self, dataframe: pd.DataFrame) -> Dict[str, float]:
|
| 30 |
"""
|
| 31 |
(محدث V10.0) - (العقل الحسابي لنموذج V9.8)
|
|
|
|
| 118 |
if value is not None and np.isfinite(value): final_features[key] = float(value)
|
| 119 |
else: final_features[key] = 0.0
|
| 120 |
return final_features
|
|
|
|
|
|
|
| 121 |
|
| 122 |
# -----------------------------------------------------------------
|
| 123 |
# --- (الدوال القديمة تبقى كما هي للاستخدامات الأخرى مثل Sentry 1m) ---
|
|
|
|
| 384 |
|
| 385 |
return {key: value for key, value in cycle.items() if value is not None and not np.isnan(value)}
|
| 386 |
|
| 387 |
+
print("✅ ML Module: Technical Indicators loaded (V10.1 - SyntaxError FIX)")
|