Skip to content

Commit

Permalink
edit comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragan Bogatic authored and Dragan Bogatic committed Sep 28, 2021
1 parent d39ba46 commit eba630b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions value_screen.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"\n",
"url = (f'https://financialmodelingprep.com/api/v3/stock-screener?marketCapMoreThan={market_cap}&betaMoreThan={beta}&volumeMoreThan={volume}&dividendMoreThan={dividend}&exchange={exchange}&limit={limit}&apikey={FMP_API_KEY}')\n",
"\n",
"#get companies based on criteria defined about\n",
"# Get companies based on criteria defined about\n",
"screen = requests.get(url).json()\n",
"#screen"
],
Expand All @@ -106,14 +106,14 @@
"cell_type": "code",
"execution_count": 33,
"source": [
"# add selected companies to a list\n",
"# Add selected companies to a list\n",
"for item in screen:\n",
"\tcompanies.append(item['symbol'])\n",
"\t\n",
"# print(companies)\n",
"# Print(companies)\n",
"value_ratios = {}\n",
"\n",
"# get the financial ratios\n",
"# Get the financial ratios\n",
"count = 0\n",
"\n",
"for company in companies:\n",
Expand All @@ -136,7 +136,7 @@
"\t\t\tvalue_ratios[company]['Dividend_Yield'] = fin_ratios[0]['dividendYield']\n",
"\t\t\tvalue_ratios[company]['Operating_Margin'] = fin_ratios[0]['operatingProfitMargin']\n",
"\t\t\t\n",
"\t\t\t#more financials on growth\n",
"\t\t\t# More financials on growth\n",
"\t\t\tgrowth_ratios = requests.get(f'https://financialmodelingprep.com/api/v3/financial-growth/{company}?apikey={FMP_API_KEY}').json()\n",
"\t\t\t\n",
"\t\t\tvalue_ratios[company]['Revenue_Growth'] = growth_ratios[0]['revenueGrowth']\n",
Expand Down Expand Up @@ -642,22 +642,22 @@
{
"cell_type": "markdown",
"source": [
"# Normalize dataframe values "
"# Normalize Dataframe Values "
],
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 35,
"source": [
"# calculate mean of dataframe columns to enable comparison across ratios\n",
"# Calculate mean of dataframe columns to enable comparison across ratios\n",
"ratios_mean = []\n",
"\n",
"for item in df.columns:\n",
"\n",
"\tratios_mean.append(df[item].mean())\n",
"\n",
"# divide each value in dataframe by mean to normalize values\n",
"# Divide each value in dataframe by mean to normalize values\n",
"df = df / ratios_mean"
],
"outputs": [],
Expand Down

0 comments on commit eba630b

Please sign in to comment.