12
This commit is contained in:
parent
8995266ee1
commit
b8180a843b
2
main.py
2
main.py
@ -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 = '1h')
|
||||||
schedule.every().hour.at(":00").do(vegas.run, interval = '4h')
|
schedule.every().hour.at(":00").do(vegas.run, interval = '4h')
|
||||||
|
|
||||||
print(f'Running...')
|
print(f'Running... V1.0')
|
||||||
print(f'Pairs:')
|
print(f'Pairs:')
|
||||||
print(utils.get_top_binance_usdt_pairs(20))
|
print(utils.get_top_binance_usdt_pairs(20))
|
||||||
while True:
|
while True:
|
||||||
|
|||||||
@ -92,7 +92,7 @@ def check_signal(symbol, interval,df):
|
|||||||
if latest['longResut']==True:
|
if latest['longResut']==True:
|
||||||
direction = '多'
|
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!")
|
print(f"{symbol} - {interval} is checked!")
|
||||||
if direction != "":
|
if direction != "":
|
||||||
telegram_sender.send_message(setting.chat_id, message)
|
telegram_sender.send_message(setting.chat_id, message)
|
||||||
|
|||||||
22
test.py
22
test.py
@ -1,7 +1,21 @@
|
|||||||
import requests
|
import requests
|
||||||
import utils
|
import pandas as pd
|
||||||
|
|
||||||
def main():
|
api_url = "https://api.exness.com/v1/ohlc"
|
||||||
print(utils.get_top_binance_usdt_pairs(30))
|
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())
|
||||||
Loading…
Reference in New Issue
Block a user