15분마다 현금을 읽어주세요.

저자:피자이008, 창작: 2023-10-11 02:30:09, 업데이트:

15분마다 현금을 읽어보고 자금 흐름을 그려보세요.

필요한 라이브러리를 가져오기

수입 시간 수입 요청 matplotlib.pyplot를 plt로 가져오기

API 요청 파라미터 설정

api_url = https://api.binance.com/api/v3/account 헤더 = {X-MBX-APIKEY: wCDLQUiV6o1EDfDsEFAMDWGqZ8tzmOaEgAd}

초기화 자금 목록

자금 = []

def main (: while True: while True: try: # API를 시작하여 자금을 요청합니다 응답 = 요청.get ((api_url, headers=headers).json))) usdt_balance = float ((next ((item for item in response [balances] if item [asset] == USDT) [free])

        # 记录资金和时间
        funds.append(usdt_balance)
        
        # 绘制资金曲线
        plt.plot(funds)
        plt.xlabel('Time')
        plt.ylabel('Funds')
        plt.title('USDT Funds')
        plt.grid(True)
        plt.savefig('funds_plot.png')
        plt.close()
        
        # 休眠15分钟
        time.sleep(900)
        
    except Exception as e:
        # 打印错误信息
        Log("Error:", str(e))
        time.sleep(5)

더 많은

작은 꿈자바스크립트나 파이썬?

작은 꿈` `js let lastExecutionTimestamp = 0; // 마지막 로직 실행을 저장하는 시간표 function mainLogic (() { // 여기에 당신의 구체적인 논리를 넣습니다. LogProfit ((profit) // 그래프, 이윤은 특정 수익의 수치입니다. 이 모든 것은 // 마지막 실행시간을 현재 시간으로 변경합니다 lastExecutionTimestamp = Date.now ((); ♪ ♪ function main (() { const currentTimestamp = Date.now ((); // 현재 시간표 를 가져옵니다 // 마지막 실행 시간 이후 15분이 지났다면 if (currentTimestamp - lastExecutionTimestamp >= 15 * 60 * 1000) { mainLogic ((); // 특정 논리를 실행합니다 ♪ ♪ ♪ ♪ `` 이 구조는 아마도 이 구조일 것이다.

피자이008자바에서 어떻게 하면 가능할까요? 15분마다 USDT 현금 정보를 읽고