Can you help me coding on how to fetch the minimum / lowest value of any USDT pair on a 24hr period?
import os
from binance.client import Client
from datetime import datetime, timedelta
import time
from itertools import count
import json
from binance import Client, ThreadedWebsocketManager, ThreadedDepthCacheManager
client = Client("xx", "xx")
binance_client = Client(user_key, secret_key)
PAIR_WITH = "USDT"
QUANTITY = 20
FIATS = ["EURUSDT", "GBPUSDT", "JPYUSDT", "USDUSDT", "DOWN", "UP"]
TIME_DIFFERENCE = 5
CHANGE_IN_PRICE = 3
STOP_LOSS = 1
TAKE_PROFIT = 10
def get_price():
initial_price = {}
prices = client.get_all_tickers()
for coin in prices:
if PAIR_WITH in coin["symbol"] and all(item not in coin["symbol"] for item in FIATS):
initial_price[coin["symbol"]] = { "price": coin["price"], "time": datetime.now()}
return initial_price
def prices1day():
initial_price = {}
candles = client.get_klines(interval='1d', limit=1)
listmax = []
listmin = []
i=0
for sublist in candles:
listmax += [candles[i][2]]
listmin += [candles[i][3]]
i+= 1
listmax.sort()
listmin.sort()
if PAIR_WITH in coin["symbol"] and all(item not in coin["symbol"] for item in FIATS):
initial_price[coin["symbol"]] = { "price": coin["price"], "time": datetime.now()}
print(listmax[-1])
print(listmin[0])
return initial_price
ยดยดยด
Could you help me with the last part?
Thanks.