#bitFlyerの終値のデータをpandasのSeriesにして返す関数 def get_price_data(): response = requests.get("https://api.cryptowat.ch/markets/bitflyer/btcfxjpy/ohlc",params = { "periods" : period }) response = response.json() close_data = [] for i in range(data_n): close_data.insert(0,response["result"][str(period)][-i-1][4]) arr = np.array(close_data) return pd.Series(arr) #IFDOCO #sideは"BUY"or"SELL",他は数値 def IFDOCO_ord