Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -133,8 +133,19 @@ def btc_decision(market_insights: Dict[str, Any]) -> Dict[str, str]:
|
|
| 133 |
"""
|
| 134 |
Aggregates market insights to suggest a Buy, Sell, or HODL decision.
|
| 135 |
|
| 136 |
-
:param market_insights: BTC market data
|
| 137 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
"""
|
| 139 |
btc_price = market_insights["price"]
|
| 140 |
fgi = int(market_insights["fear_greed"])
|
|
@@ -156,7 +167,6 @@ def btc_decision(market_insights: Dict[str, Any]) -> Dict[str, str]:
|
|
| 156 |
"1Y": "HODL 🤔"
|
| 157 |
}
|
| 158 |
|
| 159 |
-
# Helper function to update decision based on parameters
|
| 160 |
def make_decision(timeframe: str, ma: float) -> str:
|
| 161 |
if btc_price > ma and fgi < 40:
|
| 162 |
decision[timeframe] = "BUY 🚀"
|
|
|
|
| 133 |
"""
|
| 134 |
Aggregates market insights to suggest a Buy, Sell, or HODL decision.
|
| 135 |
|
| 136 |
+
:param market_insights: A dictionary containing BTC market data. It must include:
|
| 137 |
+
- 'price': Current BTC price in USD.
|
| 138 |
+
- '24h_change': 24-hour price change percentage.
|
| 139 |
+
- 'ma_5m': 5-minute moving average.
|
| 140 |
+
- 'ma_1h': 1-hour moving average.
|
| 141 |
+
- 'ma_1d': 1-day moving average.
|
| 142 |
+
- 'ma_7d': 7-day moving average.
|
| 143 |
+
- 'ma_1m': 1-month moving average.
|
| 144 |
+
- 'ma_1y': 1-year moving average.
|
| 145 |
+
- 'fear_greed': Current Fear & Greed index value.
|
| 146 |
+
- 'fgi_text': Classification text for the Fear & Greed index.
|
| 147 |
+
:return: A dictionary mapping timeframes (e.g., "5m-1H", "1D", "7D", "1M", "1Y") to a decision
|
| 148 |
+
("BUY 🚀", "SELL 📉", or "HODL 🤔").
|
| 149 |
"""
|
| 150 |
btc_price = market_insights["price"]
|
| 151 |
fgi = int(market_insights["fear_greed"])
|
|
|
|
| 167 |
"1Y": "HODL 🤔"
|
| 168 |
}
|
| 169 |
|
|
|
|
| 170 |
def make_decision(timeframe: str, ma: float) -> str:
|
| 171 |
if btc_price > ma and fgi < 40:
|
| 172 |
decision[timeframe] = "BUY 🚀"
|