This commit is contained in:
aaron 2024-06-07 09:41:43 +08:00
parent 8995266ee1
commit b8180a843b
3 changed files with 20 additions and 6 deletions

View File

@ -11,7 +11,7 @@ schedule.every(setting.whaleAlert_minutes).minutes.do(lt.run)
schedule.every().hour.at(":00").do(vegas.run, interval = '1h')
schedule.every().hour.at(":00").do(vegas.run, interval = '4h')
print(f'Running...')
print(f'Running... V1.0')
print(f'Pairs:')
print(utils.get_top_binance_usdt_pairs(20))
while True:

View File

@ -92,7 +92,7 @@ def check_signal(symbol, interval,df):
if latest['longResut']==True:
direction = ''
message = f"⭐️信号提醒⭐️\r\n\r\n品种: {symbol}\r\n周期: {interval}\r\n信号: 【{direction}\r\n当前价格:{latest['open']}\r\n\r\n{latest['timestamp']}"
message = f"⭐️信号提醒⭐️\r\n\r\n策略:【Vegas趋势跟踪V1.0】\r\n品种: {symbol}\r\n周期: {interval}\r\n信号: 【{direction}\r\n当前价格:{latest['open']}\r\n\r\n{latest['timestamp']}"
print(f"{symbol} - {interval} is checked!")
if direction != "":
telegram_sender.send_message(setting.chat_id, message)

22
test.py
View File

@ -1,7 +1,21 @@
import requests
import utils
import pandas as pd
def main():
print(utils.get_top_binance_usdt_pairs(30))
api_url = "https://api.exness.com/v1/ohlc"
params = {
'symbol': 'XAUUSDm',
'interval': '1d',
'start': '2020-01-01',
'end': '2023-01-01'
}
main()
# 发起HTTP请求
response = requests.get(api_url, params=params)
data = response.json()
# 转换为DataFrame
df = pd.DataFrame(data['ohlc'], columns=['timestamp', 'open', 'high', 'low', 'close', 'volume'])
df['timestamp'] = pd.to_datetime(df['timestamp'], unit='s')
# 打印前五行数据
print(df.head())