Skip to content

Instantly share code, notes, and snippets.

View yongghongg's full-sized avatar
🏠
Working from home

Yonghong Tan yongghongg

🏠
Working from home
View GitHub Profile
def get_stock_price(ticker):
data = yf.download(ticker, start="2021-01-01")
return data
def add_EMA(price, day):
return price.ewm(span=day).mean()
def add_STOCH(close, low, high, period, k, d=0):
STOCH_K = ((close - low.rolling(window=period).min()) / (high.rolling(window=period).max() - low.rolling(window=period).min())) * 100
STOCH_K = STOCH_K.rolling(window=k).mean()
@yongghongg
yongghongg / japanese_dict_app.gs
Last active March 9, 2021 07:04
japanese_dict_app.gs
function getJapReading(word) {
var url = "http://jisho.org/api/v1/search/words?keyword=" + word;
var response = UrlFetchApp.fetch(url, {'muteHttpExceptions': true});
var json = JSON.parse(response.getContentText());
japReading = json.data[0].japanese[0].reading;
return japReading;
}
function getEnglishDef(word) {
var url = "http://jisho.org/api/v1/search/words?keyword=" + word;
@yongghongg
yongghongg / stock_screener.py
Last active October 19, 2024 06:01
Build your own technical analysis stock screener using Python
#import required modules
from bs4 import BeautifulSoup
import ast
import pandas as pd
import re
import requests
from datetime import datetime
def get_stock_price(ticker):
# pass a ticker name to i3investor website url