GOKULSINGHSHAH123 commited on
Commit
17ddad3
·
verified ·
1 Parent(s): bc6c719

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -186,7 +186,7 @@ if df is not None and uid_input:
186
  if 'symbol' in trade_list[i]:
187
  symbol = trade_list[i]['symbol']
188
  side ="buy" if trade_list[i]['amount']>0 else "sell"
189
- amount = trade_list[i]['amount']
190
  symbol = trade_list[i]['symbol']
191
  trade_list[i]['side'] =side
192
  trade_list[i]['changeInAmount'] = changeInAmount
@@ -205,7 +205,7 @@ if df is not None and uid_input:
205
  new_position = entry.get('NewPosition', {})
206
  # Extract symbol and amount
207
  symbol = new_position.get('symbol')
208
- amount = new_position.get('amount')
209
  if start==False:
210
  start_time = new_position.get('updateTime')
211
  year = start_time[0]
@@ -418,7 +418,7 @@ if df is not None and uid_input:
418
  df_transformed = pd.DataFrame({
419
  'Pair/Asset': df_history['symbol'],
420
  'is long': df_history['side'],
421
- 'Current size after change': df_history['amount'],
422
  'Change in size in Asset': df_history['changeInAmount'],
423
  'Change in size in USDT': df_history['changeInAmount'] * -(df_history['markPrice']),
424
  'Entry price': df_history['entryPrice'],
@@ -464,7 +464,7 @@ if df is not None and uid_input:
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
  is_closed = isClosed(row['i'])
469
 
470
  # Generate a unique key for the button
@@ -473,7 +473,7 @@ if df is not None and uid_input:
473
  # Display a button for each trade position
474
  if st.button(
475
  f"{row['symbol']} : Long: {side}, Entry Price: {row['entryPrice']}, "
476
- f"Market Price: {row['markPrice']}, Amount: {row['amount']}, "
477
  f"Leverage: {row['leverage']}, TradeTakenAt: {row['updateTime']}, "
478
  f"lastUpdated: {lastUpdated(row['i'])}, isClosed: {is_closed}",
479
  key=button_key
 
186
  if 'symbol' in trade_list[i]:
187
  symbol = trade_list[i]['symbol']
188
  side ="buy" if trade_list[i]['amount']>0 else "sell"
189
+ amount = trade_list[i]['usdAmount']
190
  symbol = trade_list[i]['symbol']
191
  trade_list[i]['side'] =side
192
  trade_list[i]['changeInAmount'] = changeInAmount
 
205
  new_position = entry.get('NewPosition', {})
206
  # Extract symbol and amount
207
  symbol = new_position.get('symbol')
208
+ amount = new_position.get('usdAmount')
209
  if start==False:
210
  start_time = new_position.get('updateTime')
211
  year = start_time[0]
 
418
  df_transformed = pd.DataFrame({
419
  'Pair/Asset': df_history['symbol'],
420
  'is long': df_history['side'],
421
+ 'Current size after change': df_history['usdAmount'],
422
  'Change in size in Asset': df_history['changeInAmount'],
423
  'Change in size in USDT': df_history['changeInAmount'] * -(df_history['markPrice']),
424
  'Entry price': df_history['entryPrice'],
 
464
  df_starting = pd.DataFrame(starting_position)
465
 
466
  for index, row in df_starting.iterrows():
467
+ side = True if row['usdAmount'] > 0 else False
468
  is_closed = isClosed(row['i'])
469
 
470
  # Generate a unique key for the button
 
473
  # Display a button for each trade position
474
  if st.button(
475
  f"{row['symbol']} : Long: {side}, Entry Price: {row['entryPrice']}, "
476
+ f"Market Price: {row['markPrice']}, Amount: {row['usdAmount']}, "
477
  f"Leverage: {row['leverage']}, TradeTakenAt: {row['updateTime']}, "
478
  f"lastUpdated: {lastUpdated(row['i'])}, isClosed: {is_closed}",
479
  key=button_key