File size: 3,936 Bytes
90e370e 178de2c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | import streamlit as st
import numpy as np
import pandas as pd
st.set_page_config(page_title="Aviator Pattern Tracker Pro", layout="centered")
# ---------------------------
# Session State
# ---------------------------
if "history" not in st.session_state:
st.session_state.history = []
# ---------------------------
# Header
# ---------------------------
st.title("🎯 Aviator Pattern Tracker Pro")
st.caption("Pattern + Expected Multiplier + Risk Control (Bangla UI)")
# ---------------------------
# Input Section
# ---------------------------
st.subheader("📥 Multiplier Input")
new_val = st.number_input("নতুন multiplier দিন (example: 1.45)", min_value=1.0, step=0.01)
col1, col2 = st.columns(2)
with col1:
if st.button("➕ Add"):
st.session_state.history.append(round(new_val, 2))
with col2:
if st.button("🔁 Reset"):
st.session_state.history = []
# ---------------------------
# Data
# ---------------------------
data = st.session_state.history[-50:]
st.subheader("📊 Last 50 Rounds")
st.write(data)
if len(data) < 5:
st.warning("কমপক্ষে 5টা multiplier দিন")
st.stop()
# ---------------------------
# Pattern Calculation
# ---------------------------
low = [x for x in data if x < 1.5]
mid = [x for x in data if 1.5 <= x <= 3]
high = [x for x in data if x > 3]
low_ratio = len(low) / len(data)
high_ratio = len(high) / len(data)
mean = np.mean(data)
std = np.std(data)
# Chaos Index
chaos = (std * high_ratio) / (low_ratio + 0.1)
# Low streak
low_streak = 0
for x in reversed(data):
if x < 1.5:
low_streak += 1
else:
break
# Confidence
stability_score = max(0, 1 - std/5)
distribution_score = 1 - abs(low_ratio - 0.5)
confidence = ((low_streak/5) + stability_score + distribution_score) / 3
confidence = max(0, min(confidence, 1))
# ---------------------------
# Expected Multiplier
# ---------------------------
arr = np.array(data)
weights = np.linspace(1, 2, len(arr))
weighted_mean = np.average(arr, weights=weights)
median = np.median(arr)
sorted_arr = np.sort(arr)
trim = int(len(arr) * 0.1)
trimmed = sorted_arr[trim: len(arr)-trim] if len(arr) > 10 else arr
trimmed_mean = np.mean(trimmed)
expected = (weighted_mean * 0.5) + (median * 0.3) + (trimmed_mean * 0.2)
lower = expected - (std * 0.5)
upper = expected + (std * 0.5)
lower = max(1.01, lower)
# ---------------------------
# Decision Logic
# ---------------------------
if chaos > 1.2:
signal = "🔴 SKIP"
risk = "HIGH RISK"
elif low_streak >= 3 and std < 1.5:
signal = "🟢 ENTER (SMALL)"
risk = "LOW RISK"
else:
signal = "🟡 WAIT"
risk = "MEDIUM"
# refine by expected
if signal.startswith("🟢") and expected < 1.4:
signal = "🟡 WAIT (Expected Low)"
if signal.startswith("🟢") and expected > 2.0:
signal = "🟢 ENTER (GOOD ZONE)"
# ---------------------------
# OUTPUT UI
# ---------------------------
st.subheader("📈 Analysis")
c1, c2, c3 = st.columns(3)
c1.metric("Mean", round(mean,2))
c2.metric("Std Dev", round(std,2))
c3.metric("Chaos", round(chaos,2))
st.divider()
st.subheader("🎯 Expected Multiplier")
e1, e2 = st.columns(2)
e1.metric("Expected", round(expected,2))
e2.metric("Range", f"{round(lower,2)} - {round(upper,2)}")
st.divider()
st.subheader("🧠 Decision")
st.markdown(f"### {signal}")
st.markdown(f"**Confidence:** {round(confidence,2)}")
st.markdown(f"**Risk Level:** {risk}")
# ---------------------------
# Strategy Guide
# ---------------------------
st.divider()
st.subheader("📘 Strategy Guide")
st.markdown("""
**Entry Rule:**
- ছোট bet only
- auto cashout: 1.5x – 1.8x
**Stop Rule:**
- 2 loss in row → STOP
- 1 big win (>3x) → next 2 round skip
**Expected Guide:**
- <1.4 → weak
- 1.4–1.8 → safe
- 1.8–2.5 → medium
- >2.5 → volatile
⚠️ এটি কোনো নিশ্চিত জেতার tool না
""") |