alexaxbreadbytes commited on
Commit
2d872d0
·
1 Parent(s): fdbd965

Update app.py

Browse files

formatted dates for all

Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -703,9 +703,9 @@ def runapp() -> None:
703
  grouped_df.rename(columns={'Buy Price':'Avg. Buy Price',
704
  'P/L per token':'Net P/L'}, inplace=True)
705
  st.subheader("Trade Logs")
 
 
706
  if bot_selections == "Cosmic Cupcake" or bot_selections == "CT Toasted":
707
- grouped_df['Entry Date'] = pd.to_datetime(grouped_df['Entry Date'])
708
- grouped_df['Exit Date'] = pd.to_datetime(grouped_df['Exit Date'])
709
  coding = cc_coding if bot_selections == "Cosmic Cupcake" else ctt_coding
710
  st.dataframe(grouped_df.style.format({'Entry Date':'{:%m-%d-%Y %H:%M:%S}','Exit Date':'{:%m-%d-%Y %H:%M:%S}','Avg. Buy Price': '${:.2f}', 'Sell Price': '${:.2f}', 'Net P/L':'${:.2f}', 'P/L %':'{:.2f}%'})\
711
  .apply(coding, axis=1)\
@@ -714,7 +714,7 @@ def runapp() -> None:
714
  new_title = '<div style="text-align: right;"><span style="background-color:lightgrey;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> Not Live Traded</div>'
715
  st.markdown(new_title, unsafe_allow_html=True)
716
  else:
717
- st.dataframe(grouped_df.style.format({'Avg. Buy Price': '${:.2f}', 'Sell Price': '${:.2f}', 'Net P/L':'${:.2f}', 'P/L %':'{:.2f}%'})\
718
  .applymap(my_style,subset=['Net P/L'])\
719
  .applymap(my_style,subset=['P/L %']), use_container_width=True)
720
 
 
703
  grouped_df.rename(columns={'Buy Price':'Avg. Buy Price',
704
  'P/L per token':'Net P/L'}, inplace=True)
705
  st.subheader("Trade Logs")
706
+ grouped_df['Entry Date'] = pd.to_datetime(grouped_df['Entry Date'])
707
+ grouped_df['Exit Date'] = pd.to_datetime(grouped_df['Exit Date'])
708
  if bot_selections == "Cosmic Cupcake" or bot_selections == "CT Toasted":
 
 
709
  coding = cc_coding if bot_selections == "Cosmic Cupcake" else ctt_coding
710
  st.dataframe(grouped_df.style.format({'Entry Date':'{:%m-%d-%Y %H:%M:%S}','Exit Date':'{:%m-%d-%Y %H:%M:%S}','Avg. Buy Price': '${:.2f}', 'Sell Price': '${:.2f}', 'Net P/L':'${:.2f}', 'P/L %':'{:.2f}%'})\
711
  .apply(coding, axis=1)\
 
714
  new_title = '<div style="text-align: right;"><span style="background-color:lightgrey;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> Not Live Traded</div>'
715
  st.markdown(new_title, unsafe_allow_html=True)
716
  else:
717
+ st.dataframe(grouped_df.style.format({'Entry Date':'{:%m-%d-%Y %H:%M:%S}','Exit Date':'{:%m-%d-%Y %H:%M:%S}','Avg. Buy Price': '${:.2f}', 'Sell Price': '${:.2f}', 'Net P/L':'${:.2f}', 'P/L %':'{:.2f}%'})\
718
  .applymap(my_style,subset=['Net P/L'])\
719
  .applymap(my_style,subset=['P/L %']), use_container_width=True)
720