Skip to content

Commit

Permalink
Check if ticker in NASDAQ 100
Browse files Browse the repository at this point in the history
  • Loading branch information
astro30 committed Feb 8, 2020
1 parent 7f56602 commit 414b278
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion valinvest/fundamentals.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import numpy as np
from .config import *


def get_financial_statements(ticker):
res = pd.DataFrame()
for statement in ['income-statement', 'balance-sheet-statement', 'cash-flow-statement']:
Expand All @@ -31,6 +30,8 @@ def get_beta(ticker):
def get_financial_statement(ticker, statement):
if not isinstance(ticker, str):
raise TypeError("Ticker should be a string.")
if ticker not in NASDAQ_100_TICKERS:
raise ValueError("Ticker should be a NASDAQ 100 ticker")
if statement not in ['income-statement', 'balance-sheet-statement', 'cash-flow-statement']:
raise ValueError(
"Statement should be income-statement: Income Statement, cash-flow-statement: Cash Flow Statement or balance-sheet-statement: Balance Sheet.")
Expand Down

0 comments on commit 414b278

Please sign in to comment.