Last active
March 16, 2018 13:56
-
-
Save juiCYMod/639955f3857698ddd2b9c74ceacd6ada to your computer and use it in GitHub Desktop.
ZaifのAirFXの指定した範囲の損益をCSVで出力
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 zaifapi import ZaifLeverageTradeApi | |
import datetime | |
import time | |
import json | |
import pandas as pd | |
#kara~madeの期間の損益を出力。 | |
kara = datetime.datetime(2018, 3, 16, 0, 0, 0) | |
made = datetime.datetime(2018, 3, 16, 23, 59, 59) | |
unix = time.mktime(kara.timetuple()) | |
unixz = time.mktime(made.timetuple()) | |
zaif = ZaifLeverageTradeApi("YOUR_API_KEY","YOUR_API_SECRET") | |
gp = zaif.get_positions(type="futures",group_id=1,since=int(unix),end=int(unixz)) | |
#print(gp) | |
frame = pd.DataFrame(gp) | |
frame.to_csv(str(unix)+".csv",index=True,encoding="utf-8",mode="a",header=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment