- Make sure the domain you picked points at the IP of your Redash server.
- Switch to the
root
user (sudo su
). - Create a folder named
nginx
in/opt/redash
. - Create in the nginx folder two additional folders:
certs
andcerts-data
. - Create the file
/opt/redash/nginx/nginx.conf
and place the following in it: (replaceexample.redashapp.com
with your domain name)upstream redash { server server:5000; }
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import msal | |
import requests | |
# Replace with your values | |
CLIENT_ID = 'your-client-id' | |
CLIENT_SECRET = 'your-client-secret' | |
TENANT_ID = 'your-tenant-id' | |
EMAIL = 'sender-email' | |
# 1. Define the MSAL authentication flow |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Lecture 1: Introduction to Research — [📝Lecture Notebooks] [
Lecture 2: Introduction to Python — [📝Lecture Notebooks] [
Lecture 3: Introduction to NumPy — [📝Lecture Notebooks] [
Lecture 4: Introduction to pandas — [📝Lecture Notebooks] [
Lecture 5: Plotting Data — [📝Lecture Notebooks] [[
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pydantic import BaseModel | |
from enum import Enum | |
from datetime import date, datetime, timedelta | |
import matplotlib.pyplot as plt | |
from matplotlib.ticker import FormatStrFormatter | |
class OptionType(str, Enum): | |
Call = 'Call' | |
Put = 'Put' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scipy.stats as st | |
import numpy as np | |
def binomial_tree_pricing_model( | |
option_type: str, | |
s: float, | |
k: float, | |
r: float, | |
v: float, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib.parse import urlencode, urljoin | |
from datetime import datetime | |
from pandas.core.frame import DataFrame | |
import requests | |
import pandas as pd | |
def get_etf_dividend_history( | |
symbol: str = "", | |
start_date: str = '20050101', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import requests | |
# 設定目標日期 | |
target_date = '20230928' | |
# 把 csv 檔抓下來 | |
url = f'https://www.twse.com.tw/rwd/zh/afterTrading/MI_INDEX?date={target_date}&type=ALL&response=csv' | |
res = requests.get(url) | |
data = res.text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from enum import Enum | |
import numpy as np | |
import scipy.stats as st | |
class OptionType(str, Enum): | |
call = 'Call' | |
put = 'Put' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from io import StringIO | |
import requests | |
import time | |
import random | |
def get_put_call_ratio_df(q_start_date: str, q_end_date:str): | |
url = 'https://www.taifex.com.tw/cht/3/pcRatioDown' | |
payload = { | |
'queryStartDate': q_start_date, |
NewerOlder