def start_losers(): with ACManager() as ACM: while True: try: tickers = ExchangeInterface.get_stock_top_losers(9) except KeyError: tickers = [] finally: ACM['CHART'].execute(*tickers) sleep(15)
def start_fomodd_api(): with ACManager() as ACM: while True: try: coins = ExchangeInterface.get_fomoddio_api_superfiltered_coins( amount=9) except KeyError: coins = [] finally: ACM['CHART'].execute(*coins) sleep(15)
def start_twitter_stock_search(twitter_profiles): with ACManager() as ACM: while True: try: tickers = search_twitter_profiles_for_stock_tickers( twitter_profiles) print(tickers) except KeyError: tickers = [] finally: ACM['CHART'].execute(*tickers) sleep(15)
def start_ac_repl(): ACM = ACManager() WORD_LIST = [command for command in ACM.commands] + ACM.tickers ACPrompt = AutoChartPrompt(commands=WORD_LIST) with ACM as acm: while True: inp = ACPrompt.get_prompt() cmd, args = parse_input(inp, commands=ACM.commands) try: command = acm[cmd] if args: command.execute(args) else: command.execute() except KeyError: if args: acm['CHART'].execute(*args) except WebDriverException: acm['EXIT'].execute(*tickers)
def get_stocks_from_twitter(twitter_name, max_tickers=9): tickerTweetRegex = re.compile(r'\$[^\d\s]\w*') tickers = list() for tweet in get_tweets(twitter_name, pages=5): # should be a generator somewhere. mo = tickerTweetRegex.findall(tweet['text']) if len(mo) > 0: clean = [ticker.replace('$', '') for ticker in mo] tickers += clean results = pd.unique(tickers) return list(results[:9]) with ACManager() as ACM: #TODO add var to change the title last = [] while True: twitter = TWITTER_NAMES print(f'Pulling nine tickers from {twitter} tweets') while True: try: stocks = get_stocks_from_twitter(twitter) if last != stocks: last = stocks print() print(f'New stock found {stocks[0]}') print('Scanning.') ACM['CHART'].execute(*stocks) sleep(5) print('.', end='', flush=True)
from pathlib import Path import sys from time import sleep newpath = Path(__file__).parent.parent sys.path.insert(0, str(newpath)) from autochart_tv.manager import ACManager with ACManager() as ACM: sleep(2) ACM['CHART'].execute('AAPL') sleep(2) ACM['CHART'].execute('BTCUSDT', 'TSLA') sleep(2) ACM['RANDOM'].execute() sleep(2) ACM['RANDOMCRYPTO'].execute(9) sleep(5)