Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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]['
|
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('
|
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['
|
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['
|
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['
|
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
|