testrro commited on
Commit
90e370e
·
verified ·
1 Parent(s): 0307339

Create app.py

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