alexaxbreadbytes commited on
Commit
afcb463
·
1 Parent(s): 4570e69

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -598,6 +598,7 @@ def runapp() -> None:
598
  st.subheader("Summarized Results")
599
  if df.empty:
600
  st.error("Oops! None of the data provided matches your selection(s). Please try again.")
 
601
  else:
602
  st.dataframe(results_df.style.format({'Win Rate': '{:.2f}%','Profit Factor' : '{:.2f}',
603
  'Avg. P/L (%)': '{:.2f}%', 'Cum. P/L (%)': '{:.2f}%',
@@ -908,7 +909,7 @@ def runapp() -> None:
908
  f"{get_rolling_stats(df,lev, otimeheader, 180):.2f}%",
909
  )
910
 
911
- if bot_selections == "Cinnamon Toast":
912
  if submitted:
913
  grouped_df = df.groupby('Exit Date').agg({'Signal':'min','Entry Date': 'min','Exit Date': 'max','Buy Price': 'mean',
914
  'Sell Price' : 'max',
@@ -935,7 +936,7 @@ def runapp() -> None:
935
  'P/L per token':'Net P/L'}, inplace=True)
936
 
937
  else:
938
- if submitted:
939
  grouped_df = df.groupby('Exit Date').agg({'Signal':'min','Entry Date': 'min','Exit Date': 'max','Buy Price': 'mean',
940
  'Sell Price' : 'max',
941
  'Net P/L Per Trade': 'mean',
 
598
  st.subheader("Summarized Results")
599
  if df.empty:
600
  st.error("Oops! None of the data provided matches your selection(s). Please try again.")
601
+ no_errors = False
602
  else:
603
  st.dataframe(results_df.style.format({'Win Rate': '{:.2f}%','Profit Factor' : '{:.2f}',
604
  'Avg. P/L (%)': '{:.2f}%', 'Cum. P/L (%)': '{:.2f}%',
 
909
  f"{get_rolling_stats(df,lev, otimeheader, 180):.2f}%",
910
  )
911
 
912
+ if bot_selections == "Cinnamon Toast" and no_errors:
913
  if submitted:
914
  grouped_df = df.groupby('Exit Date').agg({'Signal':'min','Entry Date': 'min','Exit Date': 'max','Buy Price': 'mean',
915
  'Sell Price' : 'max',
 
936
  'P/L per token':'Net P/L'}, inplace=True)
937
 
938
  else:
939
+ if submitted and not(df.empty):
940
  grouped_df = df.groupby('Exit Date').agg({'Signal':'min','Entry Date': 'min','Exit Date': 'max','Buy Price': 'mean',
941
  'Sell Price' : 'max',
942
  'Net P/L Per Trade': 'mean',