Skip to content

Instantly share code, notes, and snippets.

View McKlayne's full-sized avatar
🎯
Focusing

McKlayne Marshall McKlayne

🎯
Focusing
View GitHub Profile
@McKlayne
McKlayne / webull_analyst_script.py
Last active June 10, 2021 01:14
A break down of how to grab all of the analyst data from Webull for every stock.
#Import all packages needed
import pandas as pd
import numpy as np
from config import username, password
from progressbar import progressbar
from webull import webull # for paper trading, import 'paper_webull'
#login to webull/authenticate with API
wb = webull()
wb.login(username, password)
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "new statement",
"Effect": "Allow",
"Principal": {
"AWS": [
***Your AWS Entities
]
# Define function directory
ARG FUNCTION_DIR="/function"
FROM python:buster as build-image
# Install aws-lambda-cpp build dependencies
RUN apt-get update && \
apt-get install -y \
g++ \
make \
import pandas as pd
import sklearn
import xgboost as xgb
def handler(event, context):
message = []
message.append('The xgboost version is {}.'.format(xgb.__version__))
message.append('The scikit-learn version is {}.'.format(sklearn.__version__))
message.append('The pandas version is {}.'.format(pd.__version__))
import pandas as pd
import sklearn
import xgboost as xgb
def handler(event, context):
message = []
message.append('The xgboost version is {}.'.format(xgb.__version__))
message.append('The scikit-learn version is {}.'.format(sklearn.__version__))
message.append('The pandas version is {}.'.format(pd.__version__))
import sys
def handler(event, context):
return 'Hello from AWS Lambda using Python' + sys.version + '!'
# Define function directory
ARG FUNCTION_DIR="/function"
FROM python:buster as build-image
# Install aws-lambda-cpp build dependencies
RUN apt-get update && \
apt-get install -y \
g++ \
make \
@McKlayne
McKlayne / trade.py
Last active January 30, 2021 23:34
import os
import alpaca_trade_api as tradeapi
import pandas as pd
import numpy as np
import boto3
import ta
s3 = boto3.client('s3')
sns = boto3.client('sns')
import cbpro
import os
import websocket
import pprint
import ta
import numpy as np
import pandas as pd
import cbpro, time
public_client = cbpro.PublicClient()
# load required packages (must be previously installed)
import json
import requests
import networkx as nx
from itertools import combinations
import pandas as pd
pd.options.display.max_rows = 1000
# define the lists of ids and abbreviations
# make sure the abbreviations are in the same order as the corresponding cryptos in the id_list