Skip to content

bitflyer

lawnn edited this page Mar 25, 2023 · 3 revisions

import

from fetcher.bitflyer import bf_get_historical, bf_get_trades

1分足以上のローソク足

bf_get_historical(st_date: str, symbol: str = 'FX_BTC_JPY', period: str = 'm',
                      grouping: int = 1, output_dir: str = None) -> None:

引数

  • st_date: 取得する日付の始点
    '2021/09/01'
  • symbol: 取引ペア
    "ETH_JPY" "BTC_JPY"など
  • period: 分日時
    m,h,d
  • grouping: periodが'm'のときgroupingが15なら 15分足になる
    1-30
  • output_dir: 任意の場所にファイルを置く
    "hogehoge/hugahuga"

取引履歴

bf_get_trades(st_date: str, end_date: str = None, symbol: str = 'FX_BTC_JPY', output_dir: str = None,
                    request_interval: float = 0.6) -> None:

引数

  • st_date: 取得する日付の始点(直近31日前まで)
    '2021/09/01'
  • end_date: 取得する日付の終点(直近31日前まで)
    '2021/09/30'
  • symbol: 取引ペア
    "ETH_JPY" "BTC_JPY"など
  • output_dir: 任意の場所にファイルを置く
    "hogehoge/hugahuga"
  • request_interval: ループ待ち時間

取引履歴をヒストリカルデータにする

bf_trade_to_historical(path: str, price_pl_type: type = pl.Int64, period: str="1s") -> pl.DataFrame:

引数

  • path: パス
    hogehoge/hugehuge.csv
  • price_pl_type: polarsの型指定 pl.Foat32
  • period: 時間軸 5s

Clone this wiki locally