update
This commit is contained in:
parent
41cb601203
commit
c68ee8bac2
Binary file not shown.
Binary file not shown.
6
bn.py
6
bn.py
@ -4,8 +4,10 @@ client = Spot()
|
|||||||
|
|
||||||
|
|
||||||
# Get klines
|
# Get klines
|
||||||
def klines(symbol, interval, limit=300):
|
def klines(symbol, interval):
|
||||||
return client.klines(symbol,interval,limit=limit)
|
lines = client.klines(symbol,interval)
|
||||||
|
print(len(lines))
|
||||||
|
return lines
|
||||||
|
|
||||||
# Get Symbols
|
# Get Symbols
|
||||||
def symbols():
|
def symbols():
|
||||||
|
|||||||
2
main.py
2
main.py
@ -1,7 +1,7 @@
|
|||||||
import schedule
|
import schedule
|
||||||
import bn
|
import bn
|
||||||
import time
|
import time
|
||||||
import crossover
|
import strategy.crossover as crossover
|
||||||
|
|
||||||
# 获取交易所交易对
|
# 获取交易所交易对
|
||||||
symbols = bn.symbols()
|
symbols = bn.symbols()
|
||||||
|
|||||||
6
settings.py
Normal file
6
settings.py
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
# telegram bot key
|
||||||
|
telegram_bot_key='5863718864:AAFijN65_SbbGQ0WDBggzKJw2SIcZVTVrPw'
|
||||||
|
|
||||||
|
#
|
||||||
|
chat_id = "@dragon_invest"
|
||||||
@ -1,6 +1,8 @@
|
|||||||
import talib
|
import talib
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import bn
|
import bn
|
||||||
|
import tg
|
||||||
|
import settings
|
||||||
|
|
||||||
# 检查是否出现多头排列信号
|
# 检查是否出现多头排列信号
|
||||||
def check_bullish_crossover(data):
|
def check_bullish_crossover(data):
|
||||||
@ -40,9 +42,16 @@ def check_bearish_crossover(data):
|
|||||||
def strategy_run(symbol, interval):
|
def strategy_run(symbol, interval):
|
||||||
# 获取kline数据
|
# 获取kline数据
|
||||||
data = bn.klines(symbol, interval)
|
data = bn.klines(symbol, interval)
|
||||||
|
print(f'获取Kline数据: [{symbol}] - [{interval}]')
|
||||||
|
|
||||||
if check_bullish_crossover(data):
|
if check_bullish_crossover(data):
|
||||||
print('多头排列信号出现!')
|
print('多头排列信号出现!')
|
||||||
|
|
||||||
|
text = f'${symbol} - {interval}\r\n\r\n出现【多头排列】信号'
|
||||||
|
tg.send_message(settings.chat_id, text)
|
||||||
|
|
||||||
|
|
||||||
if check_bearish_crossover(data):
|
if check_bearish_crossover(data):
|
||||||
print("空头排列信号出现!")
|
print("空头排列信号出现!")
|
||||||
|
text = f'${symbol} - {interval}\r\n\r\n出现【空头排列】信号'
|
||||||
|
tg.send_message(settings.chat_id, text)
|
||||||
Loading…
Reference in New Issue
Block a user