Spaces:
Sleeping
Sleeping
simplify top of fold
Browse files
app.py
CHANGED
@@ -419,7 +419,8 @@ with st.form("choose_model"):
|
|
419 |
data = {
|
420 |
'Confidence':[f'{text_cond} {score:.1%}'],
|
421 |
'Success':[f'{historical_proba:.1%}'],
|
422 |
-
f'N{operator}{score:.1%}':[f'{num_obs} / {len(data)}']
|
|
|
423 |
})
|
424 |
|
425 |
prices = pd.DataFrame(index=[
|
@@ -549,44 +550,36 @@ with st.form("choose_model"):
|
|
549 |
tab1, tab2, tab3, tab4 = st.tabs(["π€ Stats", "β¨ New Data", "π Historical", "π Performance"])
|
550 |
|
551 |
with tab1:
|
552 |
-
st.dataframe(prices.T.set_index('PrevClose', drop=True))
|
553 |
st.write(df_probas)
|
554 |
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
]
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
df_em.loc[f"EM 1.5X"] = [
|
583 |
-
f"{curr_em * 1.5:.2f} ({(em_use * 1.5) / close_use:.1%})",
|
584 |
-
f"{close_use - (em_use * 1.5):.2f}",
|
585 |
-
f"{close_use + (em_use * 1.5):.2f}",
|
586 |
-
f"{len(data.query('Close <= VIX_EM_15_High & Close >= VIX_EM_15_Low')) / len(data):.1%}",
|
587 |
-
f"{len(data.query('High > VIX_EM_15_High | Low < VIX_EM_15_Low')) / len(data):.1%}"
|
588 |
-
]
|
589 |
-
st.write(df_em)
|
590 |
|
591 |
with tab2:
|
592 |
st.subheader('Latest Data for Pred')
|
|
|
419 |
data = {
|
420 |
'Confidence':[f'{text_cond} {score:.1%}'],
|
421 |
'Success':[f'{historical_proba:.1%}'],
|
422 |
+
f'N{operator}{score:.1%}':[f'{num_obs} / {len(data)}'],
|
423 |
+
'Prev / Curr':[f'{prev_close:.2f} / {curr_close:.2f}']
|
424 |
})
|
425 |
|
426 |
prices = pd.DataFrame(index=[
|
|
|
550 |
tab1, tab2, tab3, tab4 = st.tabs(["π€ Stats", "β¨ New Data", "π Historical", "π Performance"])
|
551 |
|
552 |
with tab1:
|
553 |
+
# st.dataframe(prices.T.set_index('PrevClose', drop=True))
|
554 |
st.write(df_probas)
|
555 |
|
556 |
+
for close_use, em_use, lbl in zip([prev_close, curr_close], [curr_em, fwd_em], ['Current','Forward']):
|
557 |
+
|
558 |
+
st.write(f'π VIX EM {lbl}: {em_use:.2f}')
|
559 |
+
df_em = pd.DataFrame(columns=['EM','Low','High','InRange','Tested'])
|
560 |
+
df_em.index.name = f'{close_use:.2f}'
|
561 |
+
df_em.loc['EM 1X'] = [
|
562 |
+
f"{em_use:.2f} ({em_use / close_use:.1%})",
|
563 |
+
f"{close_use - em_use:.2f}",
|
564 |
+
f"{close_use + em_use:.2f}",
|
565 |
+
f"{len(data.query('Close <= VIX_EM_High & Close >= VIX_EM_Low')) / len(data):.1%}",
|
566 |
+
f"{len(data.query('High > VIX_EM_High | Low < VIX_EM_Low')) / len(data):.1%}"
|
567 |
+
]
|
568 |
+
df_em.loc['EM 1.25X'] = [
|
569 |
+
f"{curr_em * 1.25:.2f} ({(em_use * 1.25) / close_use:.1%})",
|
570 |
+
f"{close_use - (em_use * 1.25):.2f}",
|
571 |
+
f"{close_use + (em_use * 1.25):.2f}",
|
572 |
+
f"{len(data.query('Close <= VIX_EM_125_High & Close >= VIX_EM_125_Low')) / len(data):.1%}",
|
573 |
+
f"{len(data.query('High > VIX_EM_125_High | Low < VIX_EM_125_Low')) / len(data):.1%}"
|
574 |
+
]
|
575 |
+
df_em.loc[f"EM 1.5X"] = [
|
576 |
+
f"{curr_em * 1.5:.2f} ({(em_use * 1.5) / close_use:.1%})",
|
577 |
+
f"{close_use - (em_use * 1.5):.2f}",
|
578 |
+
f"{close_use + (em_use * 1.5):.2f}",
|
579 |
+
f"{len(data.query('Close <= VIX_EM_15_High & Close >= VIX_EM_15_Low')) / len(data):.1%}",
|
580 |
+
f"{len(data.query('High > VIX_EM_15_High | Low < VIX_EM_15_Low')) / len(data):.1%}"
|
581 |
+
]
|
582 |
+
st.write(df_em)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
583 |
|
584 |
with tab2:
|
585 |
st.subheader('Latest Data for Pred')
|