-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
75 lines (59 loc) · 2.16 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import sys
sys.path.append("C:\\Users\\Max\\Desktop\\Stock_Tracker")
from data.paper import run
from alpaca.data.historical import CryptoHistoricalDataClient
from alpaca.data.requests import CryptoBarsRequest
from alpaca_trade_api.rest import REST, TimeFrame
import os
from config import *
from data.day_trade import DTManager, DTCalc, DTData
from data.analysis import RSIManager
import time as tm
import yfinance as yf
import concurrent.futures
import keyboard
from datetime import datetime, timedelta
from queue import Queue
import pandas as pd
from datetime import datetime, timedelta
from r_analysis.data_download import run_download
dt = DTManager()
rsim = RSIManager()
dtc = DTCalc()
run_download()
#tick = "ANSS"
#range = (40,50)
#dt.limit(tick, range)
############################run()
#print("running")
#print(rsim.macd("GM"))
#print("what")
#run_download()
#98,314 for win rate
#hit 98,800 with win rate, made changes went down to 98100
#restart with win rate at 98072
from data.min_rsi import ab_lowManager
range = [(40,50)]
ab = ab_lowManager()
#tick = ["AAPL", "GM", "AAA", "VZ", "IBM"]
from random import sample
#with open("./storage/ticker_lists/safe_tickers.txt", "r") as stock_file:
# stock_list = stock_file.read().split('\n')
#stock_list = sample(stock_list,50)
#ab.limit(stock_list)
#def check_volume(ticker):
# find confidence interval of volume of stock , probably 80%
# download freq 20 and some data to find interval
# download current volume data with yfinance and if statement it
# df = dtc.tiingo(ticker, frequency = "20min", start_date = "2024-08-20")
# print(df)
# volume = df['Volume'].tolist()
# print(volume[-1])
# mean, cf_range = dtc.calculate_ci(volume, confidence_level = 0.80)
# ticker = yf.Ticker(ticker)
# intraday_data = ticker.history(interval='1m', period='1d')
# print(intraday_data['Volume'])
# print(mean, cf_range, current_volume)
#check_volume("AAPL")
# if volume is over interval, send signal (add later to conditions; if volume is high use a trailing sell; ride the wave)
# TEST HOW MUCH CONFIDENCE INTERVAL OF DATA INCREASES OR DECREASES WITH TIME (in main paper.py for those calculations)