Skip to content

Instantly share code, notes, and snippets.

View ycytai's full-sized avatar

Yu Chen, Yang ycytai

  • Taipei, Taiwan
View GitHub Profile
import random
doors = ['Goat', 'Car', 'Goat']
n = 1000
win = 0
lose = 0
for _ in range(n):
#-------------------------#
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import scipy.stats as st
import numpy as np
def black_scholes_pricing_model(
option_type: str,
s: float,
k: float,
r: float,
v: float,
@ycytai
ycytai / dollar_averaging.py
Last active October 15, 2021 09:21
Dollar Averaging Strategy
def dollar_averaging(df, trade_date, trade_amount, f_or_b = 'f'):
'''
Input:
1. df (dataframe)
---> Datetime object should be set as index
2. trade_date (int)
---> determine which date to invest