import Social from "../components/social";
<Social email="mailto: kev.guo123@gmail.com" github="https://www.github.com/2018kguo" linkedin="https://www.linkedin.com/in/2018kguo/" medium="https://medium.com/@kev.guo123" >
import robin_stocks as r | |
#Log in to Robinhood | |
#Put your username and password in a config.py file in the same directory (see sample file) | |
login = r.login(rh_username,rh_password) | |
def get_watchlist_symbols(): | |
""" | |
Returns: the symbol for each stock in your watchlist as a list of strings | |
""" |
def get_last_crossing(df, days, symbol="", direction=""): | |
"""Searches for a crossing between two indicators for a given stock | |
Args: | |
df(pandas.core.frame.DataFrame): Pandas dataframe with columns containing the stock's prices, both indicators, and the dates | |
days(int): Specifies the maximum number of days that the cross can occur by | |
symbol(str): Symbol of the stock we're querying. Optional, used for printing purposes | |
direction(str): "above" if we are searching for an upwards cross, "below" if we are searching for a downwaords cross. Optional, used for printing purposes | |
Returns: | |
1 if the short-term indicator crosses above the long-term one | |
0 if there is no cross between the indicators |
def sell_holdings(symbol, holdings_data): | |
""" Place an order to sell all holdings of a stock. | |
Args: | |
symbol(str): Symbol of the stock we want to sell | |
holdings_data(dict): dict obtained from get_modified_holdings() method | |
""" | |
shares_owned = int(float(positions_data[symbol].get("quantity"))) | |
r.order_sell_market(symbol, shares_owned) | |
print("####### Selling " + str(shares_owned) + " shares of " + symbol + " #######") |
def buy_holdings(potential_buys, profile_data, holdings_data): | |
""" Places orders to buy holdings of stocks. This method will try to order | |
an appropriate amount of shares such that your holdings of the stock will | |
roughly match the average for the rest of your portfoilio. If the share | |
price is too high considering the rest of your holdings and the amount of | |
buying power in your account, it will not order any shares. | |
Args: | |
potential_buys(list): List of strings, the strings are the symbols of stocks we want to buy | |
symbol(str): Symbol of the stock we want to sell |
<style> | |
/*! | |
* Bootstrap v4.3.1 (https://getbootstrap.com/) | |
* Copyright 2011-2019 The Bootstrap Authors | |
* Copyright 2011-2019 Twitter, Inc. | |
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |
*/ | |
#test1 { | |
width: 45vw; | |
} |
# This workflow to automatically build and deploy to GitHub Pages (master branch) | |
# when code is pushed to the dev branch | |
name: CI | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push events but only for the dev branch | |
push: | |
branches: [ dev ] |
plugins: [ | |
{ | |
resolve: `gatsby-plugin-gtag`, | |
options: { | |
// your google analytics tracking id | |
trackingId: process.env.GOOGLE_ANALYTICS_ID, | |
// Puts tracking script in the head instead of the body | |
head: false, | |
// enable ip anonymization | |
anonymize: true, |
github: | |
enabled: true | |
repoURL: "https://github.com/pittcsc/Summer2022-Internships" | |
linkedIn: | |
enabled: true | |
timespan: "day" | |
queries: | |
- "software engineer intern" | |
- "software engineering internship" | |
- "software development intern" |
async def fetchHTML(self, url: str, session: ClientSession) -> str: | |
resp = await session.request(method="GET", url=url) | |
html = await resp.text() | |
if(len(html) == 0): | |
print("Hit rate limit for LinkedIn requests") | |
return html | |
async def gatherTopLevelSearchForLocations(self) -> List[str]: | |
htmlList = [] | |
async with aiohttp.ClientSession() as session: |