The resource loading... loading...

The problem of co-ordination

Author: lzhqlj, Created: 2023-06-08 22:38:26, Updated:

Async with session.get ((url, params=params) as response: data = await response. json (()) if code not in data: print (( update currency pair information, , symbol, "=", pd.Timestamp.now().floor ((s )) df_kline=process_kline_data ((data, symbol,atr_periods,atr_multiplier, change_atr=True) This is a list of all the different ways df_kline is credited in the database. Other: print ((f" received data errorError fetching data: {data[msg]}",symbol)

async def main(): #symbols = get_usdt_pairs()

symbols = get_top_50_volume_coins()
print("监测货币对=",symbols)
async with aiohttp.ClientSession() as session:
    while True:
        tasks = [get_binance_data(session, symbol) for symbol in symbols]
        await asyncio.gather(*tasks)
        print("更新货币对信息=",pd.Timestamp.now().floor("s"))
        await asyncio.sleep(1)

if name == “main”: asyncio.run(main())

The same code, when VSCODE is running, shows the following: Updated currency pair information, RVNUSDT = 2023-06-08 22:33:21 This is the most recent update to the currency pair. Updated currency pair information, ADAUSDT = 2023-06-08 22:33:22 This is the latest update to the ADAUSDT currency pair. Updated currency pair information, ARPAUSDT = 2023-06-08 22:33:22 This is the latest update to the ARPAUSDT Updated currency pair information, GRTUSDT is = 2023-06-08 22:33:23 Updated currency pair information, 1000 SHIBUSDT = 2023-06-08 22:33:24 This is the first update of the currency pair. Updated currency pair information, IOSTUSDT = 2023-06-08 22:33:25 This is the latest version of the update. Updated currency pair information, 1000 SHIBBUSD = 2023-06-08 22:33:25 This is the first update of the currency pair. The basic interval is about one second.

In the following disk, print is changed to Log and other constants: This is a list of all the different ways STMXUSDT is credited in the database, sorted by country. This is a list of all the different ways DOGEUSDT is credited in the database, sorted by country. This is a list of all the different ways REEFUSDT is credited in the database, sorted by country. This is a list of all the different ways PEPEUSDT is credited in the database, sorted by country. The time interval is about 7 seconds.

I think the idea is to use synchronization to simultaneously create 50 currencies for functions that call the formula to calculate the indicator.

What's the reason for the inventor time lag? Is it because of the computer?


More

lzhqljI'm trying to figure out why I'm doing too many tactics at the same time.

lzhqljKeep asking, I have an indicator function that wants to go through all the currencies.

lzhqljYes, DreamSpot, I suspect the same program runs updates very quickly on my own computer, runs like a single thread in a host, accumulates a long time.

Inventors quantify - small dreamsThe code posted is an ordinary Python program and has nothing to do with FMZ.