코인으로 부자되기/트레이딩

Freqtrade 활용한 코인 가격 가져오기

야나부짱 2023. 5. 1. 17:15

https://www.freqtrade.io/en/stable/installation/

 

Linux/MacOS/Raspberry - Freqtrade

Install necessary dependencies # update repository sudo apt-get update # install packages sudo apt install -y python3-pip python3-venv python3-dev python3-pandas git curl The following assumes the latest Raspbian Buster lite image. This image comes with py

www.freqtrade.io

1.바이낸스 가격 가져오기

이거대로 install을 한 후, 도커로 여러 기능을 써볼 수 있다. 아래 기능으로 거래소에서 비트코인 가격 그래프를 가져와본다.

 

docker-compose run --rm freqtrade download-data -p BTC/USDT -t 1d --timerange 20230401-20230430 --exchange binance

 

-p ETH/BTC - 페어를 선택한다.
-t 1d - 타임프레임을 설정한다. (5m, 1h, 1d)
--timerange 날짜를 입력한다.
--exchange 사용할 거래소를 선택한다. (https://github.com/freqtrade/freqtrade#supported-exchange-marketplaces)

 

결과는 [timestamp, price]

[[1682726400000,29311.69,29400.0,29297.71,29305.23,408.78855],[1682727300000,29305.23,29326.96,29298.26,29306.34,215.25768],[1682728200000,29306.33,29322.18,29285.76,29301.39,175.84599],[1682729100000,29301.39,29313.4,29195.58,29262.02,461.52635],[1682730000000,29262.03,29265.19,29215.37,29252.95,244.32671],[1682730900000,29252.95,29282.35,29236.82,29280.61,146.86235],[1682731800000,29280.6,29299.0,29268.88,29268.89,116.53967],[1682732700000,29268.89,29282.71,29264.17,29272.64,143.82707],[1682733600000,29272.65,29307.64,29270.76,29290.85,271.6617],[1682734500000,29290.86,29347.79,29290.85,29321.33,310.6091],[1682735400000,29321.34,29370.06,29321.33,29355.98,442.34586],[1682736300000,29355.99,29396.55,29350.12,29374.87,459.903],[1682737200000,29374.88,29384.65,29353.1,29363.43,294.69093],[1682738100000,29363.43,29373.9,29338.93,29373.89,216.0516],[1682739000000,29373.9,29397.59,29353.76,29357.12,270.79302],[1682739900000,29357.11,29367.37,29345.74,29345.74,87.73326],[1682740800000,29345.75,29366.84,29342.0,29355.32,184.45976],[1682741700000,29355.32,29448.88,29355.31,29409.98,409.64025]