Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -461,21 +461,24 @@ if df is not None and uid_input:
|
|
461 |
|
462 |
|
463 |
def main():
|
464 |
-
|
465 |
-
|
466 |
-
for index, row in df_starting.iterrows():
|
467 |
-
side = True if row['amount'] > 0 else False
|
468 |
-
a = isClosed(row['i'])
|
469 |
-
print(a)
|
470 |
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
479 |
|
480 |
if __name__ == "__main__":
|
481 |
main()
|
|
|
461 |
|
462 |
|
463 |
def main():
|
464 |
+
def main():
|
465 |
+
df_starting = pd.DataFrame(starting_position)
|
|
|
|
|
|
|
|
|
466 |
|
467 |
+
for index, row in df_starting.iterrows():
|
468 |
+
side = "Long" if row['amount'] > 0 else "Short"
|
469 |
+
closed_status = isClosed(row['i'])
|
470 |
+
last_updated_time = lastUpdated(row['i'])
|
471 |
+
|
472 |
+
# Display a button for each trade position with a unique key
|
473 |
+
if st.button(
|
474 |
+
f"{row['symbol']} : {side}, Entry Price: {row['entryPrice']}, "
|
475 |
+
f"Market Price: {row['markPrice']}, Amount: {row['amount']}, "
|
476 |
+
f"Leverage: {row['leverage']}, TradeTakenAt: {row['updateTime']}, "
|
477 |
+
f"lastUpdated: {last_updated_time}, isClosed: {closed_status}",
|
478 |
+
key=f"button_{index}" # Unique key for each button
|
479 |
+
):
|
480 |
+
show_position_history(row['i'])
|
481 |
+
|
482 |
|
483 |
if __name__ == "__main__":
|
484 |
main()
|