import sys import yfinance as yf import pandas as pd import numpy as np import pandasta…
Private research annotation
Sign in to add a private research label or note.
- User
import sys import yfinance as yf import pandas as pd import numpy as np import pandas_ta as ta # Import pandas_ta from PyQt5.QtWidgets import ( QApplication, QWidget, QVBoxLayout, QHBoxLayout, QLabel, QPushButton, QLineEdit, QTableWidget, QTableWidgetItem, QHeaderView, QAbstractItemView, QMessageBox, QCheckBox ) from PyQt5.QtGui import QIcon, QFont from PyQt5.QtCore import Qt, QTimer, QThreadPool, QRunnable, pyqtSlot, QObject, pyqtSignal import traceback
nfo_stocks = [ "NSE:AARTIDRUGS", "NSE:AARTIIND", "NSE:AARTIPHARM","NSE:ABB", "NSE:ABBOTINDIA", "NSE:ABCAPITAL", "NSE:ABFRL", "NSE:ACC","NSE:ADANIENT", ]
stock_list = []
def transform_stock_name(name): # Remove the prefix 'NSE:' or 'BSE:' and add appropriate suffix if 'NSE:' in name: name = name.split('NSE:')[1] if '-' in name: name = name.split('-')[0] name += '.NS' elif 'BSE:' in name: name = name.split('BSE:')[1] name += '.BO'
return nameclass WorkerSignals(QObject): result = pyqtSignal(list) # Signal to send the result error = pyqtSignal(str) # Signal to send any error messages
class Worker(QRunnable): def init(self, symbols, rsi_threshold, macd_condition, momentum_condition): super().init() self.symbols = symbols self.rsi_threshold = rsi_threshold self.macd_condition = macd_condition self.momentum_condition = momentum_condition self.signals = WorkerSignals()
code - Assistant