GOKULSINGHSHAH123 commited on
Commit
0bd7219
·
verified ·
1 Parent(s): 8bad45e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -14
app.py CHANGED
@@ -461,21 +461,24 @@ if df is not None and uid_input:
461
 
462
 
463
  def main():
464
- df_starting = pd.DataFrame(starting_position)
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
- # Display a button for each trade position
472
- if st.button(
473
- f"{row['symbol']} : Long: {side}, Entry Price: {row['entryPrice']}, "
474
- f"Market Price: {row['markPrice']}, Amount: {row['amount']}, "
475
- f"Leverage: {row['leverage']}, TradeTakenAt: {row['updateTime']}, "
476
- f"lastUpdated: {lastUpdated(row['i'])}, isClosed: {isClosed(row['i'])} "
477
- ):
478
- show_position_history(row['i'])
 
 
 
 
 
 
 
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()