Live Deriv Data Analysis - Professional Trading Softwareimport tkinter as tkfrom tkinter import ttk, messageboximport timeimport threadingimport random# Initialize root windowroot = tk.Tk()root.title("Live Deriv Data Analysis")root.geometry("1200x700")root.configure(bg="black")# Theme configurationcurrent_theme = "dark"def switch_theme(): global current_theme if current_theme == "dark": root.configure(bg="white") current_theme = "light" else: root.configure(bg="black") current_theme = "dark"# Menu bar with theme toggle and logoutmenu_frame = tk.Frame(root, bg="gray")menu_frame.pack(fill="x", side="top")logout_button = tk.Button(menu_frame, text="Logout", command=root.quit)logout_button.pack(side="right", padx=10)moon_button = tk.Button(menu_frame, text="🌙", command=switch_theme)moon_button.pack(side="right")# Start/Stop Analysisstreaming = Falsedef toggle_stream(): global streaming streaming = not streaming if streaming: start_button.config(text="Stop Analysis") else: start_button.config(text="Start Analysis")start_button = tk.Button(root, text="Start Analysis", command=toggle_stream)start_button.pack(pady=10)# Pop-up strategies (example: Matches/Differs)def show_matches_differs(): popup = tk.Toplevel(root) popup.title("Matches/Differs") popup.geometry("300x200") def run_ai_prediction(option): countdown_label = tk.Label(popup, text="Analyzing...", font=("Arial", 12)) countdown_label.pack(pady=5) def countdown(): for i in range(15, 0, -1): countdown_label.config(text=f"{i}s") time.sleep(1) prediction = random.randint(0, 9) prob = random.uniform(80, 99.9) recommend = "YES" if prob > 85 else "NO" messagebox.showinfo("Prediction", f"Digit: {prediction}\nProbability: {prob:.2f}%\nRecommend Entry: {recommend}") threading.Thread(target=countdown).start() tk.Button(popup, text="Matches", command=lambda: run_ai_prediction("Matches")).pack(pady=5) tk.Button(popup, text="Differs", command=lambda: run_ai_prediction("Differs")).pack(pady=5)def show_even_odd(): popup = tk.Toplevel(root) popup.title("Even/Odd") popup.geometry("300x150") def predict(option): prob = random.uniform(70, 95) recommendation = "YES" if prob > 80 else "NO" messagebox.showinfo("Prediction", f"Next likely: {option}\nConfidence: {prob:.2f}%\nRecommend: {recommendation}") tk.Button(popup, text="Even", command=lambda: predict("Even")).pack(pady=5) tk.Button(popup, text="Odd", command=lambda: predict("Odd")).pack(pady=5)def show_over_under(): popup = tk.Toplevel(root) popup.title("Over/Under") popup.geometry("300x200") def analyze(option): countdown = tk.Label(popup, text="15s") countdown.pack() def count(): for i in range(15, 0, -1): countdown.config(text=f"{i}s") time.sleep(1) digit = random.randint(0, 9) confidence = random.uniform(80, 99.9) runs = min(3, int(confidence / 33)) msg = f"Entry: {digit}\nConfidence: {confidence:.2f}%\nRuns: {runs}\nRecommendation: {'YES' if confidence > 85 else 'NO'}" messagebox.showinfo("AI Result", msg) threading.Thread(target=count).start() tk.Button(popup, text="Over", command=lambda: analyze("Over")).pack(pady=5) tk.Button(popup, text="Under", command=lambda: analyze("Under")).pack(pady=5)def show_rise_fall(): popup = tk.Toplevel(root) popup.title("Rise/Fall") popup.geometry("300x200") def predict(direction): countdown = tk.Label(popup, text="15s") countdown.pack() def run(): for i in range(15, 0, -1): countdown.config(text=f"{i}s") time.sleep(1) confidence = random.uniform(75, 98.5) recommend = "YES" if confidence > 85 else "NO" messagebox.showinfo("Prediction", f"Direction: {direction}\nConfidence: {confidence:.2f}%\nRecommend: {recommend}") threading.Thread(target=run).start() tk.Button(popup, text="Rise", command=lambda: predict("Rise")).pack(pady=5) tk.Button(popup, text="Fall", command=lambda: predict("Fall")).pack(pady=5)# Strategy Buttonsbtn_frame = tk.Frame(root, bg="black")btn_frame.pack(pady=20)strategies = [ ("Matches/Differs", show_matches_differs), ("Even/Odd", show_even_odd), ("Over/Under", show_over_under), ("Rise/Fall", show_rise_fall)]for label, command in strategies: tk.Button(btn_frame, text=label, width=15, command=command).pack(side="left", padx=10)# Run main looproot.mainloop()