mariostoev/finviz

finviz api Unable to parse page for ticker

Opened this issue · 0 comments

This is my program:
#!/usr/bin/python3
!pip install finviz~=1.4.6
from finviz.screener import Screener

from finviz.screener import Screener

import os
import datetime
Current_Date = datetime.datetime.today().strftime ('%d-%b-%Y')

Input

valperiod = input('Enter Type of Graphic d,w,m: ')

if valperiod == "w" or "m":
valta ="0"
else:
valta = "1"

Create the Folder where the data ancharts are going to be stores

newpath = 'D:\Users\Jose Mizrahi\Documents\finviz-master\finviz-master\'+'Breakout1 '+str(Current_Date)+'\'
if not os.path.exists(newpath):
os.makedirs(newpath)

Get dict of available filters

filters dict contains the corresponding filter tags

filters = Screener.load_filter_dict()

filters = [
"cap_small",
"fa_sales5years_pos",
"sh_curvol_o200",
"sh_relvol_o1",
"ta_highlow52w_b0to10h",
"ty=c&p=w&tas=0",
"ta_volatility_mo3&ft=4&o=ticker"
]
stock_list = Screener(filters=filters, table="Performance")

print(stock_list)

Monthly, Candles, Large, No Technical Analysis

if valperiod == "d":
stock_list.get_charts(period="d", chart_type='c', size='l', ta="1")
else:
stock_list.get_charts(period=valperiod, chart_type='c', size='l', ta="0")

period='d' > daily

period='w' > weekly

period='m' > monthly

chart_type='c' > candle

chart_type='l' > lines

size='m' > small

size='l' > large

ta='1' > display technical analysis

ta='0' > ignore technical analysis

print("Retrieving stock data...")
stock_data = stock_list.get_ticker_details()
print(stock_data)

os.chdir(newpath)

Export the screener results to CSV file

stock_list.to_csv("JosyBreakout1.csv")

Create a SQLite database

stock_list.to_sqlite("sp500.sqlite")}

I am getting: -> Unable to parse page for ticker: None

Please Help