from PyQt6.QtWidgets import (QApplication, QMainWindow, QWidget, QVBoxLayout,…
- User
from PyQt6.QtWidgets import (QApplication, QMainWindow, QWidget, QVBoxLayout, QHBoxLayout, QFrame, QLabel, QTableWidget, QTableWidgetItem, QGroupBox, QTabWidget, QProgressBar, QPushButton, QSpacerItem, QSizePolicy) from PyQt6.QtCore import Qt, QTimer from PyQt6.QtGui import QColor, QFont, QMovie import pyqtgraph as pg from datetime import datetime import numpy as np import torch
Cyberpunk color scheme
COLORS = { 'background': '#141414', 'text': '#00FFAA', 'border': '#444444', 'accent_green': '#00FFA3', # Neon green 'accent_purple': '#DC1FFF', # Neon purple 'accent_blue': '#1F51FF', # Neon blue 'accent_pink': '#FF1493', # Neon pink 'grid_lines': '#1F1F1F', 'plot_fill': '#1E1E2E' }
Define the style using Qt Style Sheets
STYLE = f""" QMainWindow {{ background-color: {COLORS['background']}; }} QWidget {{ font-family: 'Roboto', sans-serif; font-size: 14px; color: {COLORS['text']}; }} QFrame {{ background-color: {COLORS['background']}; border: 2px solid {COLORS['border']}; border-radius: 12px; padding: 10px; margin: 5px; }} QLabel {{ color: {COLORS['text']}; font-weight: bold; font-size: 15px; }} QPushButton {{ background-color: {COLORS['accent_green']}; border: none; padding: 10px; border-radius: 8px; color: {COLORS['text']}; font-size: 15px; transition: background-color 0.3s; }} QPushButton:hover {{ background-color: {COLORS['accent_purple']}; color: {COLORS['text']}; }} QTableWidget {{ background-color: {COLORS['background']}; border: 1px solid {COLORS['border']}; color: {COLORS['text']}; }} QHeaderView::section {{ background-color: {COLORS['border']}; color: {COLORS['accent_purple']}; font-weight: bold; }} QProgressBar {{ background-color: {COLORS['border']}; border: 2px solid {COLORS['accent_blue']}; text-align: center; }} """
class PriceChart(pg.PlotWidget): def init(self): super().init() self.setBackground(COLORS['background']) self.showGrid(x=True, y=True, alpha=0.3) self.getPlotItem().getAxis('left').setPen(pg.mkPen(color=COLORS['accent_blue'], width=2)) self.getPlotItem().getAxis('bottom').setPen(pg.mkPen(color=COLORS['accent_blue'], width=2))
codeself.price_line = self.plot([], [], pen=pg.mkPen(color=COLORS['accent_green'], width=3)) # Adding a filled area under the curve self.fill_curve = pg.FillBetweenItem(self.price_line, self.price_line, brush=(50, 50, 200, 100)) self.getPlotItem().addItem(self.fill_curve) self.setLabel('left', 'Price', **{'color': COLORS['accent_pink'], 'font-size': '14pt'}) self.setLabel('bottom', 'Time', **{'color': COLORS['accent_pink'], 'font-size': '14pt'}) # Add text annotations self.annotation = pg.TextItem(text='Quantum Trade', color=COLORS['accent_purple'], anchor=(0, 0)) self.getPlotItem().addItem(self.annotation) def update_price(self, prices, timestamps): self.price_line.setData(timestamps, prices) self.annotation.setPos(timestamps[-1], prices[-1]) - Assistant
- User
fulllll all of the code please
- Assistant