Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -175,18 +175,17 @@ def calculate_take_profit(target_price, fibonacci_levels, buy_signal):
|
|
175 |
print("Closest Levels:")
|
176 |
print(closest_levels)
|
177 |
take_profit_fibonacci_level = max(closest_levels.keys())
|
|
|
178 |
else:
|
179 |
closest_levels = {k: v for k, v in fibonacci_levels.items() if v < target_price}
|
180 |
print("Closest Levels:")
|
181 |
print(closest_levels)
|
182 |
if closest_levels:
|
183 |
take_profit_fibonacci_level = min(closest_levels.keys())
|
|
|
184 |
else:
|
185 |
take_profit_fibonacci_level = 0
|
186 |
-
|
187 |
-
|
188 |
-
take_profit = closest_levels[take_profit_fibonacci_level]
|
189 |
-
|
190 |
return take_profit, closest_levels
|
191 |
|
192 |
def get_swing_high_low(symbol, interval, start_date):
|
@@ -336,4 +335,3 @@ def plot_trade(entry, stop_loss, take_profit, fibonacci_json):
|
|
336 |
# title = f"Closest Levels for Buy (targeting {target_profit_price})"
|
337 |
# else:
|
338 |
# title = f"Closest Levels for Sell (targeting {target_profit_price})"
|
339 |
-
|
|
|
175 |
print("Closest Levels:")
|
176 |
print(closest_levels)
|
177 |
take_profit_fibonacci_level = max(closest_levels.keys())
|
178 |
+
take_profit = closest_levels[take_profit_fibonacci_level]
|
179 |
else:
|
180 |
closest_levels = {k: v for k, v in fibonacci_levels.items() if v < target_price}
|
181 |
print("Closest Levels:")
|
182 |
print(closest_levels)
|
183 |
if closest_levels:
|
184 |
take_profit_fibonacci_level = min(closest_levels.keys())
|
185 |
+
take_profit = closest_levels[take_profit_fibonacci_level]
|
186 |
else:
|
187 |
take_profit_fibonacci_level = 0
|
188 |
+
take_profit = 0 # Assuming default level and price
|
|
|
|
|
|
|
189 |
return take_profit, closest_levels
|
190 |
|
191 |
def get_swing_high_low(symbol, interval, start_date):
|
|
|
335 |
# title = f"Closest Levels for Buy (targeting {target_profit_price})"
|
336 |
# else:
|
337 |
# title = f"Closest Levels for Sell (targeting {target_profit_price})"
|
|